lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 18 Nov 2021 09:16:14 -0800
From:   Matthias Kaehlcke <mka@...omium.org>
To:     Alan Stern <stern@...land.harvard.edu>
Cc:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        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,
        Douglas Anderson <dianders@...omium.org>,
        Roger Quadros <rogerq@...nel.org>,
        Michal Simek <michal.simek@...inx.com>,
        Ravi Chandra Sadineni <ravisadineni@...omium.org>,
        Bastien Nocera <hadess@...ess.net>,
        Andrew Lunn <andrew@...n.ch>,
        Aswath Govindraju <a-govindraju@...com>,
        Dmitry Osipenko <digetx@...il.com>,
        Gregory Clement <gregory.clement@...tlin.com>,
        Krzysztof Kozlowski <krzysztof.kozlowski@...onical.com>,
        Lukas Bulwahn <lukas.bulwahn@...il.com>,
        Pawel Laszczak <pawell@...ence.com>,
        Sebastian Hesselbarth <sebastian.hesselbarth@...il.com>,
        Tony Lindgren <tony@...mide.com>,
        linux-arm-kernel@...ts.infradead.org, linux-omap@...r.kernel.org,
        linux-samsung-soc@...r.kernel.org
Subject: Re: [PATCH v17 7/7] usb: Specify dependencies on USB_XHCI_PLATFORM
 with 'depends on'

On Tue, Nov 16, 2021 at 09:21:44PM -0500, Alan Stern wrote:
> On Tue, Nov 16, 2021 at 12:07:39PM -0800, Matthias Kaehlcke wrote:
> > Some USB controller drivers that depend on the xhci-plat driver
> > specify this dependency using 'select' in Kconfig. This is not
> > recommended for symbols that have other dependencies as it may
> > lead to invalid configurations. Use 'depends on' to specify the
> > dependency instead of 'select'.
> > 
> > For dwc3 specify the dependency on USB_XHCI_PLATFORM in
> > USB_DWC3_HOST and USB_DWC3_DUAL_ROLE. Also adjust the
> > dependencies of USB_DWC3_CORE to make sure that at least one
> > of USB_DWC3_HOST, USB_DWC3_GADGET or USB_DWC3_DUAL_ROLE can be
> > selected.
> > 
> > Signed-off-by: Matthias Kaehlcke <mka@...omium.org>
> > Reviewed-by: Roger Quadros <rogerq@...nel.org>
> > Reviewed-by: Douglas Anderson <dianders@...omium.org>
> > ---
> > 
> > Changes in v17:
> > - removed explicit dependency on USB from USB_DWC3
> > - added 'Reviewed-by' tags from Roger and Doug
> > 
> > Changes in v16:
> > - none
> > 
> > Changes in v15:
> > - adjusted dependencies of USB_DWC3_CORE to make sure it can only
> >   be enabled when at least one of USB_DWC3_HOST, USB_DWC3_GADGET
> >   or USB_DWC3_DUAL_ROLE is selectable
> > - updated commit message
> > 
> > Changes in v14:
> > - none
> > 
> > Changes in v13:
> > - patch added to the series
> 
> > diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
> > index d1d926f8f9c2..e5e612f143a1 100644
> > --- a/drivers/usb/host/Kconfig
> > +++ b/drivers/usb/host/Kconfig
> > @@ -80,7 +80,7 @@ config USB_XHCI_MTK
> >  
> >  config USB_XHCI_MVEBU
> >  	tristate "xHCI support for Marvell Armada 375/38x/37xx"
> > -	select USB_XHCI_PLATFORM
> > +	depends on USB_XHCI_PLATFORM
> >  	depends on HAS_IOMEM
> >  	depends on ARCH_MVEBU || COMPILE_TEST
> >  	help
> > @@ -112,9 +112,9 @@ config USB_EHCI_BRCMSTB
> >  config USB_BRCMSTB
> >  	tristate "Broadcom STB USB support"
> >  	depends on (ARCH_BRCMSTB && PHY_BRCM_USB) || COMPILE_TEST
> > +	depends on !USB_XHCI_HCD || USB_XHCI_PLATFORM
> >  	select USB_OHCI_HCD_PLATFORM if USB_OHCI_HCD
> >  	select USB_EHCI_BRCMSTB if USB_EHCI_HCD
> > -	select USB_XHCI_PLATFORM if USB_XHCI_HCD
> >  	help
> >  	  Enables support for XHCI, EHCI and OHCI host controllers
> >  	  found in Broadcom STB SoC's.
> 
> It should be pointed out that this now requires people with xHCI systems 
> to actively turn on CONFIG_USB_XHCI_PLATFORM before they can enable 
> CONFIG_USB_BRCMSTB.  Before, that was not necessary.  Some users might 
> get confused and not realize what is needed.  Perhaps something should 
> be added to the "help" text.

I agree that the change could cause confusion, I'm not sure though if
adding something to the "help" text is a good mitigation. Users won't see
the text unless they can select the option, which requires
CONFIG_USB_XHCI_PLATFORM to be enabled. Also the dependencies are specified
nearby (and displayed), so it seems similar to a code comment on something
that the code evidently does (e.g. "initialize foobar with 0").

On a different note: I'm considering to break the CONFIG_USB_XHCI_PLATFORM
related patches out of the onboard_usb_hub series, since the driver
doesn't any longer depend on xhci_plat. In that sense I'm also open
to abandon those patches, if they aren't considered an improvement on
their own.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ