mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alan Stern <stern@rowland.harvard.edu>
To: Doug Anderson <dianders@chromium.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J . Wysocki" <rafael@kernel.org>,
	Danilo Krummrich <dakr@kernel.org>,
	Saravana Kannan <saravanak@kernel.org>,
	stable@vger.kernel.org, driver-core@lists.linux.dev,
	linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH] driver core: Don't link the device to the bus until we're ready to probe
Date: Fri, 27 Mar 2026 21:35:47 -0400	[thread overview]
Message-ID: <5ea67deb-e669-4faa-be47-b1b225f1194a@rowland.harvard.edu> (raw)
In-Reply-To: <CAD=FV=UroO1vQYJDkrp86D475F8b-RStUXYejWwTQ0NqP1a_ew@mail.gmail.com>

On Fri, Mar 27, 2026 at 12:30:47PM -0700, Doug Anderson wrote:
> > But why just in that one case?  That's what I don't understand.  If it's
> > not okay to bind at this time on the driver-load path, why is it okay to
> > bind on other pathways (such as bus.c:bind_store())?
> 
> Ah, I see!
> 
> Yeah, OK. I spent more time, and I think I've a patch that will
> address things. I still like adding the "ready_to_probe" flag and
> setting it in device_add() right before bus_probe_device(). ...but
> I've changed where I'm testing this flag. Now I've got the test in
> __driver_probe_device(), where I simply do:
> 
>   /*
>    * In device_add(), the "struct device" gets linked into the subsystem's
>    * list of devices and broadcast to userspace (via uevent) before we're
>    * quite ready to probe. Those open pathways to driver probe before
>    * we've finished enough of device_add() to reliably support probe.
>    * Detect this and tell other pathways to try again later. device_add()
>    * itself will also try to probe immediately after setting
>    * "ready_to_probe".
>    */
>   if (!dev->ready_to_probe)
>     return dev_err_probe(dev, -EPROBE_DEFER, "Device not ready_to_probe");
> 
> I think that is more inline with your intuition that we should return
> some sort of "try again" code when we end up with this situation. This
> should also block _all_ probe paths safely by adding to the deferral
> list (just in case) or returning -EAGAIN (in the case of
> device_driver_attach()).
> 
> Does that sound like what you're looking for?

Yes, that's exactly what I was asking about.  Let's see the complete 
patch!

Alan Stern

  reply	other threads:[~2026-03-28  1:35 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-21  3:06 Douglas Anderson
2026-03-21  5:41 ` Greg Kroah-Hartman
2026-03-21  7:35   ` Doug Anderson
2026-03-21  7:42     ` Greg Kroah-Hartman
2026-03-21  8:05       ` Doug Anderson
2026-03-21 15:54         ` Alan Stern
2026-03-23 17:07           ` Doug Anderson
2026-03-23 17:47             ` Alan Stern
2026-03-23 22:24               ` Doug Anderson
2026-03-24 15:21                 ` Alan Stern
2026-03-26 21:49                   ` Doug Anderson
2026-03-27 18:46                     ` Alan Stern
2026-03-27 19:30                       ` Doug Anderson
2026-03-28  1:35                         ` Alan Stern [this message]
2026-03-30 14:31                           ` Doug Anderson

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=5ea67deb-e669-4faa-be47-b1b225f1194a@rowland.harvard.edu \
    --to=stern@rowland.harvard.edu \
    --cc=dakr@kernel.org \
    --cc=dianders@chromium.org \
    --cc=driver-core@lists.linux.dev \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=saravanak@kernel.org \
    --cc=stable@vger.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

all inboxes | Powered by JetHome®