All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH bluetooth] mac802154: tx: fix synced xmit deadlock
@ 2015-12-09 22:15 Alexander Aring
  2015-12-09 22:18 ` Alexander Aring
  0 siblings, 1 reply; 2+ messages in thread
From: Alexander Aring @ 2015-12-09 22:15 UTC (permalink / raw)
  To: linux-wpan; +Cc: kernel, Alexander Aring, Michael Hennerich

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 <michael.hennerich@analog.com>
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
---
 net/mac802154/tx.c | 9 ---------
 1 file changed, 9 deletions(-)

diff --git a/net/mac802154/tx.c b/net/mac802154/tx.c
index 3827f35..7e25345 100644
--- a/net/mac802154/tx.c
+++ b/net/mac802154/tx.c
@@ -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;
@@ -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");
 }
-- 
2.6.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH bluetooth] mac802154: tx: fix synced xmit deadlock
  2015-12-09 22:15 [PATCH bluetooth] mac802154: tx: fix synced xmit deadlock Alexander Aring
@ 2015-12-09 22:18 ` Alexander Aring
  0 siblings, 0 replies; 2+ messages in thread
From: Alexander Aring @ 2015-12-09 22:18 UTC (permalink / raw)
  To: linux-wpan; +Cc: kernel, Michael Hennerich

Hi Marcel,

On Wed, Dec 09, 2015 at 11:15:31PM +0100, Alexander Aring wrote:
> 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.
> 

wrong patch here, I will send a v2 which also remove the ASSERT_RTNL
while synced xmit driver callback.

- Alex


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-12-09 22:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-09 22:15 [PATCH bluetooth] mac802154: tx: fix synced xmit deadlock Alexander Aring
2015-12-09 22:18 ` Alexander Aring

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.