[lkml]   [2013]   [Jan]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[v2.6.34-stable 28/77] p54spi: Fix workqueue deadlock
From: Michael Büsch <>

This is a commit scheduled for the next v2.6.34 longterm release.
If you see a problem with using this for longterm, please comment.

commit 2d1618170eb493d18f66f2ac03775409a6fb97c6 upstream.

priv->work must not be synced while priv->mutex is locked, because
the mutex is taken in the work handler.
Move cancel_work_sync down to after the device shutdown code.
This is safe, because the work handler checks fw_state and bails out
early in case of a race.

Signed-off-by: Michael Buesch <>
Acked-by: Christian Lamparter <>
Signed-off-by: John W. Linville <>
Signed-off-by: Paul Gortmaker <>
drivers/net/wireless/p54/p54spi.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/p54/p54spi.c b/drivers/net/wireless/p54/p54spi.c
index 4cede24..8cf0301 100644
--- a/drivers/net/wireless/p54/p54spi.c
+++ b/drivers/net/wireless/p54/p54spi.c
@@ -582,8 +582,6 @@ static void p54spi_op_stop(struct ieee80211_hw *dev)

WARN_ON(priv->fw_state != FW_STATE_READY);

- cancel_work_sync(&priv->work);
spin_lock_irqsave(&priv->tx_lock, flags);
@@ -591,6 +589,8 @@ static void p54spi_op_stop(struct ieee80211_hw *dev)

priv->fw_state = FW_STATE_OFF;
+ cancel_work_sync(&priv->work);

static int __devinit p54spi_probe(struct spi_device *spi)
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2013-01-09 01:21    [W:0.189 / U:0.400 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site