From: Zong-Zhe Yang <kevin_yang@realtek.com>
To: Kalpesh Solanki <skalpesh942@gmail.com>,
Ping-Ke Shih <pkshih@realtek.com>,
"luka.gejak@linux.dev" <luka.gejak@linux.dev>
Cc: "kvalo@kernel.org" <kvalo@kernel.org>,
"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"stable@vger.kernel.org" <stable@vger.kernel.org>
Subject: RE: [PATCH v5 1/3] wifi: rtw88: clear RTW_FLAG_RESTARTING on stop and start failure
Date: Fri, 13 Nov 2026 06:52:23 +0000 [thread overview]
Message-ID: <ee602061ce314b5a9741094b7b93836e@realtek.com> (raw)
In-Reply-To: <20261112131401.236433-2-skalpesh942@gmail.com>
Kalpesh Solanki <skalpesh942@gmail.com> wrote:
>
> When mac80211 stops or suspends the device without WoWLAN,
> drv_reconfig_complete() is never invoked with
> IEEE80211_RECONFIG_TYPE_RESTART. If firmware recovery was in flight
> during this transition, RTW_FLAG_RESTARTING remains set permanently,
> blocking all subsequent firmware recoveries until the module is reloaded.
>
In this case, I saw you clear RTW_FLAG_RESTARTING in rtw_ops_stop.
However, the reconfig flow might not have even run at that moment.
How about clearing RTW_FLAG_RESTARTING when driver gets
IEEE80211_RECONFIG_TYPE_SUSPEND?
>
> Similarly, if rtw_core_start() fails during drv_start() in a recovery
> restart, local->started remains false. When mac80211 cleans up via
> cfg80211_shutdown_all_interfaces(), drv_stop() returns early without
> calling rtw_ops_stop(), leaving RTW_FLAG_RESTARTING set permanently on
> hardware that failed to recover.
>
> Clear RTW_FLAG_RESTARTING in rtw_ops_stop(), as well as in
> rtw_ops_start() when rtw_core_start() returns an error, ensuring the
> driver always exits the restarting state on error or teardown.
>
> Fixes: 5c831644e1f4 ("rtw88: handle and recover when firmware crash")
> Cc: stable@vger.kernel.org
> Signed-off-by: Kalpesh Solanki <skalpesh942@gmail.com>
> ---
> drivers/net/wireless/realtek/rtw88/mac80211.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/net/wireless/realtek/rtw88/mac80211.c
> b/drivers/net/wireless/realtek/rtw88/mac80211.c
> index 5e40cf06a9e..ffd86f08185 100644
> --- a/drivers/net/wireless/realtek/rtw88/mac80211.c
> +++ b/drivers/net/wireless/realtek/rtw88/mac80211.c
> @@ -57,6 +57,8 @@ static int rtw_ops_start(struct ieee80211_hw *hw)
>
> mutex_lock(&rtwdev->mutex);
> ret = rtw_core_start(rtwdev);
> + if (ret)
> + clear_bit(RTW_FLAG_RESTARTING, rtwdev->flags);
> mutex_unlock(&rtwdev->mutex);
>
> return ret;
> @@ -67,6 +69,7 @@ static void rtw_ops_stop(struct ieee80211_hw *hw, bool
> suspend)
> struct rtw_dev *rtwdev = hw->priv;
>
> mutex_lock(&rtwdev->mutex);
> + clear_bit(RTW_FLAG_RESTARTING, rtwdev->flags);
> rtw_core_stop(rtwdev);
> mutex_unlock(&rtwdev->mutex);
> }
> --
> 2.53.0
>
next prev parent reply other threads:[~2026-11-13 6:52 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-12 13:13 [PATCH v5 0/3] wifi: rtw88: firmware recovery fixes and LPS hang handling Kalpesh Solanki
2026-11-12 13:13 ` [PATCH v5 1/3] wifi: rtw88: clear RTW_FLAG_RESTARTING on stop and start failure Kalpesh Solanki
2026-11-12 21:28 ` Luka Gejak
2026-11-13 6:52 ` Zong-Zhe Yang [this message]
2026-11-13 7:19 ` Luka Gejak
2026-11-12 13:14 ` [PATCH v5 2/3] wifi: rtw88: skip already reset station in rtw_sta_remove() Kalpesh Solanki
2026-11-12 21:29 ` Luka Gejak
2026-11-12 13:14 ` [PATCH v5 3/3] wifi: rtw88: ps: trigger firmware recovery only after consecutive LPS leave failures on PCI Kalpesh Solanki
2026-11-12 21:30 ` Luka Gejak
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ee602061ce314b5a9741094b7b93836e@realtek.com \
--to=kevin_yang@realtek.com \
--cc=kvalo@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=luka.gejak@linux.dev \
--cc=pkshih@realtek.com \
--cc=skalpesh942@gmail.com \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®