Commit e972e78e authored by Philippe Gerum's avatar Philippe Gerum Committed by Jan Kiszka
Browse files

net/rtdev: ensure per-device skbs get mapped at registration

This patch works around a regression introduced by #74464ee3

causing a new device's skbs not to be passed to its ->map_rtskb()
handler when registered, breaking further DMA inits in the driver.
Signed-off-by: Philippe Gerum's avatarPhilippe Gerum <>
Signed-off-by: Jan Kiszka's avatarJan Kiszka <>
parent 217706f7
......@@ -45,6 +45,7 @@ struct rtnet_device *rtnet_devices[MAX_RT_DEVICES];
static struct rtnet_device *loopback_device;
static DEFINE_RTDM_LOCK(rtnet_devices_rt_lock);
static LIST_HEAD(rtskb_mapped_list);
static LIST_HEAD(rtskb_mapwait_list);
......@@ -459,8 +460,12 @@ int rtdev_map_rtskb(struct rtskb *skb)
if (!err && skb->buf_dma_addr != RTSKB_UNMAPPED)
if (!err) {
if (skb->buf_dma_addr != RTSKB_UNMAPPED)
list_add(&skb->entry, &rtskb_mapped_list);
list_add(&skb->entry, &rtskb_mapwait_list);
......@@ -471,7 +476,7 @@ int rtdev_map_rtskb(struct rtskb *skb)
static int rtdev_map_all_rtskbs(struct rtnet_device *rtdev)
struct rtskb *skb;
struct rtskb *skb, *n;
int err = 0;
if (!rtdev->map_rtskb)
......@@ -483,6 +488,14 @@ static int rtdev_map_all_rtskbs(struct rtnet_device *rtdev)
list_for_each_entry_safe(skb, n, &rtskb_mapwait_list, entry) {
err = rtskb_map(rtdev, skb);
if (err)
list_add(&skb->entry, &rtskb_mapped_list);
return err;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment