From: yhchen312@gmail.com
To: pkshih@realtek.com
Cc: damon.chen@realtek.com, linux-wireless@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] wifi: rtw89: 8852be: add .shutdown callback to quiesce device on reboot
Date: Wed, 29 Jul 2026 09:35:37 +0800 [thread overview]
Message-ID: <20260729013537.2743729-1-yhchen312@gmail.com> (raw)
In-Reply-To: <142c91dfc7334136a5dabc4f91504ec6@realtek.com>
Hi Ping-Ke,
Thanks for the review.
> Does it mean the work is running after .shutdown but before .remove?
On the reboot/poweroff path the kernel only runs device_shutdown(),
which invokes each driver's .shutdown callback; .remove is *not* called
on this path -- it only runs on driver unbind, module unload or
hot-unplug. The rfkill polling workqueue, however, keeps being scheduled
by the rfkill core throughout the whole shutdown sequence until the
system finally halts. During that window the platform starts tearing
the PCIe link down, and the next MMIO read issued by
rtw89_ops_rfkill_poll() then targets a non-responding device, which on
arm64 is reported as a fatal asynchronous SError. So it is not ".remove
after .shutdown"; .remove never runs on reboot -- the poll work simply
outlives the link, and that is exactly what the new flag stops.
> Not prefer calling rtw89_pci_remove() twice.
Agreed. In v2 I dropped the rtw89_pci_remove() call from .shutdown and
switched to the flag-based approach you suggested:
* add rtw89_pci_shutdown() that sets a new RTW89_FLAG_SHUTDOWN flag
(mirroring the USB RTW89_FLAG_UNPLUGGED pattern);
* make rtw89_ops_rfkill_poll() bail out early when that flag is set,
so no MMIO read reaches the chip after shutdown begins.
This keeps the shutdown handler minimal and avoids running the
non-idempotent teardown twice.
> I think this fix can apply to all PCI devices for this driver, right?
Yes, agreed. v2 wires .shutdown = rtw89_pci_shutdown into all rtw89 PCI
device drivers (8851BE/8852AE/8852BE/8852BTE/8852CE/8922AE/8922DE), so
the subject prefix is now "wifi: rtw89: pci: ...".
v2 is sent as a reply to this thread.
Thanks,
Yuhang
next prev parent reply other threads:[~2026-07-29 1:35 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
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
2026-07-29 1:35 ` yhchen312 [this message]
2026-07-29 1:41 ` [PATCH v2] wifi: rtw89: pci: add .shutdown callback to stop rfkill polling " yhchen312
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=20260729013537.2743729-1-yhchen312@gmail.com \
--to=yhchen312@gmail.com \
--cc=damon.chen@realtek.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--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