* [PATCH v2] usb: host: ohci/ehci: halt the controller before booting an OS
@ 2026-11-16 15:53 Jernej Skrabec
2026-11-16 17:54 ` Marek Vasut
0 siblings, 1 reply; 3+ messages in thread
From: Jernej Skrabec @ 2026-11-16 15:53 UTC (permalink / raw)
To: marek.vasut+usb; +Cc: trini, u-boot, Jernej Skrabec
Currently, OHCI is not stopped before OS starts booting. This means HCCA
is still being written into during OS boot. This may cause all sorts of
random and hard to catch errors, if same area is being used for some
other needs.
Mark OHCI and EHCI drivers with DM_FLAG_ACTIVE_DMA so remove hook stops
both controllers before handing over to the OS, same as xhci-dwc3.
Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
---
Changes in v2:
- use DM_FLAG_ACTIVE_DMA instead of DM_FLAG_OS_PREPARE (Tom)
v1: https://lore.kernel.org/u-boot/20261112182838.2792025-1-jernej.skrabec@gmail.com/
drivers/usb/host/ehci-generic.c | 2 +-
drivers/usb/host/ohci-generic.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/host/ehci-generic.c b/drivers/usb/host/ehci-generic.c
index 1ae3619ce25d..f5dd6e855be0 100644
--- a/drivers/usb/host/ehci-generic.c
+++ b/drivers/usb/host/ehci-generic.c
@@ -167,5 +167,5 @@ U_BOOT_DRIVER(ehci_generic) = {
.remove = ehci_usb_remove,
.ops = &ehci_usb_ops,
.priv_auto = sizeof(struct generic_ehci),
- .flags = DM_FLAG_ALLOC_PRIV_DMA,
+ .flags = DM_FLAG_ACTIVE_DMA | DM_FLAG_ALLOC_PRIV_DMA,
};
diff --git a/drivers/usb/host/ohci-generic.c b/drivers/usb/host/ohci-generic.c
index cc44226f5e0b..b7b2a4eb4891 100644
--- a/drivers/usb/host/ohci-generic.c
+++ b/drivers/usb/host/ohci-generic.c
@@ -110,5 +110,5 @@ U_BOOT_DRIVER(ohci_generic) = {
.remove = ohci_usb_remove,
.ops = &ohci_usb_ops,
.priv_auto = sizeof(struct generic_ohci),
- .flags = DM_FLAG_ALLOC_PRIV_DMA,
+ .flags = DM_FLAG_ACTIVE_DMA | DM_FLAG_ALLOC_PRIV_DMA,
};
--
2.43.0
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH v2] usb: host: ohci/ehci: halt the controller before booting an OS
2026-11-16 15:53 [PATCH v2] usb: host: ohci/ehci: halt the controller before booting an OS Jernej Skrabec
@ 2026-11-16 17:54 ` Marek Vasut
2026-11-16 20:45 ` Jernej Škrabec
0 siblings, 1 reply; 3+ messages in thread
From: Marek Vasut @ 2026-11-16 17:54 UTC (permalink / raw)
To: Jernej Skrabec, marek.vasut+usb; +Cc: trini, u-boot
On 11/16/26 4:53 PM, Jernej Skrabec wrote:
> Currently, OHCI is not stopped before OS starts booting. This means HCCA
> is still being written into during OS boot. This may cause all sorts of
> random and hard to catch errors, if same area is being used for some
> other needs.
>
> Mark OHCI and EHCI drivers with DM_FLAG_ACTIVE_DMA so remove hook stops
> both controllers before handing over to the OS, same as xhci-dwc3.
>
> Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
This just landed in u-boot/main f8ae7682494c ("usb: stop generic OHCI
and EHCI at OS handoff"), is this implementation any different ? Can you
please have a look ? Thank you !
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH v2] usb: host: ohci/ehci: halt the controller before booting an OS
2026-11-16 17:54 ` Marek Vasut
@ 2026-11-16 20:45 ` Jernej Škrabec
0 siblings, 0 replies; 3+ messages in thread
From: Jernej Škrabec @ 2026-11-16 20:45 UTC (permalink / raw)
To: marek.vasut+usb, Marek Vasut; +Cc: trini, u-boot
Dne ponedeljek, 16. november 2026 ob 18:54:05 Srednjeevropski standardni čas je Marek Vasut napisal(a):
> On 11/16/26 4:53 PM, Jernej Skrabec wrote:
> > Currently, OHCI is not stopped before OS starts booting. This means HCCA
> > is still being written into during OS boot. This may cause all sorts of
> > random and hard to catch errors, if same area is being used for some
> > other needs.
> >
> > Mark OHCI and EHCI drivers with DM_FLAG_ACTIVE_DMA so remove hook stops
> > both controllers before handing over to the OS, same as xhci-dwc3.
> >
> > Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
> This just landed in u-boot/main f8ae7682494c ("usb: stop generic OHCI
> and EHCI at OS handoff"), is this implementation any different ? Can you
> please have a look ? Thank you !
>
That one is same as mine. You can disregard mine.
Best regards,
Jernej
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-11-16 20:45 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-16 15:53 [PATCH v2] usb: host: ohci/ehci: halt the controller before booting an OS Jernej Skrabec
2026-11-16 17:54 ` Marek Vasut
2026-11-16 20:45 ` Jernej Škrabec
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.