Commit 1e89cbac authored by Emmanuel Grumbach's avatar Emmanuel Grumbach Committed by Wey-Yi Guy

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: default avatarJohannes Berg <johannes.berg@intel.com>
Tested-by: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: default avatarWey-Yi Guy <wey-yi.w.guy@intel.com>
parent d62b39e1
...@@ -3645,10 +3645,6 @@ int iwl_probe(struct iwl_bus *bus, struct iwl_cfg *cfg) ...@@ -3645,10 +3645,6 @@ int iwl_probe(struct iwl_bus *bus, struct iwl_cfg *cfg)
priv->cfg = cfg; priv->cfg = cfg;
priv->inta_mask = CSR_INI_SET_MASK; priv->inta_mask = CSR_INI_SET_MASK;
err = iwl_trans_register(&priv->trans, priv);
if (err)
goto out_free_priv;
/* is antenna coupling more than 35dB ? */ /* is antenna coupling more than 35dB ? */
priv->bt_ant_couple_ok = priv->bt_ant_couple_ok =
(iwlagn_ant_coupling > IWL_BT_ANTENNA_COUPLING_THRESHOLD) ? (iwlagn_ant_coupling > IWL_BT_ANTENNA_COUPLING_THRESHOLD) ?
...@@ -3682,10 +3678,14 @@ int iwl_probe(struct iwl_bus *bus, struct iwl_cfg *cfg) ...@@ -3682,10 +3678,14 @@ int iwl_probe(struct iwl_bus *bus, struct iwl_cfg *cfg)
IWL_INFO(priv, "Detected %s, REV=0x%X\n", IWL_INFO(priv, "Detected %s, REV=0x%X\n",
priv->cfg->name, hw_rev); priv->cfg->name, hw_rev);
err = iwl_trans_register(&priv->trans, priv);
if (err)
goto out_free_traffic_mem;
if (trans_prepare_card_hw(&priv->trans)) { if (trans_prepare_card_hw(&priv->trans)) {
err = -EIO; err = -EIO;
IWL_WARN(priv, "Failed, HW not ready\n"); IWL_WARN(priv, "Failed, HW not ready\n");
goto out_free_traffic_mem; goto out_free_trans;
} }
/***************** /*****************
...@@ -3695,7 +3695,7 @@ int iwl_probe(struct iwl_bus *bus, struct iwl_cfg *cfg) ...@@ -3695,7 +3695,7 @@ int iwl_probe(struct iwl_bus *bus, struct iwl_cfg *cfg)
err = iwl_eeprom_init(priv, hw_rev); err = iwl_eeprom_init(priv, hw_rev);
if (err) { if (err) {
IWL_ERR(priv, "Unable to init EEPROM\n"); IWL_ERR(priv, "Unable to init EEPROM\n");
goto out_free_traffic_mem; goto out_free_trans;
} }
err = iwl_eeprom_check_version(priv); err = iwl_eeprom_check_version(priv);
if (err) if (err)
...@@ -3778,10 +3778,10 @@ int iwl_probe(struct iwl_bus *bus, struct iwl_cfg *cfg) ...@@ -3778,10 +3778,10 @@ int iwl_probe(struct iwl_bus *bus, struct iwl_cfg *cfg)
iwl_uninit_drv(priv); iwl_uninit_drv(priv);
out_free_eeprom: out_free_eeprom:
iwl_eeprom_free(priv); iwl_eeprom_free(priv);
out_free_trans:
trans_free(&priv->trans);
out_free_traffic_mem: out_free_traffic_mem:
iwl_free_traffic_mem(priv); iwl_free_traffic_mem(priv);
trans_free(&priv->trans);
out_free_priv:
ieee80211_free_hw(priv->hw); ieee80211_free_hw(priv->hw);
out: out:
return err; return err;
......
...@@ -1153,6 +1153,9 @@ int iwl_trans_register(struct iwl_trans *trans, struct iwl_priv *priv) ...@@ -1153,6 +1153,9 @@ int iwl_trans_register(struct iwl_trans *trans, struct iwl_priv *priv)
priv->trans.ops = &trans_ops; priv->trans.ops = &trans_ops;
priv->trans.priv = priv; priv->trans.priv = priv;
tasklet_init(&priv->irq_tasklet, (void (*)(unsigned long))
iwl_irq_tasklet, (unsigned long)priv);
iwl_alloc_isr_ict(priv); iwl_alloc_isr_ict(priv);
err = request_irq(priv->bus->irq, iwl_isr_ict, IRQF_SHARED, 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,9 +1166,6 @@ int iwl_trans_register(struct iwl_trans *trans, struct iwl_priv *priv)
return err; return err;
} }
tasklet_init(&priv->irq_tasklet, (void (*)(unsigned long))
iwl_irq_tasklet, (unsigned long)priv);
INIT_WORK(&priv->rx_replenish, iwl_bg_rx_replenish); INIT_WORK(&priv->rx_replenish, iwl_bg_rx_replenish);
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment