Skip to content

Commit 2351d03

Browse files
Stanislaw GruszkaIgor
authored andcommitted
iwlegacy: do not use interruptible waits
iwlegacy version of fix: commit effd4d9 Author: Johannes Berg <johannes.berg@intel.com> Date: Thu Sep 15 11:46:52 2011 -0700 iwlagn: do not use interruptible waits Since the dawn of its time, iwlwifi has used interruptible waits to wait for synchronous commands and firmware loading. This leads to "interesting" bugs, because it can't actually handle the interruptions; for example when a command sending is interrupted it will assume the command completed fully, and then leave it pending, which leads to all kinds of trouble when the command finishes later. Since there's no easy way to gracefully deal with interruptions, fix the driver to not use interruptible waits. This at least fixes the error iwlagn 0000:02:00.0: Error: Response NULL in 'REPLY_SCAN_ABORT_CMD' I have seen in P2P testing, but it is likely that there are other errors caused by this. Cc: stable@kernel.org # 2.6.39+ Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
1 parent 7b75795 commit 2351d03

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

drivers/net/wireless/iwlegacy/iwl-core.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -937,7 +937,7 @@ void iwl_legacy_irq_handle_error(struct iwl_priv *priv)
937937
&priv->contexts[IWL_RXON_CTX_BSS]);
938938
#endif
939939

940-
wake_up_interruptible(&priv->wait_command_queue);
940+
wake_up(&priv->wait_command_queue);
941941

942942
/* Keep the restart process from trying to send host
943943
* commands by clearing the INIT status bit */
@@ -1746,7 +1746,7 @@ int iwl_legacy_force_reset(struct iwl_priv *priv, bool external)
17461746

17471747
/* Set the FW error flag -- cleared on iwl_down */
17481748
set_bit(STATUS_FW_ERROR, &priv->status);
1749-
wake_up_interruptible(&priv->wait_command_queue);
1749+
wake_up(&priv->wait_command_queue);
17501750
/*
17511751
* Keep the restart process from trying to send host
17521752
* commands by clearing the INIT status bit

drivers/net/wireless/iwlegacy/iwl-hcmd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ int iwl_legacy_send_cmd_sync(struct iwl_priv *priv, struct iwl_host_cmd *cmd)
167167
goto out;
168168
}
169169

170-
ret = wait_event_interruptible_timeout(priv->wait_command_queue,
170+
ret = wait_event_timeout(priv->wait_command_queue,
171171
!test_bit(STATUS_HCMD_ACTIVE, &priv->status),
172172
HOST_COMPLETE_TIMEOUT);
173173
if (!ret) {

drivers/net/wireless/iwlegacy/iwl-tx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,7 @@ iwl_legacy_tx_cmd_complete(struct iwl_priv *priv, struct iwl_rx_mem_buffer *rxb)
647647
clear_bit(STATUS_HCMD_ACTIVE, &priv->status);
648648
IWL_DEBUG_INFO(priv, "Clearing HCMD_ACTIVE for command %s\n",
649649
iwl_legacy_get_cmd_string(cmd->hdr.cmd));
650-
wake_up_interruptible(&priv->wait_command_queue);
650+
wake_up(&priv->wait_command_queue);
651651
}
652652

653653
/* Mark as unmapped */

drivers/net/wireless/iwlegacy/iwl3945-base.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -841,7 +841,7 @@ static void iwl3945_rx_card_state_notif(struct iwl_priv *priv,
841841
wiphy_rfkill_set_hw_state(priv->hw->wiphy,
842842
test_bit(STATUS_RF_KILL_HW, &priv->status));
843843
else
844-
wake_up_interruptible(&priv->wait_command_queue);
844+
wake_up(&priv->wait_command_queue);
845845
}
846846

847847
/**
@@ -2269,7 +2269,7 @@ static void iwl3945_alive_start(struct iwl_priv *priv)
22692269
iwl3945_reg_txpower_periodic(priv);
22702270

22712271
IWL_DEBUG_INFO(priv, "ALIVE processing complete.\n");
2272-
wake_up_interruptible(&priv->wait_command_queue);
2272+
wake_up(&priv->wait_command_queue);
22732273

22742274
return;
22752275

@@ -2300,7 +2300,7 @@ static void __iwl3945_down(struct iwl_priv *priv)
23002300
iwl_legacy_clear_driver_stations(priv);
23012301

23022302
/* Unblock any waiting calls */
2303-
wake_up_interruptible_all(&priv->wait_command_queue);
2303+
wake_up_all(&priv->wait_command_queue);
23042304

23052305
/* Wipe out the EXIT_PENDING status bit if we are not actually
23062306
* exiting the module */
@@ -2853,7 +2853,7 @@ static int iwl3945_mac_start(struct ieee80211_hw *hw)
28532853

28542854
/* Wait for START_ALIVE from ucode. Otherwise callbacks from
28552855
* mac80211 will not be run successfully. */
2856-
ret = wait_event_interruptible_timeout(priv->wait_command_queue,
2856+
ret = wait_event_timeout(priv->wait_command_queue,
28572857
test_bit(STATUS_READY, &priv->status),
28582858
UCODE_READY_TIMEOUT);
28592859
if (!ret) {

drivers/net/wireless/iwlegacy/iwl4965-base.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,7 @@ static void iwl4965_rx_card_state_notif(struct iwl_priv *priv,
576576
wiphy_rfkill_set_hw_state(priv->hw->wiphy,
577577
test_bit(STATUS_RF_KILL_HW, &priv->status));
578578
else
579-
wake_up_interruptible(&priv->wait_command_queue);
579+
wake_up(&priv->wait_command_queue);
580580
}
581581

582582
/**
@@ -926,7 +926,7 @@ static void iwl4965_irq_tasklet(struct iwl_priv *priv)
926926
handled |= CSR_INT_BIT_FH_TX;
927927
/* Wake up uCode load routine, now that load is complete */
928928
priv->ucode_write_complete = 1;
929-
wake_up_interruptible(&priv->wait_command_queue);
929+
wake_up(&priv->wait_command_queue);
930930
}
931931

932932
if (inta & ~handled) {
@@ -1795,7 +1795,7 @@ static void iwl4965_alive_start(struct iwl_priv *priv)
17951795
iwl4965_rf_kill_ct_config(priv);
17961796

17971797
IWL_DEBUG_INFO(priv, "ALIVE processing complete.\n");
1798-
wake_up_interruptible(&priv->wait_command_queue);
1798+
wake_up(&priv->wait_command_queue);
17991799

18001800
iwl_legacy_power_update_mode(priv, true);
18011801
IWL_DEBUG_INFO(priv, "Updated power mode\n");
@@ -1828,7 +1828,7 @@ static void __iwl4965_down(struct iwl_priv *priv)
18281828
iwl_legacy_clear_driver_stations(priv);
18291829

18301830
/* Unblock any waiting calls */
1831-
wake_up_interruptible_all(&priv->wait_command_queue);
1831+
wake_up_all(&priv->wait_command_queue);
18321832

18331833
/* Wipe out the EXIT_PENDING status bit if we are not actually
18341834
* exiting the module */
@@ -2266,7 +2266,7 @@ int iwl4965_mac_start(struct ieee80211_hw *hw)
22662266

22672267
/* Wait for START_ALIVE from Run Time ucode. Otherwise callbacks from
22682268
* mac80211 will not be run successfully. */
2269-
ret = wait_event_interruptible_timeout(priv->wait_command_queue,
2269+
ret = wait_event_timeout(priv->wait_command_queue,
22702270
test_bit(STATUS_READY, &priv->status),
22712271
UCODE_READY_TIMEOUT);
22722272
if (!ret) {

0 commit comments

Comments
 (0)