summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlegacy/3945-mac.c
diff options
context:
space:
mode:
authorStanislaw Gruszka <sgruszka@redhat.com>2012-02-13 11:23:24 +0100
committerJohn W. Linville <linville@tuxdriver.com>2012-02-22 14:51:16 -0500
commit775ed8abde9420afc955ca7540aacdce721be6c1 (patch)
tree7ff55b22f75b9d694382514f6d59c490f5d1df1c /drivers/net/wireless/iwlegacy/3945-mac.c
parentc37281a076604937ec2403f3cfec71362f93c7d8 (diff)
downloadblackbird-obmc-linux-775ed8abde9420afc955ca7540aacdce721be6c1.tar.gz
blackbird-obmc-linux-775ed8abde9420afc955ca7540aacdce721be6c1.zip
iwlegacy: do not grab nic access if rfkill
If rfkill is on il_grab_nic_access() fail and we can not write to the various registers during stop procedure. Write to those registers unconditionally instead. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlegacy/3945-mac.c')
-rw-r--r--drivers/net/wireless/iwlegacy/3945-mac.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/drivers/net/wireless/iwlegacy/3945-mac.c b/drivers/net/wireless/iwlegacy/3945-mac.c
index 002cf4fd5a55..ee91ab2e3858 100644
--- a/drivers/net/wireless/iwlegacy/3945-mac.c
+++ b/drivers/net/wireless/iwlegacy/3945-mac.c
@@ -2286,16 +2286,25 @@ __il3945_down(struct il_priv *il)
test_bit(S_FW_ERROR, &il->status) << S_FW_ERROR |
test_bit(S_EXIT_PENDING, &il->status) << S_EXIT_PENDING;
+ /*
+ * We disabled and synchronized interrupt, and priv->mutex is taken, so
+ * here is the only thread which will program device registers, but
+ * still have lockdep assertions, so we are taking reg_lock.
+ */
+ spin_lock_irq(&il->reg_lock);
+ /* FIXME: il_grab_nic_access if rfkill is off ? */
+
il3945_hw_txq_ctx_stop(il);
il3945_hw_rxq_stop(il);
-
/* Power-down device's busmaster DMA clocks */
- il_wr_prph(il, APMG_CLK_DIS_REG, APMG_CLK_VAL_DMA_CLK_RQT);
+ _il_wr_prph(il, APMG_CLK_DIS_REG, APMG_CLK_VAL_DMA_CLK_RQT);
udelay(5);
-
/* Stop the device, and put it in low power state */
- il_apm_stop(il);
+ _il_apm_stop(il);
+ spin_unlock_irq(&il->reg_lock);
+
+ il3945_hw_txq_ctx_free(il);
exit:
memset(&il->card_alive, 0, sizeof(struct il_alive_resp));
OpenPOWER on IntegriCloud