aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorReinette Chatre <reinette.chatre@intel.com>2009-12-14 17:12:11 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-12-21 11:32:10 -0500
commit731a29b74aa823e09a6547befce3f721bef32f86 (patch)
treecea8d462b9a0ae35a52f4a3b1a4dd409b2b2ecc1
parentbc45a67079c916a9bd0a95b0b879cc0f259bac6e (diff)
iwlwifi: initialize spinlock before use
Recent powersaving work resulted in power management ops being called during EEPROM initialization. The lock used by these functions is not initialized at this time. Ensure lock is initialized before it is used. Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c4
-rw-r--r--drivers/net/wireless/iwlwifi/iwl3945-base.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index 715db219f905..1c9866daf815 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -3173,7 +3173,6 @@ static int iwl_init_drv(struct iwl_priv *priv)
3173 3173
3174 priv->ibss_beacon = NULL; 3174 priv->ibss_beacon = NULL;
3175 3175
3176 spin_lock_init(&priv->lock);
3177 spin_lock_init(&priv->sta_lock); 3176 spin_lock_init(&priv->sta_lock);
3178 spin_lock_init(&priv->hcmd_lock); 3177 spin_lock_init(&priv->hcmd_lock);
3179 3178
@@ -3361,10 +3360,11 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
3361 (unsigned long long) pci_resource_len(pdev, 0)); 3360 (unsigned long long) pci_resource_len(pdev, 0));
3362 IWL_DEBUG_INFO(priv, "pci_resource_base = %p\n", priv->hw_base); 3361 IWL_DEBUG_INFO(priv, "pci_resource_base = %p\n", priv->hw_base);
3363 3362
3364 /* this spin lock will be used in apm_ops.init and EEPROM access 3363 /* these spin locks will be used in apm_ops.init and EEPROM access
3365 * we should init now 3364 * we should init now
3366 */ 3365 */
3367 spin_lock_init(&priv->reg_lock); 3366 spin_lock_init(&priv->reg_lock);
3367 spin_lock_init(&priv->lock);
3368 iwl_hw_detect(priv); 3368 iwl_hw_detect(priv);
3369 IWL_INFO(priv, "Detected Intel Wireless WiFi Link %s REV=0x%X\n", 3369 IWL_INFO(priv, "Detected Intel Wireless WiFi Link %s REV=0x%X\n",
3370 priv->cfg->name, priv->hw_rev); 3370 priv->cfg->name, priv->hw_rev);
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index c322d6c13182..96b23f4571cb 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -3863,7 +3863,6 @@ static int iwl3945_init_drv(struct iwl_priv *priv)
3863 priv->retry_rate = 1; 3863 priv->retry_rate = 1;
3864 priv->ibss_beacon = NULL; 3864 priv->ibss_beacon = NULL;
3865 3865
3866 spin_lock_init(&priv->lock);
3867 spin_lock_init(&priv->sta_lock); 3866 spin_lock_init(&priv->sta_lock);
3868 spin_lock_init(&priv->hcmd_lock); 3867 spin_lock_init(&priv->hcmd_lock);
3869 3868
@@ -4055,10 +4054,11 @@ static int iwl3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e
4055 * PCI Tx retries from interfering with C3 CPU state */ 4054 * PCI Tx retries from interfering with C3 CPU state */
4056 pci_write_config_byte(pdev, 0x41, 0x00); 4055 pci_write_config_byte(pdev, 0x41, 0x00);
4057 4056
4058 /* this spin lock will be used in apm_ops.init and EEPROM access 4057 /* these spin locks will be used in apm_ops.init and EEPROM access
4059 * we should init now 4058 * we should init now
4060 */ 4059 */
4061 spin_lock_init(&priv->reg_lock); 4060 spin_lock_init(&priv->reg_lock);
4061 spin_lock_init(&priv->lock);
4062 4062
4063 /*********************** 4063 /***********************
4064 * 4. Read EEPROM 4064 * 4. Read EEPROM