diff options
author | Christian Lamparter <chunkeey@web.de> | 2009-03-27 20:46:14 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-04-22 16:54:29 -0400 |
commit | 32c1628f153a5468cf48be5e5c04cd599ae9e01d (patch) | |
tree | 592608e027f1ff2bbd8344aebee2f88e5b21f74d /drivers/net/wireless/ar9170 | |
parent | 807e37394b5a1dc23a2908b59f34edbbae67e9ea (diff) |
ar9170: fix hang on stop
This patch fixes a locking problem which freezes the network core.
The deadlock goes as follows:
- ar9170_op_stop - is called
1. change the state to IDLE
2. > take the MUTEX <
3. cancel_SYNC all pending work, which means
"block until a work_struct's callback has terminated"
=> if filter_config_work was queued it tries to get the MUTEX,
before checking the device state...
Signed-off-by: Christian Lamparter <chunkeey@web.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ar9170')
-rw-r--r-- | drivers/net/wireless/ar9170/main.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/net/wireless/ar9170/main.c b/drivers/net/wireless/ar9170/main.c index 5996ff9f7f47..5f55754d968f 100644 --- a/drivers/net/wireless/ar9170/main.c +++ b/drivers/net/wireless/ar9170/main.c | |||
@@ -742,8 +742,9 @@ static void ar9170_op_stop(struct ieee80211_hw *hw) | |||
742 | if (IS_STARTED(ar)) | 742 | if (IS_STARTED(ar)) |
743 | ar->state = AR9170_IDLE; | 743 | ar->state = AR9170_IDLE; |
744 | 744 | ||
745 | mutex_lock(&ar->mutex); | 745 | flush_workqueue(ar->hw->workqueue); |
746 | 746 | ||
747 | mutex_lock(&ar->mutex); | ||
747 | cancel_delayed_work_sync(&ar->tx_status_janitor); | 748 | cancel_delayed_work_sync(&ar->tx_status_janitor); |
748 | cancel_work_sync(&ar->filter_config_work); | 749 | cancel_work_sync(&ar->filter_config_work); |
749 | cancel_work_sync(&ar->beacon_work); | 750 | cancel_work_sync(&ar->beacon_work); |
@@ -1123,10 +1124,10 @@ static void ar9170_set_filters(struct work_struct *work) | |||
1123 | filter_config_work); | 1124 | filter_config_work); |
1124 | int err; | 1125 | int err; |
1125 | 1126 | ||
1126 | mutex_lock(&ar->mutex); | ||
1127 | if (unlikely(!IS_STARTED(ar))) | 1127 | if (unlikely(!IS_STARTED(ar))) |
1128 | goto unlock; | 1128 | return ; |
1129 | 1129 | ||
1130 | mutex_lock(&ar->mutex); | ||
1130 | if (ar->filter_changed & AR9170_FILTER_CHANGED_PROMISC) { | 1131 | if (ar->filter_changed & AR9170_FILTER_CHANGED_PROMISC) { |
1131 | err = ar9170_set_operating_mode(ar); | 1132 | err = ar9170_set_operating_mode(ar); |
1132 | if (err) | 1133 | if (err) |