RE: [PATCH v2] wifi: rtw89: pci: add .shutdown callback to stop rfkill polling on reboot
From: Ping-Ke Shih
Date: Wed Jul 29 2026 - 02:53:10 EST
yhchen312@xxxxxxxxx <yhchen312@xxxxxxxxx> wrote:
> From: "Yuhang.chen" <yhchen312@xxxxxxxxx>
>
> Since the hardware rfkill polling was introduced, arm64 platforms can
> panic with an asynchronous SError during warm reboot:
>
> SError Interrupt on CPU8, code 0x00000000be000011 -- SError
> Workqueue: events_power_efficient rfkill_poll [rfkill]
> 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
>
> On the reboot path the kernel only runs device_shutdown(), which calls
> each driver's .shutdown callback; .remove is not invoked. The rtw89 PCI
> driver had no .shutdown callback, so nothing stopped the rfkill polling
> work while the platform was tearing the PCIe link down. Once the link
> is gone, the next MMIO read from the poll handler targets a
> non-responding device and is reported as a fatal asynchronous SError on
> arm64.
>
> Add rtw89_pci_shutdown(), wired to all rtw89 PCI device drivers, which
> sets a new RTW89_FLAG_SHUTDOWN flag (mirroring the USB
> RTW89_FLAG_UNPLUGGED pattern). When the flag is set,
> rtw89_ops_rfkill_poll() returns early, so no MMIO read is issued to the
> chip after shutdown begins and the SError no longer occurs.
>
> This does not call the full .remove path from .shutdown, to keep the
> shutdown handler minimal and avoid running the non-idempotent teardown
> twice.
>
> Fixes: 0b38e6277aed ("wifi: rtw89: add support for hardware rfkill")
> Cc: stable@xxxxxxxxxxxxxxx
> Suggested-by: Ping-Ke Shih <pkshih@xxxxxxxxxxx>
> Signed-off-by: Yuhang.chen <yhchen312@xxxxxxxxx>
Acked-by: Ping-Ke Shih <pkshih@xxxxxxxxxxx>