[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YbOFhcICfrbl6bZV@google.com>
Date: Fri, 10 Dec 2021 08:51:17 -0800
From: Matthias Kaehlcke <mka@...omium.org>
To: Doug Anderson <dianders@...omium.org>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Alan Stern <stern@...land.harvard.edu>,
Rob Herring <robh+dt@...nel.org>,
Frank Rowand <frowand.list@...il.com>,
Mathias Nyman <mathias.nyman@...el.com>,
Felipe Balbi <balbi@...nel.org>, linux-kernel@...r.kernel.org,
Krzysztof Kozlowski <krzk@...nel.org>,
Stephen Boyd <swboyd@...omium.org>,
Peter Chen <peter.chen@...nel.org>, linux-usb@...r.kernel.org,
devicetree@...r.kernel.org, Roger Quadros <rogerq@...nel.org>,
Michal Simek <michal.simek@...inx.com>,
Ravi Chandra Sadineni <ravisadineni@...omium.org>,
Bastien Nocera <hadess@...ess.net>
Subject: Re: [PATCH v17 1/7] usb: misc: Add onboard_usb_hub driver
On Thu, Nov 18, 2021 at 09:52:28AM -0800, Matthias Kaehlcke wrote:
> On Wed, Nov 17, 2021 at 04:11:34PM -0800, Doug Anderson wrote:
> > Hi,
> >
> > On Tue, Nov 16, 2021 at 12:07 PM Matthias Kaehlcke <mka@...omium.org> wrote:
> > >
> > > --- a/drivers/usb/misc/Kconfig
> > > +++ b/drivers/usb/misc/Kconfig
> > > @@ -284,3 +284,20 @@ config BRCM_USB_PINMAP
> > > This option enables support for remapping some USB external
> > > signals, which are typically on dedicated pins on the chip,
> > > to any gpio.
> > > +
> > > +config USB_ONBOARD_HUB
> > > + tristate "Onboard USB hub support"
> >
> > Aren't you back to shenanigans now that you're being called straight
> > from the USB core? What if you're a module and the USB core is
> > builtin? It can't call you, right? ...or what if you're builtin but
> > the USB core is a module (yeah, I know that sounds insane but I don't
> > think anything technically prevents it)?
>
> Indeed, a dependency involving USB host mode is needed, as previously
> with xhci_plat.
>
> > Can you just add a dependency here such that if the USB core is a
> > module that you're a module and if the USB core is builtin that you're
> > builtin?
>
> I couldn't find a way to specify that in the config options of the driver
> itself. I fear the dependency has to be specified in CONFIG_USB, like it
> was done previously with USB_XHCI_PLATFORM:
>
> https://patchwork.kernel.org/project/linux-usb/patch/20210813125146.v16.6.I7a3a7d9d2126c34079b1cab87aa0b2ec3030f9b7@changeid/
>
> Hope that isn't controversial.
Ugh, actually adding
depends on USB_ONBOARD_HUB || !USB_ONBOARD_HUB
to CONFIG_USB does not work. The problem is that USB_ONBOARD_HUB depends on
CONFIG_USB (not through an explicit dependency, but the 'misc' directory it
resides in is only included when CONFIG_USB=y/m), so the above rule would
introduce a circular dependency.
Unless there is some other way to specify "don't allow building
USB_ONBOARD_HUB as a module, unless USB is a module" I fear USB_ONBOARD_HUB
must be bool, which isn't really great :(
Powered by blists - more mailing lists