driver core: Fix missing jiffies conversion in deferred_probe_extend_timeout()
Danilo Krummrich
maintainerPATCH 1/2 driver core: Fix missing jiffies conversion in deferred_probe_extend_timeout()
mod_delayed_work() takes jiffies, not seconds. Thus, restore the dropped conversion.
While at it, fix incorrect indentation.
--- drivers/base/dd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/base/dd.c +1 -1
@@ -324,7 +324,7 @@ void deferred_probe_extend_timeout(void)* start a new one. */ if (mod_delayed_work (system_wq, &deferred_probe_timeout_work, - driver_deferred_probe_timeout)) +secs_to_jiffies (driver_deferred_probe_timeout)))pr_debug ("Extended deferred probe timeout by %d secs\n" , driver_deferred_probe_timeout); }
base-commit: 56785dcb2ef6d3cff82ac33f2e34db94377416a3
Signature · 1 line
2.54.0
Danilo Krummrich
maintainerPATCH 2/2 driver core: Guard deferred probe timeout extension with delayed_work_pending()
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.
--- drivers/base/dd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/base/dd.c +2 -1
@@ -323,7 +323,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);
Signature · 1 line
2.54.0
Re: [PATCH 2/2] driver core: Guard deferred probe timeout extension with delayed_work_pending()
Quoted 33 lines · Danilo Krummrich
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 adelayed_work_pending()guard to restore the originally intended semantics.Premature firing calls
fw_devlink_drivers_done()before all built-in drivers have registered, causingfw_devlinkto prematurely relax device links for suppliers whose drivers haven't loaded yet.Fixes 1137838865bf ("driver core: Use mod_delayed_work to prevent lost deferred probe work")Signed-off-by Danilo Krummrich <[email protected]>--- drivers/base/dd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/base/dd.c +2
-1@@ -323,7 +323,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);Signature · 1 line
2.54.0
Re: [PATCH 2/2] driver core: Guard deferred probe timeout extension with delayed_work_pending()
In reply to Danilo KrummrichHi Danilo,
Quoted 11 lines · Danilo Krummrich
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 adelayed_work_pending()guard to restore the originally intended semantics.Premature firing calls
fw_devlink_drivers_done()before all built-in drivers have registered, causingfw_devlinkto prematurely relax device links for suppliers whose drivers haven't loaded yet.Fixes 1137838865bf ("driver core: Use mod_delayed_work to prevent lost deferred probe work")Signed-off-by Danilo Krummrich <[email protected]>
Thanks, with both patches from this series applied, I am no longer seeing the WARNING Biju reported[1], and thousands of "sync_state() pending due to" and hundreds of "deferred probe pending" messages.
[1] https://lore.kernel.org/[email protected]
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Quoted 25 lines · Danilo Krummrich
mod_delayed_work()takes jiffies, not seconds. Thus, restore the dropped conversion.While at it, fix incorrect indentation.
Fixes 1137838865bf ("driver core: Use mod_delayed_work to prevent lost deferred probe work")Signed-off-by Danilo Krummrich <[email protected]>--- drivers/base/dd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/base/dd.c +1
-1@@ -324,7 +324,7 @@ void deferred_probe_extend_timeout(void)* start a new one. */ if (mod_delayed_work (system_wq, &deferred_probe_timeout_work, - driver_deferred_probe_timeout)) +secs_to_jiffies (driver_deferred_probe_timeout)))pr_debug ("Extended deferred probe timeout by %d secs\n" , driver_deferred_probe_timeout); }
Quoted 5 lines
base-commit:
56785dcb2ef6d3cff82ac33f2e34db94377416a3Signature · 1 line
2.54.0
Hi Danilo,
Quoted 7 lines · Danilo Krummrich
mod_delayed_work()takes jiffies, not seconds. Thus, restore the dropped conversion.While at it, fix incorrect indentation.
Fixes 1137838865bf ("driver core: Use mod_delayed_work to prevent lost deferred probe work")Signed-off-by Danilo Krummrich <[email protected]>
Thanks, with both patches from this series applied, I am no longer seeing the WARNING Biju reported[1], and thousands of "sync_state() pending due to" and hundreds of "deferred probe pending" messages.
[1] https://lore.kernel.org/[email protected]
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Quoted 1 line · Danilo Krummrich
[PATCH 1/2] driver core: Fix missing jiffies conversion in
deferred_probe_extend_timeout()
Applied, thanks!
Branch: driver-core-next
Tree: git://git.kernel.org/pub/scm/linux/kernel/git/driver-core/driver-core.git
[1/2] driver core: Fix missing jiffies conversion in deferred_probe_extend_timeout()
commit: f9e6da99fe49
[2/2] driver core: Guard deferred probe timeout extension with delayed_work_pending()
commit: 557495bc8790The patches will appear in the next linux-next integration (typically within 24 hours on weekdays).
The patches are queued up for the upcoming merge window for the next major kernel release.