summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorZhang Yuwei <zhangyuwei20@huawei.com>2026-04-10 05:44:48 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2026-05-22 14:33:21 +0300
commit1137838865bfc9a7cd5869c1dc5c22aa45ec12c8 (patch)
treed008795fd65704e7090fd6b21e9dba620685c926 /include/linux
parent9582485a65eacfd7245ec7f0a9d7e2c34749d669 (diff)
downloadlinux-1137838865bfc9a7cd5869c1dc5c22aa45ec12c8.tar.xz
driver core: Use mod_delayed_work to prevent lost deferred probe work
The deferred_probe_timeout_work may be permanently and unexpectedly canceled when deferred_probe_extend_timeout() executes concurrently. Starting with deferred_probe_timeout_work pending, the problem can occur after the following sequence: CPU0 CPU1 deferred_probe_extend_timeout -> cancel_delayed_work() => true deferred_probe_extend_timeout -> cancel_delayed_work() -> __cancel_work() -> try_grab_pending() -> schedule_delayed_work() -> queue_delayed_work_on() (Since the pending bit is grabbed, it just returns without queuing) -> set_work_pool_and_clear_pending() (This __cancel_work() returns false and the work will never be queued again) The root cause is that the WORK_STRUCT_PENDING_BIT of the work_struct is set temporarily in __cancel_work() (via try_grab_pending()). This transient state prevents the work_struct from being successfully queued by another CPU. To fix this, replace the original non-atomic cancel and schedule mechanism with mod_delayed_work(). This ensures the modification is handled atomically and guarantees that the work is not lost. Fixes: 2b28a1a84a0e ("driver core: Extend deferred probe timeout on driver registration") Signed-off-by: Zhang Yuwei <zhangyuwei20@huawei.com> Link: https://patch.msgid.link/20260410024448.387231-1-zhangyuwei20@huawei.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux')
0 files changed, 0 insertions, 0 deletions