mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2026-09-22 09:34:56 +02:00
driver core: Guard deferred probe timeout extension with delayed_work_pending()
commit557495bc87upstream. mod_delayed_work() unconditionally queues the work even when it wasn't previously pending, which can fire the timeout prematurely or restart it after it already fired. Add a delayed_work_pending() guard to restore the originally intended semantics. Premature firing calls fw_devlink_drivers_done() before all built-in drivers have registered, causing fw_devlink to prematurely relax device links for suppliers whose drivers haven't loaded yet. Fixes:1137838865("driver core: Use mod_delayed_work to prevent lost deferred probe work") Tested-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Link: https://patch.msgid.link/20260525012340.3860581-2-dakr@kernel.org Signed-off-by: Danilo Krummrich <dakr@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
d329ff4039
commit
2f48e29ce9
+2
-1
@@ -326,7 +326,8 @@ void deferred_probe_extend_timeout(void)
|
||||
* If the work hasn't been queued yet or if the work expired, don't
|
||||
* start a new one.
|
||||
*/
|
||||
if (mod_delayed_work(system_wq, &deferred_probe_timeout_work,
|
||||
if (delayed_work_pending(&deferred_probe_timeout_work) &&
|
||||
mod_delayed_work(system_wq, &deferred_probe_timeout_work,
|
||||
secs_to_jiffies(driver_deferred_probe_timeout)))
|
||||
pr_debug("Extended deferred probe timeout by %d secs\n",
|
||||
driver_deferred_probe_timeout);
|
||||
|
||||
Reference in New Issue
Block a user