diff options
author | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2011-07-20 20:51:22 -0400 |
---|---|---|
committer | Wey-Yi Guy <wey-yi.w.guy@intel.com> | 2011-07-21 10:41:07 -0400 |
commit | 1e89cbac16dd91f1ddbf53c68fecb85d42793841 (patch) | |
tree | c183e9b924e90f01f858f0abc7b65c91f1a07297 | |
parent | d62b39e105e427510f8996c03db9ce1bf83fcad8 (diff) |
iwlagn: probe would crash with DEBUG_SHIRQ
This is since my patch:
iwlagn: introduce transport layer and implement rx_init
The IRQ is requested before the locks are initialized, hence the crash.
Initialize the tasklet before we request the IRQ on the way.
Reported-by: Johannes Berg <johannes.berg@intel.com>
Tested-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn.c | 16 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-trans.c | 6 |
2 files changed, 11 insertions, 11 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c index 299acb491f0d..4b666b7dfe60 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn.c | |||
@@ -3645,10 +3645,6 @@ int iwl_probe(struct iwl_bus *bus, struct iwl_cfg *cfg) | |||
3645 | priv->cfg = cfg; | 3645 | priv->cfg = cfg; |
3646 | priv->inta_mask = CSR_INI_SET_MASK; | 3646 | priv->inta_mask = CSR_INI_SET_MASK; |
3647 | 3647 | ||
3648 | err = iwl_trans_register(&priv->trans, priv); | ||
3649 | if (err) | ||
3650 | goto out_free_priv; | ||
3651 | |||
3652 | /* is antenna coupling more than 35dB ? */ | 3648 | /* is antenna coupling more than 35dB ? */ |
3653 | priv->bt_ant_couple_ok = | 3649 | priv->bt_ant_couple_ok = |
3654 | (iwlagn_ant_coupling > IWL_BT_ANTENNA_COUPLING_THRESHOLD) ? | 3650 | (iwlagn_ant_coupling > IWL_BT_ANTENNA_COUPLING_THRESHOLD) ? |
@@ -3682,10 +3678,14 @@ int iwl_probe(struct iwl_bus *bus, struct iwl_cfg *cfg) | |||
3682 | IWL_INFO(priv, "Detected %s, REV=0x%X\n", | 3678 | IWL_INFO(priv, "Detected %s, REV=0x%X\n", |
3683 | priv->cfg->name, hw_rev); | 3679 | priv->cfg->name, hw_rev); |
3684 | 3680 | ||
3681 | err = iwl_trans_register(&priv->trans, priv); | ||
3682 | if (err) | ||
3683 | goto out_free_traffic_mem; | ||
3684 | |||
3685 | if (trans_prepare_card_hw(&priv->trans)) { | 3685 | if (trans_prepare_card_hw(&priv->trans)) { |
3686 | err = -EIO; | 3686 | err = -EIO; |
3687 | IWL_WARN(priv, "Failed, HW not ready\n"); | 3687 | IWL_WARN(priv, "Failed, HW not ready\n"); |
3688 | goto out_free_traffic_mem; | 3688 | goto out_free_trans; |
3689 | } | 3689 | } |
3690 | 3690 | ||
3691 | /***************** | 3691 | /***************** |
@@ -3695,7 +3695,7 @@ int iwl_probe(struct iwl_bus *bus, struct iwl_cfg *cfg) | |||
3695 | err = iwl_eeprom_init(priv, hw_rev); | 3695 | err = iwl_eeprom_init(priv, hw_rev); |
3696 | if (err) { | 3696 | if (err) { |
3697 | IWL_ERR(priv, "Unable to init EEPROM\n"); | 3697 | IWL_ERR(priv, "Unable to init EEPROM\n"); |
3698 | goto out_free_traffic_mem; | 3698 | goto out_free_trans; |
3699 | } | 3699 | } |
3700 | err = iwl_eeprom_check_version(priv); | 3700 | err = iwl_eeprom_check_version(priv); |
3701 | if (err) | 3701 | if (err) |
@@ -3778,10 +3778,10 @@ out_destroy_workqueue: | |||
3778 | iwl_uninit_drv(priv); | 3778 | iwl_uninit_drv(priv); |
3779 | out_free_eeprom: | 3779 | out_free_eeprom: |
3780 | iwl_eeprom_free(priv); | 3780 | iwl_eeprom_free(priv); |
3781 | out_free_trans: | ||
3782 | trans_free(&priv->trans); | ||
3781 | out_free_traffic_mem: | 3783 | out_free_traffic_mem: |
3782 | iwl_free_traffic_mem(priv); | 3784 | iwl_free_traffic_mem(priv); |
3783 | trans_free(&priv->trans); | ||
3784 | out_free_priv: | ||
3785 | ieee80211_free_hw(priv->hw); | 3785 | ieee80211_free_hw(priv->hw); |
3786 | out: | 3786 | out: |
3787 | return err; | 3787 | return err; |
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans.c b/drivers/net/wireless/iwlwifi/iwl-trans.c index 582ab1b8e734..41f0de914008 100644 --- a/drivers/net/wireless/iwlwifi/iwl-trans.c +++ b/drivers/net/wireless/iwlwifi/iwl-trans.c | |||
@@ -1153,6 +1153,9 @@ int iwl_trans_register(struct iwl_trans *trans, struct iwl_priv *priv) | |||
1153 | priv->trans.ops = &trans_ops; | 1153 | priv->trans.ops = &trans_ops; |
1154 | priv->trans.priv = priv; | 1154 | priv->trans.priv = priv; |
1155 | 1155 | ||
1156 | tasklet_init(&priv->irq_tasklet, (void (*)(unsigned long)) | ||
1157 | iwl_irq_tasklet, (unsigned long)priv); | ||
1158 | |||
1156 | iwl_alloc_isr_ict(priv); | 1159 | iwl_alloc_isr_ict(priv); |
1157 | 1160 | ||
1158 | err = request_irq(priv->bus->irq, iwl_isr_ict, IRQF_SHARED, | 1161 | err = request_irq(priv->bus->irq, iwl_isr_ict, IRQF_SHARED, |
@@ -1163,9 +1166,6 @@ int iwl_trans_register(struct iwl_trans *trans, struct iwl_priv *priv) | |||
1163 | return err; | 1166 | return err; |
1164 | } | 1167 | } |
1165 | 1168 | ||
1166 | tasklet_init(&priv->irq_tasklet, (void (*)(unsigned long)) | ||
1167 | iwl_irq_tasklet, (unsigned long)priv); | ||
1168 | |||
1169 | INIT_WORK(&priv->rx_replenish, iwl_bg_rx_replenish); | 1169 | INIT_WORK(&priv->rx_replenish, iwl_bg_rx_replenish); |
1170 | 1170 | ||
1171 | return 0; | 1171 | return 0; |