Linux on ARM based TI OMAP SoCs
 help / color / mirror / Atom feed
* [PATCH v17 0/7] usb: misc: Add onboard_usb_hub driver
@ 2021-11-16 20:07 Matthias Kaehlcke
  2021-11-16 20:07 ` [PATCH v17 5/7] ARM: configs: Explicitly enable USB_XHCI_PLATFORM where needed Matthias Kaehlcke
  2021-11-16 20:07 ` [PATCH v17 7/7] usb: Specify dependencies on USB_XHCI_PLATFORM with 'depends on' Matthias Kaehlcke
  0 siblings, 2 replies; 9+ messages in thread
From: Matthias Kaehlcke @ 2021-11-16 20:07 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Alan Stern, Rob Herring, Frank Rowand,
	Mathias Nyman, Felipe Balbi
  Cc: linux-kernel, Krzysztof Kozlowski, Stephen Boyd, Peter Chen,
	linux-usb, devicetree, Douglas Anderson, Roger Quadros,
	Michal Simek, Ravi Chandra Sadineni, Bastien Nocera,
	Matthias Kaehlcke, Al Viro, Alexandre Torgue, Andrew Lunn,
	Andrey Konovalov, Andrey Zhizhikin, Andy Gross, Arnd Bergmann,
	Aswath Govindraju, Biju Das, Bjorn Andersson, Catalin Marinas,
	Dmitry Osipenko, Enric Balletbo i Serra, Florian Fainelli,
	Geert Uytterhoeven, Gregory Clement, Grygorii Strashko,
	Guido Günther, Jagan Teki, Joel Stanley,
	Kishon Vijay Abraham I, Krzysztof Kozlowski, Li Jun,
	Linus Walleij, Lukas Bulwahn, Manivannan Sadhasivam,
	Marek Szyprowski, Mark Brown, Nishanth Menon, Olivier Moysan,
	Pawel Laszczak, Peter Chen, Robert Richter, Russell King,
	Sasha Levin, Sebastian Hesselbarth, Shawn Guo, Thierry Reding,
	Thomas Gleixner, Tony Lindgren, Viresh Kumar, Will Deacon,
	William Cohen, Zenghui Yu, linux-arm-kernel, linux-arm-msm,
	linux-omap, linux-samsung-soc

This series adds:
- the onboard_usb_hub_driver
- glue in the generic HCD code to create and destroy the
  onboard_usb_hub platform devices if needed
- device tree changes that add RTS5411 entries for the QCA SC7180
  based boards trogdor and lazor
- a couple of stubs for platform device functions to avoid
  unresolved symbols with certain kernel configs

The main issue the driver addresses is that a USB hub needs to be
powered before it can be discovered. For discrete onboard hubs (an
example for such a hub is the Realtek RTS5411) this is often solved
by supplying the hub with an 'always-on' regulator, which is kind
of a hack. Some onboard hubs may require further initialization
steps, like changing the state of a GPIO or enabling a clock, which
requires even more hacks. This driver creates a platform device
representing the hub which performs the necessary initialization.
Currently it only supports switching on a single regulator, support
for multiple regulators or other actions can be added as needed.
Different initialization sequences can be supported based on the
compatible string.

Besides performing the initialization the driver can be configured
to power the hub off during system suspend. This can help to extend
battery life on battery powered devices which have no requirements
to keep the hub powered during suspend. The driver can also be
configured to leave the hub powered when a wakeup capable USB device
is connected when suspending, and power it off otherwise.

Changes in v17:
- rebased on top of v5.16-rc1
- moved creation of onboard_hub platform devices from xhci_platform
  to the generic HCD code
- addressed review comments for the onboard_hub driver
- moved Kconfig/defconfig changes to the end of the series. The
  onboard_hub driver doesn't depend on XHCI_PLATFORM anymore,
  hence these changes aren't really required for the driver, but
  they still seem to be a worthwhile improvement

Changes in v16:
- added patch 'ARM: configs: Explicitly enable USB_XHCI_PLATFORM
  where needed' to keep arm32 defconfigs effectively unchanged

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

Changes in v14:
- rebased on top of v5.14-rc1
- dropped DT binding patch which landed in v5.13

Changes in v13:
- added patch "usb: Specify dependency on USB_XHCI_PLATFORM with
  'depends on'" to the series to avoid Kconfig conflicts
- added patch "arm64: defconfig: Explicitly enable USB_XHCI_PLATFORM"
  to the series to keep effective defconfig unchanged

Changes in v12:
- onboard_hub driver: use IS_ENABLED(CONFIG_USB_ONBOARD_HUB_MODULE)
  in onboard_hub.h to also check for the driver built as module
- onboard_hub_driver: include onboard_hub.h again to make sure there
  are prototype declarations for the public functions

Changes in v11:
- support multiple onboard hubs connected to the same parent
- don't include ‘onboard_hub.h’ from the onboard hub driver

Changes in v10:
- always use of_is_onboard_usb_hub() stub unless ONBOARD_USB_HUB=y/m
- keep 'regulator-boot-on' property for pp3300_hub

Changes in v9:
- added dependency on ONBOARD_USB_HUB (or !!ONBOARD_USB_HUB) to
  USB_PLATFORM_XHCI

Changes in v7:
- updated DT binding
- series rebased on qcom/arm64-for-5.13

Changes in v6:
- updated summary

Changes in v5:
- cover letter added

Matthias Kaehlcke (7):
  usb: misc: Add onboard_usb_hub driver
  of/platform: Add stubs for of_platform_device_create/destroy()
  usb: core: hcd: Create platform devices for onboard hubs in probe()
  arm64: dts: qcom: sc7180-trogdor: Add nodes for onboard USB hub
  ARM: configs: Explicitly enable USB_XHCI_PLATFORM where needed
  arm64: defconfig: Explicitly enable USB_XHCI_PLATFORM
  usb: Specify dependencies on USB_XHCI_PLATFORM with 'depends on'

 .../sysfs-bus-platform-onboard-usb-hub        |   8 +
 MAINTAINERS                                   |   7 +
 arch/arm/configs/exynos_defconfig             |   1 +
 arch/arm/configs/keystone_defconfig           |   1 +
 arch/arm/configs/multi_v7_defconfig           |   1 +
 arch/arm/configs/mvebu_v7_defconfig           |   1 +
 arch/arm/configs/omap2plus_defconfig          |   1 +
 arch/arm/configs/pxa_defconfig                |   1 +
 .../boot/dts/qcom/sc7180-trogdor-lazor-r0.dts |  19 +-
 .../boot/dts/qcom/sc7180-trogdor-lazor-r1.dts |  12 +-
 .../arm64/boot/dts/qcom/sc7180-trogdor-r1.dts |  19 +-
 arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi  |  19 +-
 arch/arm64/configs/defconfig                  |   1 +
 drivers/usb/cdns3/Kconfig                     |   2 +-
 drivers/usb/core/hcd.c                        |   6 +
 drivers/usb/dwc3/Kconfig                      |   5 +-
 drivers/usb/host/Kconfig                      |   4 +-
 drivers/usb/misc/Kconfig                      |  17 +
 drivers/usb/misc/Makefile                     |   1 +
 drivers/usb/misc/onboard_usb_hub.c            | 491 ++++++++++++++++++
 include/linux/of_platform.h                   |  22 +-
 include/linux/usb/hcd.h                       |   1 +
 include/linux/usb/onboard_hub.h               |  18 +
 23 files changed, 619 insertions(+), 39 deletions(-)
 create mode 100644 Documentation/ABI/testing/sysfs-bus-platform-onboard-usb-hub
 create mode 100644 drivers/usb/misc/onboard_usb_hub.c
 create mode 100644 include/linux/usb/onboard_hub.h

-- 
2.34.0.rc1.387.gb447b232ab-goog


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH v17 5/7] ARM: configs: Explicitly enable USB_XHCI_PLATFORM where needed
  2021-11-16 20:07 [PATCH v17 0/7] usb: misc: Add onboard_usb_hub driver Matthias Kaehlcke
@ 2021-11-16 20:07 ` Matthias Kaehlcke
  2021-11-16 20:07 ` [PATCH v17 7/7] usb: Specify dependencies on USB_XHCI_PLATFORM with 'depends on' Matthias Kaehlcke
  1 sibling, 0 replies; 9+ messages in thread
From: Matthias Kaehlcke @ 2021-11-16 20:07 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Alan Stern, Rob Herring, Frank Rowand,
	Mathias Nyman, Felipe Balbi
  Cc: linux-kernel, Krzysztof Kozlowski, Stephen Boyd, Peter Chen,
	linux-usb, devicetree, Douglas Anderson, Roger Quadros,
	Michal Simek, Ravi Chandra Sadineni, Bastien Nocera,
	Matthias Kaehlcke, Krzysztof Kozlowski, Al Viro, Alexandre Torgue,
	Andrew Lunn, Arnd Bergmann, Dmitry Osipenko, Florian Fainelli,
	Gregory Clement, Grygorii Strashko, Joel Stanley, Linus Walleij,
	Manivannan Sadhasivam, Marek Szyprowski, Mark Brown,
	Olivier Moysan, Robert Richter, Russell King,
	Sebastian Hesselbarth, Thierry Reding, Thomas Gleixner,
	Tony Lindgren, Viresh Kumar, William Cohen, Zenghui Yu,
	linux-arm-kernel, linux-omap, linux-samsung-soc

The dependency of USB_DWC3 and USB_XHCI_MVEBU on USB_XHCI_PLATFORM
is being changed from 'select' to 'depends on' by another patch.
With that patch the defconfigs that enable one of these host
controllers also need to select USB_XHCI_PLATFORM explicitly
to keep the resulting config unchanged.

Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Reviewed-by: Roger Quadros <rogerq@kernel.org>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
---

Changes in v17:
- added 'Reviewed-by' tag from Roger
- added 'Acked-by' tag from Krzysztof

Changes in v16:
- patch added to the series

 arch/arm/configs/exynos_defconfig    | 1 +
 arch/arm/configs/keystone_defconfig  | 1 +
 arch/arm/configs/multi_v7_defconfig  | 1 +
 arch/arm/configs/mvebu_v7_defconfig  | 1 +
 arch/arm/configs/omap2plus_defconfig | 1 +
 arch/arm/configs/pxa_defconfig       | 1 +
 6 files changed, 6 insertions(+)

diff --git a/arch/arm/configs/exynos_defconfig b/arch/arm/configs/exynos_defconfig
index cae09010a799..2e07f5bb352b 100644
--- a/arch/arm/configs/exynos_defconfig
+++ b/arch/arm/configs/exynos_defconfig
@@ -256,6 +256,7 @@ CONFIG_SND_SIMPLE_CARD=y
 CONFIG_USB=y
 CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
 CONFIG_USB_XHCI_HCD=y
+CONFIG_USB_XHCI_PLATFORM=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_EHCI_EXYNOS=y
 CONFIG_USB_OHCI_HCD=y
diff --git a/arch/arm/configs/keystone_defconfig b/arch/arm/configs/keystone_defconfig
index 33c917df7b32..4f66c5a5d94d 100644
--- a/arch/arm/configs/keystone_defconfig
+++ b/arch/arm/configs/keystone_defconfig
@@ -164,6 +164,7 @@ CONFIG_USB=y
 CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
 CONFIG_USB_MON=y
 CONFIG_USB_XHCI_HCD=y
+CONFIG_USB_XHCI_PLATFORM=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_DWC3=y
 CONFIG_NOP_USB_XCEIV=y
diff --git a/arch/arm/configs/multi_v7_defconfig b/arch/arm/configs/multi_v7_defconfig
index c951aeed2138..14b339fb4958 100644
--- a/arch/arm/configs/multi_v7_defconfig
+++ b/arch/arm/configs/multi_v7_defconfig
@@ -775,6 +775,7 @@ CONFIG_SND_AUDIO_GRAPH_CARD=m
 CONFIG_USB=y
 CONFIG_USB_OTG=y
 CONFIG_USB_XHCI_HCD=y
+CONFIG_USB_XHCI_PLATFORM=y
 CONFIG_USB_XHCI_MVEBU=y
 CONFIG_USB_XHCI_TEGRA=m
 CONFIG_USB_EHCI_HCD=y
diff --git a/arch/arm/configs/mvebu_v7_defconfig b/arch/arm/configs/mvebu_v7_defconfig
index 7b713c083a2a..4e492afca076 100644
--- a/arch/arm/configs/mvebu_v7_defconfig
+++ b/arch/arm/configs/mvebu_v7_defconfig
@@ -101,6 +101,7 @@ CONFIG_SND_SIMPLE_CARD=y
 CONFIG_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_MVEBU=y
+CONFIG_USB_XHCI_PLATFORM=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_EHCI_ROOT_HUB_TT=y
 CONFIG_USB_STORAGE=y
diff --git a/arch/arm/configs/omap2plus_defconfig b/arch/arm/configs/omap2plus_defconfig
index d933b787d934..2eb85491be03 100644
--- a/arch/arm/configs/omap2plus_defconfig
+++ b/arch/arm/configs/omap2plus_defconfig
@@ -563,6 +563,7 @@ CONFIG_USB=m
 CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
 CONFIG_USB_MON=m
 CONFIG_USB_XHCI_HCD=m
+CONFIG_USB_XHCI_PLATFORM=m
 CONFIG_USB_EHCI_HCD=m
 CONFIG_USB_OHCI_HCD=m
 CONFIG_USB_ACM=m
diff --git a/arch/arm/configs/pxa_defconfig b/arch/arm/configs/pxa_defconfig
index 58f4834289e6..510406d6e7a5 100644
--- a/arch/arm/configs/pxa_defconfig
+++ b/arch/arm/configs/pxa_defconfig
@@ -523,6 +523,7 @@ CONFIG_USB=m
 CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
 CONFIG_USB_MON=m
 CONFIG_USB_XHCI_HCD=m
+CONFIG_USB_XHCI_PLATFORM=m
 CONFIG_USB_EHCI_HCD=m
 CONFIG_USB_EHCI_HCD_PLATFORM=m
 CONFIG_USB_ISP116X_HCD=m
-- 
2.34.0.rc1.387.gb447b232ab-goog


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v17 7/7] usb: Specify dependencies on USB_XHCI_PLATFORM with 'depends on'
  2021-11-16 20:07 [PATCH v17 0/7] usb: misc: Add onboard_usb_hub driver Matthias Kaehlcke
  2021-11-16 20:07 ` [PATCH v17 5/7] ARM: configs: Explicitly enable USB_XHCI_PLATFORM where needed Matthias Kaehlcke
@ 2021-11-16 20:07 ` Matthias Kaehlcke
  2021-11-17  2:21   ` Alan Stern
  2021-12-16 23:56   ` Matthias Kaehlcke
  1 sibling, 2 replies; 9+ messages in thread
From: Matthias Kaehlcke @ 2021-11-16 20:07 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Alan Stern, Rob Herring, Frank Rowand,
	Mathias Nyman, Felipe Balbi
  Cc: linux-kernel, Krzysztof Kozlowski, Stephen Boyd, Peter Chen,
	linux-usb, devicetree, Douglas Anderson, Roger Quadros,
	Michal Simek, Ravi Chandra Sadineni, Bastien Nocera,
	Matthias Kaehlcke, Andrew Lunn, Aswath Govindraju,
	Dmitry Osipenko, Gregory Clement, Krzysztof Kozlowski,
	Lukas Bulwahn, Pawel Laszczak, Sebastian Hesselbarth,
	Tony Lindgren, linux-arm-kernel, linux-omap, linux-samsung-soc

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@chromium.org>
Reviewed-by: Roger Quadros <rogerq@kernel.org>
Reviewed-by: Douglas Anderson <dianders@chromium.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

 drivers/usb/cdns3/Kconfig | 2 +-
 drivers/usb/dwc3/Kconfig  | 5 +++--
 drivers/usb/host/Kconfig  | 4 ++--
 3 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/usb/cdns3/Kconfig b/drivers/usb/cdns3/Kconfig
index b98ca0a1352a..07e12f786d48 100644
--- a/drivers/usb/cdns3/Kconfig
+++ b/drivers/usb/cdns3/Kconfig
@@ -1,7 +1,7 @@
 config USB_CDNS_SUPPORT
 	tristate "Cadence USB Support"
 	depends on USB_SUPPORT && (USB || USB_GADGET) && HAS_DMA
-	select USB_XHCI_PLATFORM if USB_XHCI_HCD
+	depends on !USB_XHCI_HCD || USB_XHCI_PLATFORM
 	select USB_ROLE_SWITCH
 	help
 	  Say Y here if your system has a Cadence USBSS or USBSSP
diff --git a/drivers/usb/dwc3/Kconfig b/drivers/usb/dwc3/Kconfig
index c483f28b695d..8f08b0724379 100644
--- a/drivers/usb/dwc3/Kconfig
+++ b/drivers/usb/dwc3/Kconfig
@@ -2,8 +2,7 @@
 
 config USB_DWC3
 	tristate "DesignWare USB3 DRD Core Support"
-	depends on (USB || USB_GADGET) && HAS_DMA
-	select USB_XHCI_PLATFORM if USB_XHCI_HCD
+	depends on (USB_XHCI_PLATFORM || USB_GADGET) && HAS_DMA
 	select USB_ROLE_SWITCH if USB_DWC3_DUAL_ROLE
 	help
 	  Say Y or M here if your system has a Dual Role SuperSpeed
@@ -30,6 +29,7 @@ choice
 config USB_DWC3_HOST
 	bool "Host only mode"
 	depends on USB=y || USB=USB_DWC3
+	depends on USB_XHCI_PLATFORM
 	help
 	  Select this when you want to use DWC3 in host mode only,
 	  thereby the gadget feature will be regressed.
@@ -44,6 +44,7 @@ config USB_DWC3_GADGET
 config USB_DWC3_DUAL_ROLE
 	bool "Dual Role mode"
 	depends on ((USB=y || USB=USB_DWC3) && (USB_GADGET=y || USB_GADGET=USB_DWC3))
+	depends on USB_XHCI_PLATFORM
 	depends on (EXTCON=y || EXTCON=USB_DWC3)
 	help
 	  This is the default mode of working of DWC3 controller where
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.
-- 
2.34.0.rc1.387.gb447b232ab-goog


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH v17 7/7] usb: Specify dependencies on USB_XHCI_PLATFORM with 'depends on'
  2021-11-16 20:07 ` [PATCH v17 7/7] usb: Specify dependencies on USB_XHCI_PLATFORM with 'depends on' Matthias Kaehlcke
@ 2021-11-17  2:21   ` Alan Stern
  2021-11-18 17:16     ` Matthias Kaehlcke
  2021-12-16 23:56   ` Matthias Kaehlcke
  1 sibling, 1 reply; 9+ messages in thread
From: Alan Stern @ 2021-11-17  2:21 UTC (permalink / raw)
  To: Matthias Kaehlcke
  Cc: Greg Kroah-Hartman, Rob Herring, Frank Rowand, Mathias Nyman,
	Felipe Balbi, linux-kernel, Krzysztof Kozlowski, Stephen Boyd,
	Peter Chen, linux-usb, devicetree, Douglas Anderson,
	Roger Quadros, Michal Simek, Ravi Chandra Sadineni,
	Bastien Nocera, Andrew Lunn, Aswath Govindraju, Dmitry Osipenko,
	Gregory Clement, Krzysztof Kozlowski, Lukas Bulwahn,
	Pawel Laszczak, Sebastian Hesselbarth, Tony Lindgren,
	linux-arm-kernel, linux-omap, linux-samsung-soc

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@chromium.org>
> Reviewed-by: Roger Quadros <rogerq@kernel.org>
> Reviewed-by: Douglas Anderson <dianders@chromium.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.

Alan Stern

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v17 7/7] usb: Specify dependencies on USB_XHCI_PLATFORM with 'depends on'
  2021-11-17  2:21   ` Alan Stern
@ 2021-11-18 17:16     ` Matthias Kaehlcke
  0 siblings, 0 replies; 9+ messages in thread
From: Matthias Kaehlcke @ 2021-11-18 17:16 UTC (permalink / raw)
  To: Alan Stern
  Cc: Greg Kroah-Hartman, Rob Herring, Frank Rowand, Mathias Nyman,
	Felipe Balbi, linux-kernel, Krzysztof Kozlowski, Stephen Boyd,
	Peter Chen, linux-usb, devicetree, Douglas Anderson,
	Roger Quadros, Michal Simek, Ravi Chandra Sadineni,
	Bastien Nocera, Andrew Lunn, Aswath Govindraju, Dmitry Osipenko,
	Gregory Clement, Krzysztof Kozlowski, Lukas Bulwahn,
	Pawel Laszczak, Sebastian Hesselbarth, Tony Lindgren,
	linux-arm-kernel, linux-omap, linux-samsung-soc

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@chromium.org>
> > Reviewed-by: Roger Quadros <rogerq@kernel.org>
> > Reviewed-by: Douglas Anderson <dianders@chromium.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.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v17 7/7] usb: Specify dependencies on USB_XHCI_PLATFORM with 'depends on'
  2021-11-16 20:07 ` [PATCH v17 7/7] usb: Specify dependencies on USB_XHCI_PLATFORM with 'depends on' Matthias Kaehlcke
  2021-11-17  2:21   ` Alan Stern
@ 2021-12-16 23:56   ` Matthias Kaehlcke
  2021-12-17  0:47     ` Dmitry Osipenko
  1 sibling, 1 reply; 9+ messages in thread
From: Matthias Kaehlcke @ 2021-12-16 23:56 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Alan Stern, Rob Herring, Frank Rowand,
	Mathias Nyman, Felipe Balbi
  Cc: linux-kernel, Krzysztof Kozlowski, Stephen Boyd, Peter Chen,
	linux-usb, devicetree, Douglas Anderson, Roger Quadros,
	Michal Simek, Ravi Chandra Sadineni, Bastien Nocera, Andrew Lunn,
	Aswath Govindraju, Dmitry Osipenko, Gregory Clement,
	Krzysztof Kozlowski, Lukas Bulwahn, Pawel Laszczak,
	Sebastian Hesselbarth, Tony Lindgren, linux-arm-kernel,
	linux-omap, linux-samsung-soc

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@chromium.org>
> Reviewed-by: Roger Quadros <rogerq@kernel.org>
> Reviewed-by: Douglas Anderson <dianders@chromium.org>

Note: This patch has been removed from the onboard_usb_hub series,
together with "ARM: configs: Explicitly enable USB_XHCI_PLATFORM
where needed" and "arm64: defconfig: Explicitly enable
USB_XHCI_PLATFORM". These patches aren't any longer needed for the
series. If maintainers think they are useful independently from
the series please pick them or let me know what needs to be
changed to get them landed.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v17 7/7] usb: Specify dependencies on USB_XHCI_PLATFORM with 'depends on'
  2021-12-16 23:56   ` Matthias Kaehlcke
@ 2021-12-17  0:47     ` Dmitry Osipenko
  2021-12-20 18:44       ` Matthias Kaehlcke
  0 siblings, 1 reply; 9+ messages in thread
From: Dmitry Osipenko @ 2021-12-17  0:47 UTC (permalink / raw)
  To: Matthias Kaehlcke, Greg Kroah-Hartman, Alan Stern, Rob Herring,
	Frank Rowand, Mathias Nyman, Felipe Balbi
  Cc: linux-kernel, Krzysztof Kozlowski, Stephen Boyd, Peter Chen,
	linux-usb, devicetree, Douglas Anderson, Roger Quadros,
	Michal Simek, Ravi Chandra Sadineni, Bastien Nocera, Andrew Lunn,
	Aswath Govindraju, Gregory Clement, Krzysztof Kozlowski,
	Lukas Bulwahn, Pawel Laszczak, Sebastian Hesselbarth,
	Tony Lindgren, linux-arm-kernel, linux-omap, linux-samsung-soc

17.12.2021 02:56, Matthias Kaehlcke пишет:
> 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@chromium.org>
>> Reviewed-by: Roger Quadros <rogerq@kernel.org>
>> Reviewed-by: Douglas Anderson <dianders@chromium.org>
> 
> Note: This patch has been removed from the onboard_usb_hub series,
> together with "ARM: configs: Explicitly enable USB_XHCI_PLATFORM
> where needed" and "arm64: defconfig: Explicitly enable
> USB_XHCI_PLATFORM". These patches aren't any longer needed for the
> series. If maintainers think they are useful independently from
> the series please pick them or let me know what needs to be
> changed to get them landed.
> 

Hi,

I don't know what this all is about, perhaps I'm CC'ed semi-randomly
because touched that Kconfig once.

All I can say here is that the commit message tells us "This is not
recommended" and doesn't explain what's the actual problem is being
solved. If there is no real problem, why bother?

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v17 7/7] usb: Specify dependencies on USB_XHCI_PLATFORM with 'depends on'
  2021-12-17  0:47     ` Dmitry Osipenko
@ 2021-12-20 18:44       ` Matthias Kaehlcke
  2021-12-20 19:59         ` Dmitry Osipenko
  0 siblings, 1 reply; 9+ messages in thread
From: Matthias Kaehlcke @ 2021-12-20 18:44 UTC (permalink / raw)
  To: Dmitry Osipenko
  Cc: Greg Kroah-Hartman, Alan Stern, Rob Herring, Frank Rowand,
	Mathias Nyman, Felipe Balbi, linux-kernel, Krzysztof Kozlowski,
	Stephen Boyd, Peter Chen, linux-usb, devicetree, Douglas Anderson,
	Roger Quadros, Michal Simek, Ravi Chandra Sadineni,
	Bastien Nocera, Andrew Lunn, Aswath Govindraju, Gregory Clement,
	Krzysztof Kozlowski, Lukas Bulwahn, Pawel Laszczak,
	Sebastian Hesselbarth, Tony Lindgren, linux-arm-kernel,
	linux-omap, linux-samsung-soc

On Fri, Dec 17, 2021 at 03:47:24AM +0300, Dmitry Osipenko wrote:
> 17.12.2021 02:56, Matthias Kaehlcke пишет:
> > 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@chromium.org>
> >> Reviewed-by: Roger Quadros <rogerq@kernel.org>
> >> Reviewed-by: Douglas Anderson <dianders@chromium.org>
> > 
> > Note: This patch has been removed from the onboard_usb_hub series,
> > together with "ARM: configs: Explicitly enable USB_XHCI_PLATFORM
> > where needed" and "arm64: defconfig: Explicitly enable
> > USB_XHCI_PLATFORM". These patches aren't any longer needed for the
> > series. If maintainers think they are useful independently from
> > the series please pick them or let me know what needs to be
> > changed to get them landed.
> > 
> 
> Hi,
> 
> I don't know what this all is about, perhaps I'm CC'ed semi-randomly
> because touched that Kconfig once.

Yes, it seems tools select you based on their heuristics because you
made changes to that file.

> All I can say here is that the commit message tells us "This is not
> recommended" and doesn't explain what's the actual problem is being
> solved. If there is no real problem, why bother?

Earlier versions of the onboard_usb_hub series [1] which had a dependency
involving USB_XHCI_PLATFORM had an issue with invalid (rand)configs
that was related with the 'selects'.

The series doesn't depend on USB_XHCI_PLATFORM any longer, hence the
original issue doesn't exist anymore, however it might re-surface in
the future.

Personally I have no vested interest at this point in getting the
config changes landed, I just wanted to make clear what the status
is (split off from the series, no future versions unless someone
requests them), rather than abandoning them silently.

[1]: https://patchwork.kernel.org/project/linux-usb/list/?series=531343

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v17 7/7] usb: Specify dependencies on USB_XHCI_PLATFORM with 'depends on'
  2021-12-20 18:44       ` Matthias Kaehlcke
@ 2021-12-20 19:59         ` Dmitry Osipenko
  0 siblings, 0 replies; 9+ messages in thread
From: Dmitry Osipenko @ 2021-12-20 19:59 UTC (permalink / raw)
  To: Matthias Kaehlcke
  Cc: Greg Kroah-Hartman, Alan Stern, Rob Herring, Frank Rowand,
	Mathias Nyman, Felipe Balbi, linux-kernel, Krzysztof Kozlowski,
	Stephen Boyd, Peter Chen, linux-usb, devicetree, Douglas Anderson,
	Roger Quadros, Michal Simek, Ravi Chandra Sadineni,
	Bastien Nocera, Andrew Lunn, Aswath Govindraju, Gregory Clement,
	Krzysztof Kozlowski, Lukas Bulwahn, Pawel Laszczak,
	Sebastian Hesselbarth, Tony Lindgren, linux-arm-kernel,
	linux-omap, linux-samsung-soc

20.12.2021 21:44, Matthias Kaehlcke пишет:
> On Fri, Dec 17, 2021 at 03:47:24AM +0300, Dmitry Osipenko wrote:
>> 17.12.2021 02:56, Matthias Kaehlcke пишет:
>>> 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@chromium.org>
>>>> Reviewed-by: Roger Quadros <rogerq@kernel.org>
>>>> Reviewed-by: Douglas Anderson <dianders@chromium.org>
>>>
>>> Note: This patch has been removed from the onboard_usb_hub series,
>>> together with "ARM: configs: Explicitly enable USB_XHCI_PLATFORM
>>> where needed" and "arm64: defconfig: Explicitly enable
>>> USB_XHCI_PLATFORM". These patches aren't any longer needed for the
>>> series. If maintainers think they are useful independently from
>>> the series please pick them or let me know what needs to be
>>> changed to get them landed.
>>>
>>
>> Hi,
>>
>> I don't know what this all is about, perhaps I'm CC'ed semi-randomly
>> because touched that Kconfig once.
> 
> Yes, it seems tools select you based on their heuristics because you
> made changes to that file.
> 
>> All I can say here is that the commit message tells us "This is not
>> recommended" and doesn't explain what's the actual problem is being
>> solved. If there is no real problem, why bother?
> 
> Earlier versions of the onboard_usb_hub series [1] which had a dependency
> involving USB_XHCI_PLATFORM had an issue with invalid (rand)configs
> that was related with the 'selects'.
> 
> The series doesn't depend on USB_XHCI_PLATFORM any longer, hence the
> original issue doesn't exist anymore, however it might re-surface in
> the future.
> 
> Personally I have no vested interest at this point in getting the
> config changes landed, I just wanted to make clear what the status
> is (split off from the series, no future versions unless someone
> requests them), rather than abandoning them silently.
> 
> [1]: https://patchwork.kernel.org/project/linux-usb/list/?series=531343
> 

My point is that you should always explain in a commit message what
problem is being solved and how it's solved. There is no explanation of
the problem in the commit of this patch. If there is no real problem and
patch is a minor improvement, then it also should be explained explicitly.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-12-20 19:59 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-16 20:07 [PATCH v17 0/7] usb: misc: Add onboard_usb_hub driver Matthias Kaehlcke
2021-11-16 20:07 ` [PATCH v17 5/7] ARM: configs: Explicitly enable USB_XHCI_PLATFORM where needed Matthias Kaehlcke
2021-11-16 20:07 ` [PATCH v17 7/7] usb: Specify dependencies on USB_XHCI_PLATFORM with 'depends on' Matthias Kaehlcke
2021-11-17  2:21   ` Alan Stern
2021-11-18 17:16     ` Matthias Kaehlcke
2021-12-16 23:56   ` Matthias Kaehlcke
2021-12-17  0:47     ` Dmitry Osipenko
2021-12-20 18:44       ` Matthias Kaehlcke
2021-12-20 19:59         ` Dmitry Osipenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox