usb: xhci-dwc3: Add DM_FLAG_ACTIVE_DMA flag
Subsystems (2)
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH v2 1/1 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.
---
Changes in v2:
- Use DM_FLAG_ACTIVE_DMA instead of DM_FLAG_OS_PREPARE (Marek)
drivers/usb/host/xhci-dwc3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/host/xhci-dwc3.c +1 -1
@@ -256,6 +256,6 @@ U_BOOT_DRIVER(xhci_dwc3) = { .ops = &xhci_usb_ops, .priv_auto = sizeof(struct xhci_ctrl), .plat_auto = sizeof(struct xhci_dwc3_plat), - .flags = DM_FLAG_ALLOC_PRIV_DMA, + .flags = DM_FLAG_ACTIVE_DMA | DM_FLAG_ALLOC_PRIV_DMA, };#endif
Signature · 1 line
2.56.0
Quoted 10 lines · Jacob Procee
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.
Quoted 4 lines
Add
DM_FLAG_ACTIVE_DMAso the controller is removed, and its DMA stopped, before the handover.Signed-off-by Jacob Procee <[email protected]>