Skip to content

Commit

Permalink
mac802154: tx: fix synced xmit deadlock
Browse files Browse the repository at this point in the history
This patch reverts 6001d52 ("mac802154: tx: don't allow if down while
sync tx"). This has side effects with stop callback which flush the
transmit workqueue. The stop callback will wait until the workqueue is
flushed and holding the rtnl lock. That means it can happen that the stop
callback waits forever because it try to lock the rtnl mutex which is
already hold by stop callback.

Cc: Michael Hennerich <[email protected]>
Signed-off-by: Alexander Aring <[email protected]>
Signed-off-by: Marcel Holtmann <[email protected]>
  • Loading branch information
alexaring authored and holtmann committed Dec 10, 2015
1 parent 818f1f3 commit c383835
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 12 deletions.
3 changes: 0 additions & 3 deletions net/mac802154/driver-ops.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ drv_xmit_async(struct ieee802154_local *local, struct sk_buff *skb)
static inline int
drv_xmit_sync(struct ieee802154_local *local, struct sk_buff *skb)
{
/* don't allow other operations while sync xmit */
ASSERT_RTNL();

might_sleep();

return local->ops->xmit_sync(&local->hw, skb);
Expand Down
9 changes: 0 additions & 9 deletions net/mac802154/tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,6 @@ void ieee802154_xmit_worker(struct work_struct *work)
struct net_device *dev = skb->dev;
int res;

rtnl_lock();

/* check if ifdown occurred while schedule */
if (!netif_running(dev))
goto err_tx;

res = drv_xmit_sync(local, skb);
if (res)
goto err_tx;
Expand All @@ -53,14 +47,11 @@ void ieee802154_xmit_worker(struct work_struct *work)
dev->stats.tx_packets++;
dev->stats.tx_bytes += skb->len;

rtnl_unlock();

return;

err_tx:
/* Restart the netif queue on each sub_if_data object. */
ieee802154_wake_queue(&local->hw);
rtnl_unlock();
kfree_skb(skb);
netdev_dbg(dev, "transmission failed\n");
}
Expand Down

0 comments on commit c383835

Please sign in to comment.