From: Kalpesh Solanki <skalpesh942@gmail.com>
To: luka.gejak@linux.dev, pkshih@realtek.com
Cc: kvalo@kernel.org, linux-wireless@vger.kernel.org,
linux-kernel@vger.kernel.org,
Kalpesh Solanki <skalpesh942@gmail.com>
Subject: Re: [PATCH v4 3/3] wifi: rtw88: ps: trigger firmware recovery only after consecutive LPS leave failures on PCI
Date: Thu, 12 Nov 2026 18:43:29 +0530 [thread overview]
Message-ID: <20261112131329.236152-1-skalpesh942@gmail.com> (raw)
Hi Luka, Ping-Ke,
Thank you both for your patience while I was away, and thank you Luka for
advocating to address the review feedback before pushing v5.
Regarding Luka's two comments on v4:
1. Redundant rtw_hci_type check in rtw_fw_recovery():
You are completely right. Since rtw_fw_leave_lps_check() already guards the
call with rtw_hci_type(rtwdev) == RTW_HCI_TYPE_PCIE, and the other callers in
pci.c are PCI-only, having an HCI check in rtw_fw_recovery() in main.c is
redundant. I have dropped it in v5.
2. ps_hang_cnt on non-FW_FEATURE_LPS_C2H chipsets:
Excellent catch! On chipsets without FW_FEATURE_LPS_C2H (such as RTL8822B
and RTL8723D), the check falls back to polling REG_TCR for
BIT_PWRMGT_HWDATA_EN. On timeout, the driver forcefully clears this bit via
rtw_write32_clr(rtwdev, REG_TCR, BIT_PWRMGT_HWDATA_EN) so packets can continue
to be transmitted. If the firmware is frozen, it will never re-assert this
bit. On the next check, the register read sees the bit cleared, falsely reports
success, and resets ps_hang_cnt back to 0. Thus, a stuck firmware on these
chips could never reach RTW_PS_HANG_MAX_CNT.
In v5, I have updated patch 3/3 so that ps_hang_cnt is only incremented and
evaluated when FW_FEATURE_LPS_C2H is supported:
if (rtw_fw_feature_check(fw, FW_FEATURE_LPS_C2H) &&
rtw_hci_type(rtwdev) == RTW_HCI_TYPE_PCIE) {
rtwdev->ps_hang_cnt++;
if (rtwdev->ps_hang_cnt >= RTW_PS_HANG_MAX_CNT)
rtw_fw_recovery(rtwdev);
}
For C2H-capable devices (such as RTL8822C and RTL8821C), completion signaling
reliably accumulates consecutive timeouts when the firmware hangs, while
legacy chipsets without C2H retain the upstream behavior (clear TCR and warn)
without getting trapped in a broken counter reset loop.
Regarding lore / patchwork:
It appears v4 was either dropped by list filters or delayed during list delivery.
I have sent out the full v5 series [PATCH v5 0/3] incorporating all the above
changes to the mailing list.
Thanks,
Kalpesh
next reply other threads:[~2026-11-12 13:13 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-12 13:13 Kalpesh Solanki [this message]
-- strict thread matches above, loose matches on Subject: below --
2026-11-08 14:27 [PATCH v4 0/3] wifi: rtw88: firmware recovery fixes and LPS hang handling Kalpesh Solanki
2026-11-08 14:27 ` [PATCH v4 3/3] wifi: rtw88: ps: trigger firmware recovery only after consecutive LPS leave failures on PCI Kalpesh Solanki
2026-11-09 7:13 ` Luka Gejak
[not found] ` <CADYuhkqCNQxevZih3D+Zu-HcuyOao99iF31+Y6kDP0iM_Rr1kQ@mail.gmail.com>
2026-11-09 8:32 ` KALPESH SOLANKI
2026-11-09 8:42 ` 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=20261112131329.236152-1-skalpesh942@gmail.com \
--to=skalpesh942@gmail.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 \
/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®