Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH] wifi: rtw89: 8852be: add .shutdown callback to quiesce device on reboot
@ 2026-07-28  1:54 yhchen312
  2026-07-28  2:45 ` Ping-Ke Shih
  0 siblings, 1 reply; 2+ messages in thread
From: yhchen312 @ 2026-07-28  1:54 UTC (permalink / raw)
  To: pkshih; +Cc: damon.chen, linux-wireless, linux-kernel, stable, Yuhang.chen

From: "Yuhang.chen" <yhchen312@gmail.com>

Since hardware rfkill polling was introduced, warm reboot on arm64
platforms can panic with an asynchronous SError when the rfkill poll
workqueue reads a register while the PCIe link is being torn down:

  SError Interrupt on CPU8, code 0x00000000be000011 -- SError
  Workqueue: events_power_efficient rfkill_poll [rfkill]
  Call trace:
    rtw89_pci_ops_read8+0x94/0x160 [rtw89_pci]
    rtw89_core_rfkill_poll+0x50/0x1e0 [rtw89_core]
    rtw89_ops_rfkill_poll+0x40/0x68 [rtw89_core]
    ieee80211_rfkill_poll+0x3c/0x70 [mac80211]
    cfg80211_rfkill_poll+0x40/0x2a0 [cfg80211]
    rfkill_poll+0x30/0x88 [rfkill]
  Kernel panic - not syncing: Asynchronous SError Interrupt

During device_shutdown() the 8852BE PCI driver has no .shutdown
callback, so the device is never quiesced and the rfkill polling keeps
running.  Once the platform brings the PCIe link down, the next MMIO
read targets a non-responding device and is reported as an asynchronous
SError, which is fatal on arm64.

Add a .shutdown callback that runs the existing remove path to stop the
rfkill polling, free interrupts and power down the chip before the link
goes away.  A NULL drvdata check guards the case where probe did not
fully complete.

Fixes: 0b38e6277aed ("wifi: rtw89: add support for hardware rfkill")
Cc: stable@vger.kernel.org
Signed-off-by: Yuhang.chen <yhchen312@gmail.com>
---
 drivers/net/wireless/realtek/rtw89/rtw8852be.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/net/wireless/realtek/rtw89/rtw8852be.c b/drivers/net/wireless/realtek/rtw89/rtw8852be.c
index 5bc0a6a99d1d..9aebecbac067 100644
--- a/drivers/net/wireless/realtek/rtw89/rtw8852be.c
+++ b/drivers/net/wireless/realtek/rtw89/rtw8852be.c
@@ -92,11 +92,20 @@ static const struct pci_device_id rtw89_8852be_id_table[] = {
 };
 MODULE_DEVICE_TABLE(pci, rtw89_8852be_id_table);
 
+static void rtw89_8852be_shutdown(struct pci_dev *pdev)
+{
+	if (!pci_get_drvdata(pdev))
+		return;
+
+	rtw89_pci_remove(pdev);
+}
+
 static struct pci_driver rtw89_8852be_driver = {
 	.name		= "rtw89_8852be",
 	.id_table	= rtw89_8852be_id_table,
 	.probe		= rtw89_pci_probe,
 	.remove		= rtw89_pci_remove,
+	.shutdown       = rtw89_8852be_shutdown,
 	.driver.pm	= &rtw89_pm_ops,
 	.err_handler    = &rtw89_pci_err_handler,
 };
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-07-28  2:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-28  1:54 [PATCH] wifi: rtw89: 8852be: add .shutdown callback to quiesce device on reboot yhchen312
2026-07-28  2:45 ` Ping-Ke Shih

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox