Linux driver-core infrastructure
 help / color / mirror / Atom feed
* [PATCH 1/2] driver core: Fix missing jiffies conversion in deferred_probe_extend_timeout()
@ 2026-05-25  1:23 Danilo Krummrich
  2026-05-25  1:23 ` [PATCH 2/2] driver core: Guard deferred probe timeout extension with delayed_work_pending() Danilo Krummrich
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Danilo Krummrich @ 2026-05-25  1:23 UTC (permalink / raw)
  To: gregkh, rafael; +Cc: driver-core, linux-kernel, 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 <dakr@kernel.org>
---
 drivers/base/dd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/base/dd.c b/drivers/base/dd.c
index 172a02a438a2..bebb43acc132 100644
--- a/drivers/base/dd.c
+++ b/drivers/base/dd.c
@@ -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
-- 
2.54.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/2] driver core: Guard deferred probe timeout extension with delayed_work_pending()
  2026-05-25  1:23 [PATCH 1/2] driver core: Fix missing jiffies conversion in deferred_probe_extend_timeout() Danilo Krummrich
@ 2026-05-25  1:23 ` Danilo Krummrich
  2026-05-25  6:01   ` Greg KH
  2026-05-26 12:51   ` Geert Uytterhoeven
  2026-05-25  6:01 ` [PATCH 1/2] driver core: Fix missing jiffies conversion in deferred_probe_extend_timeout() Greg KH
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 8+ messages in thread
From: Danilo Krummrich @ 2026-05-25  1:23 UTC (permalink / raw)
  To: gregkh, rafael; +Cc: driver-core, linux-kernel, 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 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: 1137838865bf ("driver core: Use mod_delayed_work to prevent lost deferred probe work")
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
---
 drivers/base/dd.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/base/dd.c b/drivers/base/dd.c
index bebb43acc132..905269ecef9b 100644
--- a/drivers/base/dd.c
+++ b/drivers/base/dd.c
@@ -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);
-- 
2.54.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2] driver core: Fix missing jiffies conversion in deferred_probe_extend_timeout()
  2026-05-25  1:23 [PATCH 1/2] driver core: Fix missing jiffies conversion in deferred_probe_extend_timeout() Danilo Krummrich
  2026-05-25  1:23 ` [PATCH 2/2] driver core: Guard deferred probe timeout extension with delayed_work_pending() Danilo Krummrich
@ 2026-05-25  6:01 ` Greg KH
  2026-05-26 12:49 ` Geert Uytterhoeven
  2026-05-26 14:58 ` Danilo Krummrich
  3 siblings, 0 replies; 8+ messages in thread
From: Greg KH @ 2026-05-25  6:01 UTC (permalink / raw)
  To: Danilo Krummrich; +Cc: rafael, driver-core, linux-kernel

On Mon, May 25, 2026 at 03:23:21AM +0200, Danilo Krummrich wrote:
> 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 <dakr@kernel.org>
> ---
>  drivers/base/dd.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/base/dd.c b/drivers/base/dd.c
> index 172a02a438a2..bebb43acc132 100644
> --- a/drivers/base/dd.c
> +++ b/drivers/base/dd.c
> @@ -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
> -- 
> 2.54.0
> 
> 

Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/2] driver core: Guard deferred probe timeout extension with delayed_work_pending()
  2026-05-25  1:23 ` [PATCH 2/2] driver core: Guard deferred probe timeout extension with delayed_work_pending() Danilo Krummrich
@ 2026-05-25  6:01   ` Greg KH
  2026-05-26 12:51   ` Geert Uytterhoeven
  1 sibling, 0 replies; 8+ messages in thread
From: Greg KH @ 2026-05-25  6:01 UTC (permalink / raw)
  To: Danilo Krummrich; +Cc: rafael, driver-core, linux-kernel

On Mon, May 25, 2026 at 03:23:22AM +0200, Danilo Krummrich wrote:
> 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: 1137838865bf ("driver core: Use mod_delayed_work to prevent lost deferred probe work")
> Signed-off-by: Danilo Krummrich <dakr@kernel.org>
> ---
>  drivers/base/dd.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/base/dd.c b/drivers/base/dd.c
> index bebb43acc132..905269ecef9b 100644
> --- a/drivers/base/dd.c
> +++ b/drivers/base/dd.c
> @@ -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);
> -- 
> 2.54.0
> 
> 

Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2] driver core: Fix missing jiffies conversion in deferred_probe_extend_timeout()
@ 2026-05-26 12:24 Biju Das
  0 siblings, 0 replies; 8+ messages in thread
From: Biju Das @ 2026-05-26 12:24 UTC (permalink / raw)
  To: dakr@kernel.org
  Cc: driver-core@lists.linux.dev, gregkh@linuxfoundation.org,
	linux-kernel@vger.kernel.org, rafael@kernel.org

Hi Danilo,

Thanks for the patch.

> From: Danilo Krummrich <dakr@kernel.org>
> Subject: [PATCH 1/2] driver core: Fix missing jiffies conversion in deferred_probe_extend_timeout()

> 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: 1137838865bf ("driver core: Use mod_delayed_work to prevent lost deferred probe work")
> Signed-off-by: Danilo Krummrich <dakr@kernel.org>

Fix is tested on Renesas RZ/G2L SMARC EVK platform.

Tested-by: Biju Das <biju.das.jz@bp.renesas.com>

Cheers,
Biju

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2] driver core: Fix missing jiffies conversion in deferred_probe_extend_timeout()
  2026-05-25  1:23 [PATCH 1/2] driver core: Fix missing jiffies conversion in deferred_probe_extend_timeout() Danilo Krummrich
  2026-05-25  1:23 ` [PATCH 2/2] driver core: Guard deferred probe timeout extension with delayed_work_pending() Danilo Krummrich
  2026-05-25  6:01 ` [PATCH 1/2] driver core: Fix missing jiffies conversion in deferred_probe_extend_timeout() Greg KH
@ 2026-05-26 12:49 ` Geert Uytterhoeven
  2026-05-26 14:58 ` Danilo Krummrich
  3 siblings, 0 replies; 8+ messages in thread
From: Geert Uytterhoeven @ 2026-05-26 12:49 UTC (permalink / raw)
  To: Danilo Krummrich; +Cc: gregkh, rafael, driver-core, linux-kernel

Hi Danilo,

On Mon, 25 May 2026 at 03:23, Danilo Krummrich <dakr@kernel.org> wrote:
> 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 <dakr@kernel.org>

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.

Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>

[1] https://lore.kernel.org/20260526120306.184283-1-biju.das.jz@bp.renesas.com

Gr{oetje,eeting}s,

                        Geert


--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/2] driver core: Guard deferred probe timeout extension with delayed_work_pending()
  2026-05-25  1:23 ` [PATCH 2/2] driver core: Guard deferred probe timeout extension with delayed_work_pending() Danilo Krummrich
  2026-05-25  6:01   ` Greg KH
@ 2026-05-26 12:51   ` Geert Uytterhoeven
  1 sibling, 0 replies; 8+ messages in thread
From: Geert Uytterhoeven @ 2026-05-26 12:51 UTC (permalink / raw)
  To: Danilo Krummrich; +Cc: gregkh, rafael, driver-core, linux-kernel

Hi Danilo,

On Mon, 25 May 2026 at 03:23, Danilo Krummrich <dakr@kernel.org> wrote:
> 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: 1137838865bf ("driver core: Use mod_delayed_work to prevent lost deferred probe work")
> Signed-off-by: Danilo Krummrich <dakr@kernel.org>

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.

Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>

[1] https://lore.kernel.org/20260526120306.184283-1-biju.das.jz@bp.renesas.com

Gr{oetje,eeting}s,

                        Geert


--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2] driver core: Fix missing jiffies conversion in deferred_probe_extend_timeout()
  2026-05-25  1:23 [PATCH 1/2] driver core: Fix missing jiffies conversion in deferred_probe_extend_timeout() Danilo Krummrich
                   ` (2 preceding siblings ...)
  2026-05-26 12:49 ` Geert Uytterhoeven
@ 2026-05-26 14:58 ` Danilo Krummrich
  3 siblings, 0 replies; 8+ messages in thread
From: Danilo Krummrich @ 2026-05-26 14:58 UTC (permalink / raw)
  To: Danilo Krummrich; +Cc: gregkh, rafael, driver-core, linux-kernel

On Mon, 25 May 2026 03:23:21 +0200, Danilo Krummrich wrote:
> [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: 557495bc8790

The 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.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2026-05-26 14:58 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-25  1:23 [PATCH 1/2] driver core: Fix missing jiffies conversion in deferred_probe_extend_timeout() Danilo Krummrich
2026-05-25  1:23 ` [PATCH 2/2] driver core: Guard deferred probe timeout extension with delayed_work_pending() Danilo Krummrich
2026-05-25  6:01   ` Greg KH
2026-05-26 12:51   ` Geert Uytterhoeven
2026-05-25  6:01 ` [PATCH 1/2] driver core: Fix missing jiffies conversion in deferred_probe_extend_timeout() Greg KH
2026-05-26 12:49 ` Geert Uytterhoeven
2026-05-26 14:58 ` Danilo Krummrich
  -- strict thread matches above, loose matches on Subject: below --
2026-05-26 12:24 Biju Das

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox