]> git.ipfire.org Git - thirdparty/openwrt.git/commit
realtek: dsa: rtl83xx: flush scheduled work on removal 19570/head
authorIssam Hamdi <ih@simonwunderlich.de>
Thu, 20 Feb 2025 15:06:00 +0000 (16:06 +0100)
committerHauke Mehrtens <hauke@hauke-m.de>
Thu, 7 Aug 2025 15:29:14 +0000 (17:29 +0200)
commitfeec7cf34d27e3492f90d13c934c4a0c3b3df633
tree6de6b9cf81fc3095cb6b797087c88b53f75d819f
parent0fa192a3a254a283db00792f82b0fdcd27922a79
realtek: dsa: rtl83xx: flush scheduled work on removal

The workqueue items don't need to be processed directly when they are
scheduled. It can happen that they are simply processed at a much later
time. It is therefore necessary to ensure that all workqueue items of a
driver are no longer being processed before the driver (or structures of
this driver) are destroyed.

When skipping this step, the driver driver can cause a kernel Oops on
reboot.

Unfortunately, it is not recommended [1] to flush items out of the system
workqueue - simply because this can cause deadlocks. The driver itself must
have a private workqueue which is then flushed.

[1] https://lkml.kernel.org/r/49925af7-78a8-a3dd-bce6-cfc02e1a9236@I-love.SAKURA.ne.jp

Signed-off-by: Issam Hamdi <ih@simonwunderlich.de>
Signed-off-by: Harshal Gohel <hg@simonwunderlich.de>
Signed-off-by: Sharadanand Karanjkar <sk@simonwunderlich.de>
Link: https://github.com/openwrt/openwrt/pull/19570
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/common.c
target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/dsa.c
target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl838x.h