Skip to content

Commit d48ff3c

Browse files
egrumbachjmberg-intel
authored andcommitted
wifi: iwlwifi: mvm: don't dump the firmware state upon RFKILL while suspend
This is not really a firmware error. We need to reload the firmware, but this doesn't mean that we should consider this as a firmware error. When the firmware was restarted upon resume, this wasn't felt by the driver. Now that we keep the firmware running during suspend even if we don't have wowlan, this started to pop-up. Fixes: e8bb19c ("wifi: iwlwifi: support fast resume") Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Link: https://patch.msgid.link/20250209143303.a10463a40318.I14131781c3124b58e60e1f5e9d793a2bc88b464c@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
1 parent f975116 commit d48ff3c

1 file changed

Lines changed: 51 additions & 26 deletions

File tree

  • drivers/net/wireless/intel/iwlwifi/mvm

drivers/net/wireless/intel/iwlwifi/mvm/d3.c

Lines changed: 51 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3092,38 +3092,50 @@ static void iwl_mvm_d3_disconnect_iter(void *data, u8 *mac,
30923092
ieee80211_resume_disconnect(vif);
30933093
}
30943094

3095-
static bool iwl_mvm_check_rt_status(struct iwl_mvm *mvm,
3096-
struct ieee80211_vif *vif)
3095+
enum rt_status {
3096+
FW_ALIVE,
3097+
FW_NEEDS_RESET,
3098+
FW_ERROR,
3099+
};
3100+
3101+
static enum rt_status iwl_mvm_check_rt_status(struct iwl_mvm *mvm,
3102+
struct ieee80211_vif *vif)
30973103
{
30983104
u32 err_id;
30993105

31003106
/* check for lmac1 error */
31013107
if (iwl_fwrt_read_err_table(mvm->trans,
31023108
mvm->trans->dbg.lmac_error_event_table[0],
31033109
&err_id)) {
3104-
if (err_id == RF_KILL_INDICATOR_FOR_WOWLAN && vif) {
3105-
struct cfg80211_wowlan_wakeup wakeup = {
3106-
.rfkill_release = true,
3107-
};
3108-
ieee80211_report_wowlan_wakeup(vif, &wakeup,
3109-
GFP_KERNEL);
3110+
if (err_id == RF_KILL_INDICATOR_FOR_WOWLAN) {
3111+
IWL_WARN(mvm, "Rfkill was toggled during suspend\n");
3112+
if (vif) {
3113+
struct cfg80211_wowlan_wakeup wakeup = {
3114+
.rfkill_release = true,
3115+
};
3116+
3117+
ieee80211_report_wowlan_wakeup(vif, &wakeup,
3118+
GFP_KERNEL);
3119+
}
3120+
3121+
return FW_NEEDS_RESET;
31103122
}
3111-
return true;
3123+
return FW_ERROR;
31123124
}
31133125

31143126
/* check if we have lmac2 set and check for error */
31153127
if (iwl_fwrt_read_err_table(mvm->trans,
31163128
mvm->trans->dbg.lmac_error_event_table[1],
31173129
NULL))
3118-
return true;
3130+
return FW_ERROR;
31193131

31203132
/* check for umac error */
31213133
if (iwl_fwrt_read_err_table(mvm->trans,
31223134
mvm->trans->dbg.umac_error_event_table,
31233135
NULL))
3124-
return true;
3136+
return FW_ERROR;
31253137

3126-
return false;
3138+
return FW_ALIVE;
31273139
}
31283140

31293141
/*
@@ -3492,6 +3504,7 @@ static int __iwl_mvm_resume(struct iwl_mvm *mvm, bool test)
34923504
bool d0i3_first = fw_has_capa(&mvm->fw->ucode_capa,
34933505
IWL_UCODE_TLV_CAPA_D0I3_END_FIRST);
34943506
bool resume_notif_based = iwl_mvm_d3_resume_notif_based(mvm);
3507+
enum rt_status rt_status;
34953508
bool keep = false;
34963509

34973510
mutex_lock(&mvm->mutex);
@@ -3515,14 +3528,19 @@ static int __iwl_mvm_resume(struct iwl_mvm *mvm, bool test)
35153528

35163529
iwl_fw_dbg_read_d3_debug_data(&mvm->fwrt);
35173530

3518-
if (iwl_mvm_check_rt_status(mvm, vif)) {
3519-
IWL_ERR(mvm, "FW Error occurred during suspend. Restarting.\n");
3531+
rt_status = iwl_mvm_check_rt_status(mvm, vif);
3532+
if (rt_status != FW_ALIVE) {
35203533
set_bit(STATUS_FW_ERROR, &mvm->trans->status);
3521-
iwl_mvm_dump_nic_error_log(mvm);
3522-
iwl_dbg_tlv_time_point(&mvm->fwrt,
3523-
IWL_FW_INI_TIME_POINT_FW_ASSERT, NULL);
3524-
iwl_fw_dbg_collect_desc(&mvm->fwrt, &iwl_dump_desc_assert,
3525-
false, 0);
3534+
if (rt_status == FW_ERROR) {
3535+
IWL_ERR(mvm, "FW Error occurred during suspend. Restarting.\n");
3536+
iwl_mvm_dump_nic_error_log(mvm);
3537+
iwl_dbg_tlv_time_point(&mvm->fwrt,
3538+
IWL_FW_INI_TIME_POINT_FW_ASSERT,
3539+
NULL);
3540+
iwl_fw_dbg_collect_desc(&mvm->fwrt,
3541+
&iwl_dump_desc_assert,
3542+
false, 0);
3543+
}
35263544
ret = 1;
35273545
goto err;
35283546
}
@@ -3679,6 +3697,7 @@ int iwl_mvm_fast_resume(struct iwl_mvm *mvm)
36793697
.notif_expected =
36803698
IWL_D3_NOTIF_D3_END_NOTIF,
36813699
};
3700+
enum rt_status rt_status;
36823701
int ret;
36833702

36843703
lockdep_assert_held(&mvm->mutex);
@@ -3688,14 +3707,20 @@ int iwl_mvm_fast_resume(struct iwl_mvm *mvm)
36883707
mvm->last_reset_or_resume_time_jiffies = jiffies;
36893708
iwl_fw_dbg_read_d3_debug_data(&mvm->fwrt);
36903709

3691-
if (iwl_mvm_check_rt_status(mvm, NULL)) {
3692-
IWL_ERR(mvm, "FW Error occurred during suspend. Restarting.\n");
3710+
rt_status = iwl_mvm_check_rt_status(mvm, NULL);
3711+
if (rt_status != FW_ALIVE) {
36933712
set_bit(STATUS_FW_ERROR, &mvm->trans->status);
3694-
iwl_mvm_dump_nic_error_log(mvm);
3695-
iwl_dbg_tlv_time_point(&mvm->fwrt,
3696-
IWL_FW_INI_TIME_POINT_FW_ASSERT, NULL);
3697-
iwl_fw_dbg_collect_desc(&mvm->fwrt, &iwl_dump_desc_assert,
3698-
false, 0);
3713+
if (rt_status == FW_ERROR) {
3714+
IWL_ERR(mvm,
3715+
"iwl_mvm_check_rt_status failed, device is gone during suspend\n");
3716+
iwl_mvm_dump_nic_error_log(mvm);
3717+
iwl_dbg_tlv_time_point(&mvm->fwrt,
3718+
IWL_FW_INI_TIME_POINT_FW_ASSERT,
3719+
NULL);
3720+
iwl_fw_dbg_collect_desc(&mvm->fwrt,
3721+
&iwl_dump_desc_assert,
3722+
false, 0);
3723+
}
36993724
mvm->trans->state = IWL_TRANS_NO_FW;
37003725
ret = -ENODEV;
37013726

0 commit comments

Comments
 (0)