All of lore.kernel.org
 help / color / mirror / Atom feed
From: Saravana Kannan <saravanak@google.com>
To: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	"Cc: Android Kernel" <kernel-team@android.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] driver core: Avoid pointless deferred probe attempts
Date: Thu, 18 Feb 2021 09:58:15 -0800	[thread overview]
Message-ID: <CAGETcx_b3ytjN2G28vqDxiD5nmbXs7_kF70mm5a=0PABTdMgLg@mail.gmail.com> (raw)
In-Reply-To: <CAGETcx-M51sy86QGXQpnevXb0AniNPatVJwcM9tRQttVXH5JEg@mail.gmail.com>

On Thu, Feb 18, 2021 at 9:24 AM Saravana Kannan <saravanak@google.com> wrote:
>
> On Thu, Feb 18, 2021 at 9:18 AM Rafael J. Wysocki <rafael@kernel.org> wrote:
> >
> > On Thu, Feb 18, 2021 at 12:51 AM Saravana Kannan <saravanak@google.com> wrote:
> > >
> > > There's no point in adding a device to the deferred probe list if we
> > > know for sure that it doesn't have a matching driver. So, check if a
> > > device can match with a driver before adding it to the deferred probe
> > > list.
> >
> > What if a matching driver module loads in the meantime?
>
> Driver registration always triggers a match attempt and this flag will
> get set at that point. Yes, the user can disable autoprobe, but
> that'll block deferred probes too.
>

Btw, this can wait for 5.13. Doesn't need to go into 5.12-rcX.

> > > diff --git a/drivers/base/dd.c b/drivers/base/dd.c
> > > index 9179825ff646..f18963f42e21 100644
> > > --- a/drivers/base/dd.c
> > > +++ b/drivers/base/dd.c
> > > @@ -123,6 +123,9 @@ static DECLARE_WORK(deferred_probe_work, deferred_probe_work_func);
> > >
> > >  void driver_deferred_probe_add(struct device *dev)
> > >  {
> > > +       if (!dev->can_match)
> > > +               return;
> > > +

Also, if you are worried about this check, for now, I can move it
inside device_links_driver_bound() which is the only place that
currently adds a device to the deferred probe list before the driver
is present. But it seemed like a good check in general to have in
driver_deferred_probe_add(), so I put it there.

-Saravana

  reply	other threads:[~2021-02-18 19:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-17 23:51 [PATCH] driver core: Avoid pointless deferred probe attempts Saravana Kannan
2021-02-18 17:18 ` Rafael J. Wysocki
2021-02-18 17:24   ` Saravana Kannan
2021-02-18 17:58     ` Saravana Kannan [this message]
2021-02-25  1:32     ` Saravana Kannan
2021-02-23 10:09 ` Geert Uytterhoeven
2021-02-23 19:56   ` Saravana Kannan

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='CAGETcx_b3ytjN2G28vqDxiD5nmbXs7_kF70mm5a=0PABTdMgLg@mail.gmail.com' \
    --to=saravanak@google.com \
    --cc=geert@linux-m68k.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=kernel-team@android.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.