aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorBen Cahill <ben.m.cahill@intel.com>2009-10-23 16:42:35 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-10-27 16:50:03 -0400
commitc166b25a5c02d881b1da15f3afe9dc9e56b206a8 (patch)
tree647be6f491476f29bb8592749699f1b89dd84055 /drivers
parent442464218d93aa0aacc55c3a7ac908ae00abff5f (diff)
iwlwifi: make sure device is reset when unloading driver
Add unconditional call to apm_ops.stop() to reset device to low power state when unloading driver. Some paths have existed to unload driver *without* resetting device, therefore some errors have persisted through multiple load/unload cycles, until the whole platform gets rebooted; this is an attempt to remedy some of those situations. Sorry, I can't seem to find a bughost.org bug that specifically has these symptoms, but I had it happen recently here. Note that this will *not* fix situations in which the PCI express bus has crashed (evidenced by register reads showing "0xffffffff"), e.g. bughost.org 1855 and 2096; device is unreachable from driver in those cases. Signed-off-by: Ben Cahill <ben.m.cahill@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c9
-rw-r--r--drivers/net/wireless/iwlwifi/iwl3945-base.c9
2 files changed, 18 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index ea1b9315f17c..fa1672e99e4b 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -3256,6 +3256,15 @@ static void __devexit iwl_pci_remove(struct pci_dev *pdev)
3256 iwl_down(priv); 3256 iwl_down(priv);
3257 } 3257 }
3258 3258
3259 /*
3260 * Make sure device is reset to low power before unloading driver.
3261 * This may be redundant with iwl_down(), but there are paths to
3262 * run iwl_down() without calling apm_ops.stop(), and there are
3263 * paths to avoid running iwl_down() at all before leaving driver.
3264 * This (inexpensive) call *makes sure* device is reset.
3265 */
3266 priv->cfg->ops->lib->apm_ops.stop(priv);
3267
3259 iwl_tt_exit(priv); 3268 iwl_tt_exit(priv);
3260 3269
3261 /* make sure we flush any pending irq or 3270 /* make sure we flush any pending irq or
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index 9a430eed34ad..bfd7f497157f 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -4135,6 +4135,15 @@ static void __devexit iwl3945_pci_remove(struct pci_dev *pdev)
4135 iwl3945_down(priv); 4135 iwl3945_down(priv);
4136 } 4136 }
4137 4137
4138 /*
4139 * Make sure device is reset to low power before unloading driver.
4140 * This may be redundant with iwl_down(), but there are paths to
4141 * run iwl_down() without calling apm_ops.stop(), and there are
4142 * paths to avoid running iwl_down() at all before leaving driver.
4143 * This (inexpensive) call *makes sure* device is reset.
4144 */
4145 priv->cfg->ops->lib->apm_ops.stop(priv);
4146
4138 /* make sure we flush any pending irq or 4147 /* make sure we flush any pending irq or
4139 * tasklet for the driver 4148 * tasklet for the driver
4140 */ 4149 */