|
@@ -2363,12 +2363,21 @@ void iwlagn_stop_device(struct iwl_priv *priv)
|
|
|
/* device going down, Stop using ICT table */
|
|
|
iwl_disable_ict(priv);
|
|
|
|
|
|
- iwlagn_txq_ctx_stop(priv);
|
|
|
- iwlagn_rxq_stop(priv);
|
|
|
-
|
|
|
- /* Power-down device's busmaster DMA clocks */
|
|
|
- iwl_write_prph(priv, APMG_CLK_DIS_REG, APMG_CLK_VAL_DMA_CLK_RQT);
|
|
|
- udelay(5);
|
|
|
+ /*
|
|
|
+ * If a HW restart happens during firmware loading,
|
|
|
+ * then the firmware loading might call this function
|
|
|
+ * and later it might be called again due to the
|
|
|
+ * restart. So don't process again if the device is
|
|
|
+ * already dead.
|
|
|
+ */
|
|
|
+ if (test_bit(STATUS_DEVICE_ENABLED, &priv->status)) {
|
|
|
+ iwlagn_txq_ctx_stop(priv);
|
|
|
+ iwlagn_rxq_stop(priv);
|
|
|
+
|
|
|
+ /* Power-down device's busmaster DMA clocks */
|
|
|
+ iwl_write_prph(priv, APMG_CLK_DIS_REG, APMG_CLK_VAL_DMA_CLK_RQT);
|
|
|
+ udelay(5);
|
|
|
+ }
|
|
|
|
|
|
/* Make sure (redundant) we've released our request to stay awake */
|
|
|
iwl_clear_bit(priv, CSR_GP_CNTRL, CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ);
|