rtw88: consider triggering state of simulating fw crash
Ping-Ke Shih
maintainerPATCH 1/1 rtw88: consider triggering state of simulating fw crash
From: Zong-Zhe Yang <[email protected]>
In certain cases, triggering fw crash simulation via fw_crash debugfs will take a while. If the state is queried too early before restart begins processing, it may mistakenly think restart process has been done. If some tests are started at this time, something unexpected might happen due to the follow-up restart process.
To avoid that, we consider the triggering state.
--- drivers/net/wireless/realtek/rtw88/debug.c | 5 ++++- drivers/net/wireless/realtek/rtw88/main.c | 1 + drivers/net/wireless/realtek/rtw88/main.h | 1 + 3 files changed, 6 insertions(+), 1 deletion(-)
drivers/net/wireless/realtek/rtw88/debug.c +4 -1
@@ -886,6 +886,7 @@ static ssize_t rtw_debugfs_set_fw_crash(struct file *filp,mutex_lock (&rtwdev->mutex);rtw_leave_lps_deep (rtwdev); +set_bit (RTW_FLAG_RESTART_TRIGGERING , rtwdev->flags);rtw_write8 (rtwdev,REG_HRCV_MSG ,1 );mutex_unlock (&rtwdev->mutex);
@@ -897,7 +898,9 @@ static int rtw_debugfs_get_fw_crash(struct seq_file *m, void *v)struct rtw_debugfs_priv *debugfs_priv = m->private;struct rtw_dev *rtwdev = debugfs_priv->rtwdev; -seq_printf (m,"%d\n" ,test_bit (RTW_FLAG_RESTARTING , rtwdev->flags)); +seq_printf (m,"%d\n" , +test_bit (RTW_FLAG_RESTART_TRIGGERING , rtwdev->flags) || +test_bit (RTW_FLAG_RESTARTING , rtwdev->flags));return 0 ; }
drivers/net/wireless/realtek/rtw88/main.c +1 -0
@@ -564,6 +564,7 @@ static void __fw_recovery_work(struct rtw_dev *rtwdev)int ret =0 ;set_bit (RTW_FLAG_RESTARTING , rtwdev->flags); +clear_bit (RTW_FLAG_RESTART_TRIGGERING , rtwdev->flags); ret =rtw_fwcd_prep (rtwdev);if (ret)
drivers/net/wireless/realtek/rtw88/main.h +1 -0
@@ -363,6 +363,7 @@ enum rtw_flags {RTW_FLAG_BUSY_TRAFFIC ,RTW_FLAG_WOWLAN ,RTW_FLAG_RESTARTING , +RTW_FLAG_RESTART_TRIGGERING , NUM_OF_RTW_FLAGS, };
Signature · 1 line
2.25.1
Quoted 31 lines · Ping-Ke Shih
From: Zong-Zhe Yang <[email protected]>
In certain cases, triggering fw crash simulation via
fw_crashdebugfs will take a while. If the state is queried too early before restart begins processing, it may mistakenly think restart process has been done. If some tests are started at this time, something unexpected might happen due to the follow-up restart process.To avoid that, we consider the triggering state.
Signed-off-by Zong-Zhe Yang <[email protected]>Signed-off-by Ping-Ke Shih <[email protected]>--- drivers/net/wireless/realtek/rtw88/debug.c | 5 ++++- drivers/net/wireless/realtek/rtw88/main.c | 1 + drivers/net/wireless/realtek/rtw88/main.h | 1 + 3 files changed, 6 insertions(+), 1 deletion(-)drivers/net/wireless/realtek/rtw88/debug.c +1
-0@@ -886,6 +886,7 @@ static ssize_t rtw_debugfs_set_fw_crash(struct file *filp,mutex_lock (&rtwdev->mutex);rtw_leave_lps_deep (rtwdev); +set_bit (RTW_FLAG_RESTART_TRIGGERING , rtwdev->flags);rtw_write8 (rtwdev,REG_HRCV_MSG ,1 );mutex_unlock (&rtwdev->mutex);
drivers/net/wireless/realtek/rtw88/debug.c static int rtw_debugfs_get_fw_crash(struct seq_file *m, void *v) · line 905
Quoted 9 lines
drivers/net/wireless/realtek/rtw88/debug.c +3
-1@@ -897,7 +898,9 @@ static int rtw_debugfs_get_fw_crash(struct seq_file *m, void *v)struct rtw_debugfs_priv *debugfs_priv = m->private;struct rtw_dev *rtwdev = debugfs_priv->rtwdev; -seq_printf (m,"%d\n" ,test_bit (RTW_FLAG_RESTARTING , rtwdev->flags)); +seq_printf (m,"%d\n" , +test_bit (RTW_FLAG_RESTART_TRIGGERING , rtwdev->flags) || +test_bit (RTW_FLAG_RESTARTING , rtwdev->flags));return 0 ; }
You use the verb "consider" both in the title and the commit log, but it's not really telling much (though I admit my english isn't very good). From looking at the patch all I see is that it prints the state of RTW_FLAG_RESTART_TRIGGERING flag. How is that "considering" anything and how does that improve any of this?
Can you improve the commit log and explain this is in detail? And what's "it" in this case?
Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/list/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
Pkshih
maintainerQuoted 60 lines
-----Original Message-----
From: [email protected] <[email protected]> On Behalf Of Kalle Valo
Sent: Friday, October 1, 2021 2:19 PM
To: Pkshih <[email protected]>
Cc: [email protected]; [email protected]; Kevin Yang <[email protected]>
Subject: Re: [PATCH] rtw88: consider triggering state of simulating fw crashQuoted 12 lines · Ping-Ke Shih
From: Zong-Zhe Yang <[email protected]>
In certain cases, triggering fw crash simulation via
fw_crashdebugfs will take a while. If the state is queried too early before restart begins processing, it may mistakenly think restart process has been done. If some tests are started at this time, something unexpected might happen due to the follow-up restart process.To avoid that, we consider the triggering state.
Signed-off-by Zong-Zhe Yang <[email protected]>Signed-off-by Ping-Ke Shih <[email protected]>Review
Quoted 7 lines
--- drivers/net/wireless/realtek/rtw88/debug.c | 5 ++++- drivers/net/wireless/realtek/rtw88/main.c | 1 + drivers/net/wireless/realtek/rtw88/main.h | 1 + 3 files changed, 6 insertions(+), 1 deletion(-)(quoted diff) +0
-0
b/drivers/net/wireless/realtek/rtw88/debug.cQuoted 12 lines
index
babf7fb238cc..682b23502e6e100644drivers/net/wireless/realtek/rtw88/debug.c +1
-0@@ -886,6 +886,7 @@ static ssize_t rtw_debugfs_set_fw_crash(struct file *filp,mutex_lock (&rtwdev->mutex);rtw_leave_lps_deep (rtwdev); +set_bit (RTW_FLAG_RESTART_TRIGGERING , rtwdev->flags);rtw_write8 (rtwdev,REG_HRCV_MSG ,1 );mutex_unlock (&rtwdev->mutex);drivers/net/wireless/realtek/rtw88/debug.c static int rtw_debugfs_get_fw_crash(struct seq_file *m, void *v) · line 905
Quoted 9 lines
drivers/net/wireless/realtek/rtw88/debug.c +3
-1@@ -897,7 +898,9 @@ static int rtw_debugfs_get_fw_crash(struct seq_file *m, void *v)struct rtw_debugfs_priv *debugfs_priv = m->private;struct rtw_dev *rtwdev = debugfs_priv->rtwdev; -seq_printf (m,"%d\n" ,test_bit (RTW_FLAG_RESTARTING , rtwdev->flags)); +seq_printf (m,"%d\n" , +test_bit (RTW_FLAG_RESTART_TRIGGERING , rtwdev->flags) || +test_bit (RTW_FLAG_RESTARTING , rtwdev->flags));return 0 ; }You use the verb "consider" both in the title and the commit log, but it's not really telling much (though I admit my english isn't very good). From looking at the patch all I see is that it prints the state of
RTW_FLAG_RESTART_TRIGGERINGflag. How is that "considering" anything and how does that improve any of this?
Quoted 3 lines
Can you improve the commit log and explain this is in detail? And what's "it" in this case?
In order to make it clear, we change the title and provide the detail by v2 [1].
[1] https://lore.kernel.org/linux-wireless/[email protected]/T/#u
--
Ping-Ke