diff options
author | Michael Büsch <m@bues.ch> | 2011-11-16 23:55:46 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-12-09 09:21:39 -0800 |
commit | 92afd4898af2cb25b0d99ed23ddb3ae119007e62 (patch) | |
tree | 3de3bea4563e0834627e308fa2e2c73467f7b323 | |
parent | cd42f5dd80b534a3b61afd0e469d98602e1858d8 (diff) | |
download | linux-stable-92afd4898af2cb25b0d99ed23ddb3ae119007e62.tar.gz linux-stable-92afd4898af2cb25b0d99ed23ddb3ae119007e62.tar.bz2 linux-stable-92afd4898af2cb25b0d99ed23ddb3ae119007e62.zip |
p54spi: Fix workqueue deadlock
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 <m@bues.ch>
Acked-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | drivers/net/wireless/p54/p54spi.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/wireless/p54/p54spi.c b/drivers/net/wireless/p54/p54spi.c index b2f750a1e808..d9bd46d49276 100644 --- a/drivers/net/wireless/p54/p54spi.c +++ b/drivers/net/wireless/p54/p54spi.c @@ -581,8 +581,6 @@ static void p54spi_op_stop(struct ieee80211_hw *dev) WARN_ON(priv->fw_state != FW_STATE_READY); - cancel_work_sync(&priv->work); - p54spi_power_off(priv); spin_lock_irqsave(&priv->tx_lock, flags); INIT_LIST_HEAD(&priv->tx_pending); @@ -590,6 +588,8 @@ static void p54spi_op_stop(struct ieee80211_hw *dev) priv->fw_state = FW_STATE_OFF; mutex_unlock(&priv->mutex); + + cancel_work_sync(&priv->work); } static int __devinit p54spi_probe(struct spi_device *spi) |