public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Peter Chen <peter.chen@freescale.com>
Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: Disable bus's drivers_autoprobe before rootfs has mounted
Date: Wed, 11 Jun 2014 12:10:17 -0700	[thread overview]
Message-ID: <20140611191017.GA15120@kroah.com> (raw)
In-Reply-To: <20140611032322.GB25082@shlinux1.ap.freescale.net>

On Wed, Jun 11, 2014 at 11:23:23AM +0800, Peter Chen wrote:
> On Tue, Jun 10, 2014 at 09:10:00PM -0700, Greg KH wrote:
> > On Wed, Jun 11, 2014 at 10:14:40AM +0800, Peter Chen wrote:
> > > Hi Greg,
> > > 
> > > Currently, we can't disable auto probe function during booting
> > > if both device and device driver register code are built in due
> > > to .drivers_autoprobe is a private value for bus core and this
> > > value can only be changed by sys entry.
> > 
> > Then don't build them into the kernel :)
> > 
> > > It causes we can't implement feature that the user can choose
> > > manual binding and auto binding through module parameters.
> > 
> > Wait, you just asked about building the stuff into the kernel, not a
> > module.
> 
> Yes, build the code into the kernel.
> > 
> > > Eg, the default binding is automatic, but the user can override
> > > it by module parameter.
> > 
> > Do we do that for any other "bus" anywhere?
> 
> I don't know.
> 
> > 
> > > Let's take USB peripheral as an example, there is a device for
> > > udc, and a device driver for usb gadget driver, at default, we want
> > > the device to be bound to driver automatically, this is what
> > > we have done now. But if there are more than one udcs and gadget
> > > drivers (eg one B port for mass storage, another B port for usb ethernet),
> > > the user may want to have specific binding (eg, udc-0 -> mass storage,
> > > udc-1 -> usb ethernet), so the binding will be established
> > > after rootfs has mounted. (This feature is implementing)
> > 
> > Then there better be a way to describe this on the kernel command line
> > (i.e. module paramaters), right?  Which is a total mess, why not just
> > not bind anything in this case and let the user pick what they want?
> 
> If the user is used to do nothing at rootfs for current or earlier kernel,
> Is it ok we change the driver's behaviour and a sys entry is mandatory
> for user?

We can't break existing systems, so I don't understand the issue here.
Just don't configure your kernel for a system you don't have / want,
right?

> > > From what I read code, we can't implement above feature, but I may
> > > be wrong, if you have some solutions, give me some hints please.
> > > If there is no solution for above feature, do we agree with exporting
> > > .drivers_autoprobe for bus driver or something similar?
> > 
> > I don't understand what you mean by this, care to show me with code?
> 
> I mean the individual bus driver can't change bus->p->drivers_autoprobe?
> bus->p->drivers_autoprobe is handled at drivers/base/bus.c.
> 
> If the individual bus driver can change bus->p->drivers_autoprobe, we
> can disable autoprobe (auto-binding) during booting.

No, that's a core only thing.

greg k-h

  reply	other threads:[~2014-06-11 19:06 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-11  2:14 Disable bus's drivers_autoprobe before rootfs has mounted Peter Chen
2014-06-11  4:10 ` Greg KH
2014-06-11  3:23   ` Peter Chen
2014-06-11 19:10     ` Greg KH [this message]
2014-06-11 19:27       ` Alan Stern
2014-06-12  6:31         ` Peter Chen
2014-06-12 14:12           ` Alan Stern
2014-06-13 10:15             ` Peter Chen
2014-06-13 14:19               ` Alan Stern
2014-06-16  1:36                 ` Peter Chen
2014-06-16 15:00                   ` Alan Stern
2014-06-17  2:04                     ` Peter Chen
2014-06-11  4:35   ` Felipe Balbi
2014-06-11  3:29     ` Peter Chen
2014-06-11 19:36       ` Felipe Balbi
2014-06-12  7:02         ` Peter Chen
2014-06-12 16:53           ` Felipe Balbi
2014-06-13  7:30             ` Peter Chen

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=20140611191017.GA15120@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=peter.chen@freescale.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