Re: [PATCH] wifi: mm81x: shut down timers during teardown

From: Lachlan Hodges

Date: Thu Jul 23 2026 - 06:16:21 EST


Hi,

On Thu, Jul 23, 2026 at 05:23:57PM +0800, Linmao Li wrote:
> The three timer teardown paths call timer_delete_sync_try() and ignore
> its return value. If a callback is running on another CPU it returns -1
> without waiting, and it does not prevent a later rearm even when it does
> deactivate a pending timer. mm81x_skbq_tx_complete() can rearm the
> stale-status timer, and the rc and yaps callbacks queue work that rearms
> their timers. Teardown can therefore continue with a callback still
> running or the timer rearmed, so it fires after the associated state has
> been freed.
>
> Use timer_shutdown_sync() for these permanent teardowns: it waits for an
> in-flight callback and prevents any future rearm. In mm81x_rc_deinit()
> shut the timer down before cancel_work_sync() so the work can no longer
> recreate the timer/work cycle.
>
> Fixes: b1906cea00b0 ("wifi: mm81x: add mm81x Wi-Fi HaLow driver")
> Signed-off-by: Linmao Li <lilinmao@xxxxxxxxxx>

I think the subject could be a bit more descriptive as "shut down
timers during teardown" is fairly vague. I also think you need to
resend since the patch isn't appearing on the list or patchwork ?
Patch itself seems fine and a good fix.

@Johannes: I missed updating the exclusion list below, I assume I
should add an entry so you aren't CC'd on every patch?

NETWORKING DRIVERS (WIRELESS)
M: Johannes Berg <johannes@xxxxxxxxxxxxxxxx>
L: linux-wireless@xxxxxxxxxxxxxxx
S: Maintained
W: https://wireless.wiki.kernel.org/
Q: https://patchwork.kernel.org/project/linux-wireless/list/
T: git git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless.git
T: git git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next.git
F: Documentation/devicetree/bindings/net/wireless/
F: drivers/net/wireless/
X: drivers/net/wireless/ath/
X: drivers/net/wireless/broadcom/
X: drivers/net/wireless/intel/
...

lachlan