All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jernej Škrabec" <jernej.skrabec@gmail.com>
To: Tom Rini <trini@konsulko.com>
Cc: marek.vasut+usb@mailbox.org, u-boot@lists.u-boot-project.org
Subject: Re: [PATCH] usb: host: ohci/ehci: halt the controller before booting an OS
Date: Thu, 12 Nov 2026 19:39:35 +0100	[thread overview]
Message-ID: <dyaPjPzbR86eIzIO25L6WA@gmail.com> (raw)
In-Reply-To: <20261112183546.GG554944@bill-the-cat>

Dne četrtek, 12. november 2026 ob 19:35:46 Srednjeevropski standardni čas je Tom Rini napisal(a):
> On Thu, Nov 12, 2026 at 07:28:38PM +0100, 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_OS_PREPARE so remove hook stops
> > both controllers during OS boot.
> > 
> > Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
> > ---
> >  drivers/usb/host/ehci-generic.c | 2 +-
> >  drivers/usb/host/ohci-generic.c | 2 +-
> 
> I think per:
> commit d610f703f937ebf7681e5cc36905586666e7ceb8
> Author: Jacob Procee <sn125164@gmail.com>
> Date:   Thu Oct 22 18:58:08 2026 +0200
> 
>     usb: xhci-dwc3: Add DM_FLAG_ACTIVE_DMA flag
>     
>     xhci-dwc3 is not removed before U-Boot hands over to the OS, so the
>     controller keeps running after ExitBootServices or bootm. If a device
>     was enumerated by "usb start" (for example by the default preboot
>     command for USB keyboards), the controller keeps polling it.
>     
>     On Apple Silicon machines (tested on a MacBook Pro M1 Pro, J314s), a
>     USB device that is connected while U-Boot runs is then not detected by
>     Linux until it is unplugged and plugged back in. Running "usb stop"
>     before booting avoids this.
>     
>     Add DM_FLAG_ACTIVE_DMA so the controller is removed, and its DMA
>     stopped, before the handover.
>     
>     Signed-off-by: Jacob Procee <sn125164@gmail.com>
>     Reviewed-by: Marek Vasut <marek.vasut+usb@mailbox.org>
> 
> We're preferring to use DM_FLAG_ACTIVE_DMA here instead.

Ok, no problem. Should I respin it now or do you prefer to wait to
potential other comments on it?

Best regards,
Jernej




  reply	other threads:[~2026-11-12 18:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-12 18:28 [PATCH] usb: host: ohci/ehci: halt the controller before booting an OS Jernej Skrabec
2026-11-12 18:35 ` Tom Rini
2026-11-12 18:39   ` Jernej Škrabec [this message]
2026-11-12 18:41     ` Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=dyaPjPzbR86eIzIO25L6WA@gmail.com \
    --to=jernej.skrabec@gmail.com \
    --cc=marek.vasut+usb@mailbox.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.u-boot-project.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.