All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] usb: Probe EHCI, OHCI controllers asynchronously
@ 2022-05-18 22:02 Brian Norris
  2022-05-19  0:41 ` Alan Stern
  2022-05-20 22:43 ` Doug Anderson
  0 siblings, 2 replies; 3+ messages in thread
From: Brian Norris @ 2022-05-18 22:02 UTC (permalink / raw)
  To: Alan Stern, Greg Kroah-Hartman
  Cc: linux-kernel, Dmitry Torokhov, linux-usb, Doug Anderson, Brian Norris

From: Dmitry Torokhov <dtor@chromium.org>

initcall_debug shows that OHCI controllers take ~60ms to probe on
Rockchip RK3399 systems:

  probe of fe3a0000.usb returned 1 after 58941 usecs

A few of these can add up to waste non-trivial amounts of time at boot.

These host controllers don't provide resources to other drivers, so
this shouldn't contribute to exposing race conditions.

Chrome OS kernels have carried this patch on some systems for a while
without issues. Similar patches have been merged for a variety of (e)MMC
host controllers for similar reasons.

Signed-off-by: Dmitry Torokhov <dtor@chromium.org>
[Brian: rewrote commit message, refreshed, but retained dtor's original
 authorship ]
Signed-off-by: Brian Norris <briannorris@chromium.org>
---

 drivers/usb/host/ehci-platform.c | 1 +
 drivers/usb/host/ohci-platform.c | 1 +
 2 files changed, 2 insertions(+)

diff --git a/drivers/usb/host/ehci-platform.c b/drivers/usb/host/ehci-platform.c
index 1115431a255d..f343967443e2 100644
--- a/drivers/usb/host/ehci-platform.c
+++ b/drivers/usb/host/ehci-platform.c
@@ -518,6 +518,7 @@ static struct platform_driver ehci_platform_driver = {
 		.pm	= pm_ptr(&ehci_platform_pm_ops),
 		.of_match_table = vt8500_ehci_ids,
 		.acpi_match_table = ACPI_PTR(ehci_acpi_match),
+		.probe_type = PROBE_PREFER_ASYNCHRONOUS,
 	}
 };
 
diff --git a/drivers/usb/host/ohci-platform.c b/drivers/usb/host/ohci-platform.c
index 4a8456f12a73..47dfbfe9e519 100644
--- a/drivers/usb/host/ohci-platform.c
+++ b/drivers/usb/host/ohci-platform.c
@@ -334,6 +334,7 @@ static struct platform_driver ohci_platform_driver = {
 		.name	= "ohci-platform",
 		.pm	= &ohci_platform_pm_ops,
 		.of_match_table = ohci_platform_ids,
+		.probe_type = PROBE_PREFER_ASYNCHRONOUS,
 	}
 };
 
-- 
2.36.1.124.g0e6072fb45-goog


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

* Re: [PATCH] usb: Probe EHCI, OHCI controllers asynchronously
  2022-05-18 22:02 [PATCH] usb: Probe EHCI, OHCI controllers asynchronously Brian Norris
@ 2022-05-19  0:41 ` Alan Stern
  2022-05-20 22:43 ` Doug Anderson
  1 sibling, 0 replies; 3+ messages in thread
From: Alan Stern @ 2022-05-19  0:41 UTC (permalink / raw)
  To: Brian Norris
  Cc: Greg Kroah-Hartman, linux-kernel, Dmitry Torokhov, linux-usb,
	Doug Anderson

On Wed, May 18, 2022 at 03:02:51PM -0700, Brian Norris wrote:
> From: Dmitry Torokhov <dtor@chromium.org>
> 
> initcall_debug shows that OHCI controllers take ~60ms to probe on
> Rockchip RK3399 systems:
> 
>   probe of fe3a0000.usb returned 1 after 58941 usecs
> 
> A few of these can add up to waste non-trivial amounts of time at boot.
> 
> These host controllers don't provide resources to other drivers, so
> this shouldn't contribute to exposing race conditions.
> 
> Chrome OS kernels have carried this patch on some systems for a while
> without issues. Similar patches have been merged for a variety of (e)MMC
> host controllers for similar reasons.
> 
> Signed-off-by: Dmitry Torokhov <dtor@chromium.org>
> [Brian: rewrote commit message, refreshed, but retained dtor's original
>  authorship ]
> Signed-off-by: Brian Norris <briannorris@chromium.org>
> ---

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

>  drivers/usb/host/ehci-platform.c | 1 +
>  drivers/usb/host/ohci-platform.c | 1 +
>  2 files changed, 2 insertions(+)
> 
> diff --git a/drivers/usb/host/ehci-platform.c b/drivers/usb/host/ehci-platform.c
> index 1115431a255d..f343967443e2 100644
> --- a/drivers/usb/host/ehci-platform.c
> +++ b/drivers/usb/host/ehci-platform.c
> @@ -518,6 +518,7 @@ static struct platform_driver ehci_platform_driver = {
>  		.pm	= pm_ptr(&ehci_platform_pm_ops),
>  		.of_match_table = vt8500_ehci_ids,
>  		.acpi_match_table = ACPI_PTR(ehci_acpi_match),
> +		.probe_type = PROBE_PREFER_ASYNCHRONOUS,
>  	}
>  };
>  
> diff --git a/drivers/usb/host/ohci-platform.c b/drivers/usb/host/ohci-platform.c
> index 4a8456f12a73..47dfbfe9e519 100644
> --- a/drivers/usb/host/ohci-platform.c
> +++ b/drivers/usb/host/ohci-platform.c
> @@ -334,6 +334,7 @@ static struct platform_driver ohci_platform_driver = {
>  		.name	= "ohci-platform",
>  		.pm	= &ohci_platform_pm_ops,
>  		.of_match_table = ohci_platform_ids,
> +		.probe_type = PROBE_PREFER_ASYNCHRONOUS,
>  	}
>  };
>  
> -- 
> 2.36.1.124.g0e6072fb45-goog
> 

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

* Re: [PATCH] usb: Probe EHCI, OHCI controllers asynchronously
  2022-05-18 22:02 [PATCH] usb: Probe EHCI, OHCI controllers asynchronously Brian Norris
  2022-05-19  0:41 ` Alan Stern
@ 2022-05-20 22:43 ` Doug Anderson
  1 sibling, 0 replies; 3+ messages in thread
From: Doug Anderson @ 2022-05-20 22:43 UTC (permalink / raw)
  To: Brian Norris
  Cc: Alan Stern, Greg Kroah-Hartman, LKML, Dmitry Torokhov, Linux USB List

Hi,

On Wed, May 18, 2022 at 3:04 PM Brian Norris <briannorris@chromium.org> wrote:
>
> From: Dmitry Torokhov <dtor@chromium.org>
>
> initcall_debug shows that OHCI controllers take ~60ms to probe on
> Rockchip RK3399 systems:
>
>   probe of fe3a0000.usb returned 1 after 58941 usecs
>
> A few of these can add up to waste non-trivial amounts of time at boot.
>
> These host controllers don't provide resources to other drivers, so
> this shouldn't contribute to exposing race conditions.
>
> Chrome OS kernels have carried this patch on some systems for a while
> without issues. Similar patches have been merged for a variety of (e)MMC
> host controllers for similar reasons.
>
> Signed-off-by: Dmitry Torokhov <dtor@chromium.org>
> [Brian: rewrote commit message, refreshed, but retained dtor's original
>  authorship ]
> Signed-off-by: Brian Norris <briannorris@chromium.org>
> ---
>
>  drivers/usb/host/ehci-platform.c | 1 +
>  drivers/usb/host/ohci-platform.c | 1 +
>  2 files changed, 2 insertions(+)

Reviewed-by: Douglas Anderson <dianders@chromium.org>

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

end of thread, other threads:[~2022-05-20 22:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-18 22:02 [PATCH] usb: Probe EHCI, OHCI controllers asynchronously Brian Norris
2022-05-19  0:41 ` Alan Stern
2022-05-20 22:43 ` Doug Anderson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.