devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rob Herring <robh@kernel.org>
To: Nayeemahmed Badebade <nayeemahmed.badebade@sony.com>
Cc: krzk+dt@kernel.org, conor+dt@kernel.org,
	gregkh@linuxfoundation.org, rafael@kernel.org,
	yoshihiro.toyama@sony.com, linux-kernel@vger.kernel.org,
	devicetree@vger.kernel.org
Subject: Re: [PATCH 2/2] driver: core: add probe control driver
Date: Wed, 18 Sep 2024 09:55:16 -0500	[thread overview]
Message-ID: <20240918145516.GA1560032-robh@kernel.org> (raw)
In-Reply-To: <ZulEFlDoRz4USTB8@NAB-HP-ProDesk-600sony.com>

On Tue, Sep 17, 2024 at 02:25:50PM +0530, Nayeemahmed Badebade wrote:
> Hi Rob,
> 
> Thank you for taking the time to check our patch and provide
> valuable feedback. We appreciate your comments/suggestions.
> 
> Please find our reply to your comments.
> 
> On Thu, Sep 12, 2024 at 03:46:34PM -0500, Rob Herring wrote:
> > On Wed, Sep 11, 2024 at 07:53:19PM +0530, Nayeemahmed Badebade wrote:
> > > Probe control driver framework allows deferring the probes of a group of
> > > devices to an arbitrary time, giving the user control to trigger the probes
> > > after boot. This is useful for deferring probes from builtin drivers that
> > > are not required during boot and probe when user wants after boot.
> > 
> > This seems like the wrong way around to me. Why not define what you want 
> > to probe first or some priority order? I could see use for kernel to 
> > probe whatever is the console device first. Or the rootfs device... You 
> > don't need anything added to DT for those.
> > 
> > Of course, there's the issue that Linux probes are triggered bottom-up 
> > rather than top-down.
> > 
> 
> Our intention is to only postpone some driver probes not required during
> boot, similar to https://elinux.org/Deferred_Initcalls. But instead of
> delaying initcall execution(which requires initmem to be kept and not
> freed during boot) we are trying to delay driver probes as this is much
> simpler.
> 
> > 
> > > This is achieved by adding a dummy device aka probe control device node
> > > as provider to a group of devices(consumer nodes) in platform's device
> > > tree. Consumers are the devices we want to probe after boot.
> > 
> > There's the obvious question of then why not make those devices modules 
> > instead of built-in?
> > 
> 
> Yes we can use modules for this, but there are drivers that cannot be
> built as modules and this framework is specifically for such scenario.
> Example: drivers/pci/controller/dwc/pci-imx6.c

Then fix the driver to work as a module. Or to use async probe which is 
not the default and is opt-in per driver.

> 
> > > 
> > > To establish control over consumer device probes, each consumer device node
> > > need to refer the probe control provider node by the phandle.
> > > 'probe-control-supply' property is used for this.
> > > 
> > > Example:
> > >     // The node below defines a probe control device/provider node
> > >     prb_ctrl_dev_0: prb_ctrl_dev_0 {
> > >         compatible = "linux,probe-control";
> > >     };
> > > 
> > >     // The node below is the consumer device node that refers to provider
> > >     // node by its phandle and a result will not be probed until provider
> > >     // node is probed.
> > >     pcie@1ffc000 {
> > >         reg = <0x01ffc000 0x04000>, <0x01f00000 0x80000>;
> > >         #address-cells = <3>;
> > >         #size-cells = <2>;
> > >         device_type = "pci";
> > >         ranges = <0x81000000 0 0          0x01f80000 0 0x00010000>,
> > >                  <0x82000000 0 0x01000000 0x01000000 0 0x00f00000>;
> > > 
> > >         probe-control-supply = <&prb_ctrl_dev_0>;
> > >     };
> > 
> > Sorry, but this isn't going to happen in DT.
> > 
> 
> You mean we cannot add custom properties like this to an existing
> device node in DT?

Sure, you can add properties. It happens all the time. This is too tied 
to some OS implementation/behavior and therefore is not appropriate for 
DT.

Rob

  reply	other threads:[~2024-09-18 14:55 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-11 14:23 [PATCH 0/2] Add framework for user controlled driver probes Nayeemahmed Badebade
2024-09-11 14:23 ` [PATCH 1/2] dt-bindings: probe-control: add probe control driver Nayeemahmed Badebade
2024-09-17  9:00   ` Krzysztof Kozlowski
2024-09-26  9:40     ` Nayeemahmed Badebade
2024-09-11 14:23 ` [PATCH 2/2] driver: core: " Nayeemahmed Badebade
2024-09-12 20:46   ` Rob Herring
2024-09-17  8:55     ` Nayeemahmed Badebade
2024-09-18 14:55       ` Rob Herring [this message]
2024-09-26 10:06         ` Nayeemahmed Badebade
2024-09-13  4:37   ` Greg KH
2024-09-17  9:22     ` Nayeemahmed Badebade
2024-09-13  4:36 ` [PATCH 0/2] Add framework for user controlled driver probes Greg KH
2024-09-17  9:06   ` Nayeemahmed Badebade
2024-09-17  9:03     ` Krzysztof Kozlowski
2024-09-17  9:21       ` Greg KH
2024-09-26 11:07         ` Nayeemahmed Badebade
2024-09-26 12:34           ` Krzysztof Kozlowski
2024-09-27 15:31             ` Nayeemahmed Badebade
2024-09-27 17:36               ` Rob Herring
2024-09-30  7:12                 ` Nayeemahmed Badebade
2024-09-17 10:11     ` Greg KH
2024-09-27 14:14       ` Nayeemahmed Badebade

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=20240918145516.GA1560032-robh@kernel.org \
    --to=robh@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nayeemahmed.badebade@sony.com \
    --cc=rafael@kernel.org \
    --cc=yoshihiro.toyama@sony.com \
    /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;
as well as URLs for NNTP newsgroup(s).