mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-09 14:56:54 -04:00
wifi: iwlwifi: avoid scheduling restart during restart
When a restart is in progress, it can be async due to the next worker being scheduled in mac80211 (restart work) or the driver itself (reprobe). Avoid scheduling another restart during this period. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Link: https://patch.msgid.link/20250430151952.db428503ec3c.I3f2be3d72a9d40cfb4e697cdab1cd2866a9262bc@changeid
This commit is contained in:
committed by
Miri Korenblit
parent
8ec50790b0
commit
b2d98a6cee
@@ -393,6 +393,8 @@ int iwl_trans_start_hw(struct iwl_trans *trans)
|
||||
{
|
||||
might_sleep();
|
||||
|
||||
clear_bit(STATUS_TRANS_RESET_IN_PROGRESS, &trans->status);
|
||||
|
||||
return iwl_trans_pcie_start_hw(trans);
|
||||
}
|
||||
IWL_EXPORT_SYMBOL(iwl_trans_start_hw);
|
||||
|
||||
@@ -304,6 +304,8 @@ enum iwl_d3_status {
|
||||
* via iwl_trans_finish_sw_reset()
|
||||
* @STATUS_RESET_PENDING: reset worker was scheduled, but didn't dump
|
||||
* the firmware state yet
|
||||
* @STATUS_TRANS_RESET_IN_PROGRESS: reset is still in progress, don't
|
||||
* attempt another reset yet
|
||||
*/
|
||||
enum iwl_trans_status {
|
||||
STATUS_SYNC_HCMD_ACTIVE,
|
||||
@@ -317,6 +319,7 @@ enum iwl_trans_status {
|
||||
STATUS_SUPPRESS_CMD_ERROR_ONCE,
|
||||
STATUS_IN_SW_RESET,
|
||||
STATUS_RESET_PENDING,
|
||||
STATUS_TRANS_RESET_IN_PROGRESS,
|
||||
};
|
||||
|
||||
static inline int
|
||||
@@ -1152,6 +1155,9 @@ static inline void iwl_trans_schedule_reset(struct iwl_trans *trans,
|
||||
{
|
||||
if (test_bit(STATUS_TRANS_DEAD, &trans->status))
|
||||
return;
|
||||
/* clear this on device init, not cleared on any unbind/reprobe */
|
||||
if (test_and_set_bit(STATUS_TRANS_RESET_IN_PROGRESS, &trans->status))
|
||||
return;
|
||||
|
||||
trans->restart.mode.type = type;
|
||||
trans->restart.mode.context = IWL_ERR_CONTEXT_WORKER;
|
||||
|
||||
Reference in New Issue
Block a user