summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-core.c
diff options
context:
space:
mode:
authorJohannes Berg2011-04-19 16:38:23 +0200
committerWey-Yi Guy2011-04-30 17:39:12 +0200
commit9d39e5bad76a8830a8fa0c03cadc1e36ce2ec2ef (patch)
tree1bb63011eea553fdf20ef7e6bfcc52f3d5bd19fc /drivers/net/wireless/iwlwifi/iwl-core.c
parentmwl8k: Reducing extra_tx_headroom for tx optimization in AP mode (diff)
downloadkernel-qcow2-linux-9d39e5bad76a8830a8fa0c03cadc1e36ce2ec2ef.tar.gz
kernel-qcow2-linux-9d39e5bad76a8830a8fa0c03cadc1e36ce2ec2ef.tar.xz
kernel-qcow2-linux-9d39e5bad76a8830a8fa0c03cadc1e36ce2ec2ef.zip
iwlagn: avoid hangs when restarting device
If a device error happens while the uCode is being loaded or initialised, we will attempt to restart the device (which will likely fail again, but that's not the issue here). During this new restart, we turn off the device, but as the uCode failed to initialise it already is turned off. As a consequence, grabbing NIC access will fail and cause excessive messages and hangs. To fix this issue, introduce a new status bit and only attempt to reprogram the device when it isn't already disabled. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-core.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-core.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c
index af72fd51ea74..66da1dec982c 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.c
+++ b/drivers/net/wireless/iwlwifi/iwl-core.c
@@ -995,6 +995,8 @@ void iwl_apm_stop(struct iwl_priv *priv)
{
IWL_DEBUG_INFO(priv, "Stop card, put in low power state\n");
+ clear_bit(STATUS_DEVICE_ENABLED, &priv->status);
+
/* Stop device's DMA activity */
iwl_apm_stop_master(priv);
@@ -1109,6 +1111,8 @@ int iwl_apm_init(struct iwl_priv *priv)
iwl_set_bits_prph(priv, APMG_PCIDEV_STT_REG,
APMG_PCIDEV_STT_VAL_L1_ACT_DIS);
+ set_bit(STATUS_DEVICE_ENABLED, &priv->status);
+
out:
return ret;
}