Linux driver-core infrastructure
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Danilo Krummrich <dakr@kernel.org>
Cc: rafael@kernel.org, driver-core@lists.linux.dev,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] driver core: Guard deferred probe timeout extension with delayed_work_pending()
Date: Mon, 25 May 2026 08:01:40 +0200	[thread overview]
Message-ID: <2026052529-snowboard-deforest-8f79@gregkh> (raw)
In-Reply-To: <20260525012340.3860581-2-dakr@kernel.org>

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>


  reply	other threads:[~2026-05-25  6:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2026052529-snowboard-deforest-8f79@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=dakr@kernel.org \
    --cc=driver-core@lists.linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rafael@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox