[PATCH] USB: OHCI/UHCI: Add soft dependencies on ehci_platform

Huacai Chen posted 1 patch 3 weeks, 6 days ago
drivers/usb/host/ohci-platform.c | 1 +
drivers/usb/host/uhci-platform.c | 1 +
2 files changed, 2 insertions(+)
[PATCH] USB: OHCI/UHCI: Add soft dependencies on ehci_platform
Posted by Huacai Chen 3 weeks, 6 days ago
Commit 9beeee6584b9aa4f ("USB: EHCI: log a warning if ehci-hcd is not
loaded first") said that ehci-hcd should be loaded before ohci-hcd and
uhci-hcd. However, commit 05c92da0c52494ca ("usb: ohci/uhci - add soft
dependencies on ehci_pci") only makes ohci-pci/uhci-pci depend on ehci-
pci, which is not enough and we may still see the warnings in boot log.

To eliminate the warnings we should make ohci-hcd/uhci-hcd depend on
ehci-hcd. But Alan said that the warning introduced by 9beeee6584b9aa4f
is bogus, we only need the soft dependencies in the PCI level rather
than the HCD level.

However, there is really another neccessary soft dependencies between
ohci-platform/uhci-platform and ehci-platform, which is added by this
patch. The boot logs are below.

1. ohci-platform loaded before ehci-platform:

 ohci-platform 1f058000.usb: Generic Platform OHCI controller
 ohci-platform 1f058000.usb: new USB bus registered, assigned bus number 1
 ohci-platform 1f058000.usb: irq 28, io mem 0x1f058000
 hub 1-0:1.0: USB hub found
 hub 1-0:1.0: 4 ports detected
 Warning! ehci_hcd should always be loaded before uhci_hcd and ohci_hcd, not after
 usb 1-4: new low-speed USB device number 2 using ohci-platform
 ehci-platform 1f050000.usb: EHCI Host Controller
 ehci-platform 1f050000.usb: new USB bus registered, assigned bus number 2
 ehci-platform 1f050000.usb: irq 29, io mem 0x1f050000
 ehci-platform 1f050000.usb: USB 2.0 started, EHCI 1.00
 usb 1-4: device descriptor read/all, error -62
 hub 2-0:1.0: USB hub found
 hub 2-0:1.0: 4 ports detected
 usb 1-4: new low-speed USB device number 3 using ohci-platform
 input: YSPRINGTECH USB OPTICAL MOUSE as /devices/platform/bus@10000000/1f058000.usb/usb1/1-4/1-4:1.0/0003:10C4:8105.0001/input/input0
 hid-generic 0003:10C4:8105.0001: input,hidraw0: USB HID v1.11 Mouse [YSPRINGTECH USB OPTICAL MOUSE] on usb-1f058000.usb-4/input0

2. ehci-platform loaded before ohci-platform:

 ehci-platform 1f050000.usb: EHCI Host Controller
 ehci-platform 1f050000.usb: new USB bus registered, assigned bus number 1
 ehci-platform 1f050000.usb: irq 28, io mem 0x1f050000
 ehci-platform 1f050000.usb: USB 2.0 started, EHCI 1.00
 hub 1-0:1.0: USB hub found
 hub 1-0:1.0: 4 ports detected
 ohci-platform 1f058000.usb: Generic Platform OHCI controller
 ohci-platform 1f058000.usb: new USB bus registered, assigned bus number 2
 ohci-platform 1f058000.usb: irq 29, io mem 0x1f058000
 hub 2-0:1.0: USB hub found
 hub 2-0:1.0: 4 ports detected
 usb 2-4: new low-speed USB device number 2 using ohci-platform
 input: YSPRINGTECH USB OPTICAL MOUSE as /devices/platform/bus@10000000/1f058000.usb/usb2/2-4/2-4:1.0/0003:10C4:8105.0001/input/input0
 hid-generic 0003:10C4:8105.0001: input,hidraw0: USB HID v1.11 Mouse [YSPRINGTECH USB OPTICAL MOUSE] on usb-1f058000.usb-4/input0

In the later case, there is no re-connection for USB-1.0/1.1 devices,
which is expected.

Cc: stable@vger.kernel.org
Reported-by: Shengwen Xiao <atzlinux@sina.com>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
---
 drivers/usb/host/ohci-platform.c | 1 +
 drivers/usb/host/uhci-platform.c | 1 +
 2 files changed, 2 insertions(+)

diff --git a/drivers/usb/host/ohci-platform.c b/drivers/usb/host/ohci-platform.c
index 2e4bb5cc2165..c801527d5bd2 100644
--- a/drivers/usb/host/ohci-platform.c
+++ b/drivers/usb/host/ohci-platform.c
@@ -392,3 +392,4 @@ MODULE_DESCRIPTION(DRIVER_DESC);
 MODULE_AUTHOR("Hauke Mehrtens");
 MODULE_AUTHOR("Alan Stern");
 MODULE_LICENSE("GPL");
+MODULE_SOFTDEP("pre: ehci_platform");
diff --git a/drivers/usb/host/uhci-platform.c b/drivers/usb/host/uhci-platform.c
index 5e02f2ceafb6..f4419d4526c4 100644
--- a/drivers/usb/host/uhci-platform.c
+++ b/drivers/usb/host/uhci-platform.c
@@ -211,3 +211,4 @@ static struct platform_driver uhci_platform_driver = {
 		.of_match_table = platform_uhci_ids,
 	},
 };
+MODULE_SOFTDEP("pre: ehci_platform");
-- 
2.47.3
Re: [PATCH] USB: OHCI/UHCI: Add soft dependencies on ehci_platform
Posted by Alan Stern 3 weeks, 6 days ago
On Mon, Jan 12, 2026 at 04:48:02PM +0800, Huacai Chen wrote:
> Commit 9beeee6584b9aa4f ("USB: EHCI: log a warning if ehci-hcd is not
> loaded first") said that ehci-hcd should be loaded before ohci-hcd and
> uhci-hcd. However, commit 05c92da0c52494ca ("usb: ohci/uhci - add soft
> dependencies on ehci_pci") only makes ohci-pci/uhci-pci depend on ehci-
> pci, which is not enough and we may still see the warnings in boot log.
> 
> To eliminate the warnings we should make ohci-hcd/uhci-hcd depend on
> ehci-hcd. But Alan said that the warning introduced by 9beeee6584b9aa4f
> is bogus, we only need the soft dependencies in the PCI level rather
> than the HCD level.
> 
> However, there is really another neccessary soft dependencies between
> ohci-platform/uhci-platform and ehci-platform, which is added by this
> patch. The boot logs are below.
> 
> 1. ohci-platform loaded before ehci-platform:
> 
>  ohci-platform 1f058000.usb: Generic Platform OHCI controller
>  ohci-platform 1f058000.usb: new USB bus registered, assigned bus number 1
>  ohci-platform 1f058000.usb: irq 28, io mem 0x1f058000
>  hub 1-0:1.0: USB hub found
>  hub 1-0:1.0: 4 ports detected
>  Warning! ehci_hcd should always be loaded before uhci_hcd and ohci_hcd, not after
>  usb 1-4: new low-speed USB device number 2 using ohci-platform
>  ehci-platform 1f050000.usb: EHCI Host Controller
>  ehci-platform 1f050000.usb: new USB bus registered, assigned bus number 2
>  ehci-platform 1f050000.usb: irq 29, io mem 0x1f050000
>  ehci-platform 1f050000.usb: USB 2.0 started, EHCI 1.00
>  usb 1-4: device descriptor read/all, error -62
>  hub 2-0:1.0: USB hub found
>  hub 2-0:1.0: 4 ports detected
>  usb 1-4: new low-speed USB device number 3 using ohci-platform
>  input: YSPRINGTECH USB OPTICAL MOUSE as /devices/platform/bus@10000000/1f058000.usb/usb1/1-4/1-4:1.0/0003:10C4:8105.0001/input/input0
>  hid-generic 0003:10C4:8105.0001: input,hidraw0: USB HID v1.11 Mouse [YSPRINGTECH USB OPTICAL MOUSE] on usb-1f058000.usb-4/input0
> 
> 2. ehci-platform loaded before ohci-platform:
> 
>  ehci-platform 1f050000.usb: EHCI Host Controller
>  ehci-platform 1f050000.usb: new USB bus registered, assigned bus number 1
>  ehci-platform 1f050000.usb: irq 28, io mem 0x1f050000
>  ehci-platform 1f050000.usb: USB 2.0 started, EHCI 1.00
>  hub 1-0:1.0: USB hub found
>  hub 1-0:1.0: 4 ports detected
>  ohci-platform 1f058000.usb: Generic Platform OHCI controller
>  ohci-platform 1f058000.usb: new USB bus registered, assigned bus number 2
>  ohci-platform 1f058000.usb: irq 29, io mem 0x1f058000
>  hub 2-0:1.0: USB hub found
>  hub 2-0:1.0: 4 ports detected
>  usb 2-4: new low-speed USB device number 2 using ohci-platform
>  input: YSPRINGTECH USB OPTICAL MOUSE as /devices/platform/bus@10000000/1f058000.usb/usb2/2-4/2-4:1.0/0003:10C4:8105.0001/input/input0
>  hid-generic 0003:10C4:8105.0001: input,hidraw0: USB HID v1.11 Mouse [YSPRINGTECH USB OPTICAL MOUSE] on usb-1f058000.usb-4/input0
> 
> In the later case, there is no re-connection for USB-1.0/1.1 devices,
> which is expected.
> 
> Cc: stable@vger.kernel.org
> Reported-by: Shengwen Xiao <atzlinux@sina.com>
> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
> ---

Reviewed-by: Alan Stern <stern@rowland.harvard.edu>

>  drivers/usb/host/ohci-platform.c | 1 +
>  drivers/usb/host/uhci-platform.c | 1 +
>  2 files changed, 2 insertions(+)
> 
> diff --git a/drivers/usb/host/ohci-platform.c b/drivers/usb/host/ohci-platform.c
> index 2e4bb5cc2165..c801527d5bd2 100644
> --- a/drivers/usb/host/ohci-platform.c
> +++ b/drivers/usb/host/ohci-platform.c
> @@ -392,3 +392,4 @@ MODULE_DESCRIPTION(DRIVER_DESC);
>  MODULE_AUTHOR("Hauke Mehrtens");
>  MODULE_AUTHOR("Alan Stern");
>  MODULE_LICENSE("GPL");
> +MODULE_SOFTDEP("pre: ehci_platform");
> diff --git a/drivers/usb/host/uhci-platform.c b/drivers/usb/host/uhci-platform.c
> index 5e02f2ceafb6..f4419d4526c4 100644
> --- a/drivers/usb/host/uhci-platform.c
> +++ b/drivers/usb/host/uhci-platform.c
> @@ -211,3 +211,4 @@ static struct platform_driver uhci_platform_driver = {
>  		.of_match_table = platform_uhci_ids,
>  	},
>  };
> +MODULE_SOFTDEP("pre: ehci_platform");
> -- 
> 2.47.3
>