Skip to content

Commit aa7aced

Browse files
svenpeter42jannau
authored andcommitted
usb: dwc3: Use ioremap_np when required in dwc3_power_off_all_roothub_ports()
On Apple Silicon machines we can't use ioremap() / Device-nGnRE to map most regions but must use ioremap_np() / Device-nGnRnE whenever IORESOURCE_MEM_NONPOSTED is set. Make sure this is also done inside dwc3_power_off_all_roothub_ports to prevent SErrors. Fixes: 2d2a334 ("usb: dwc3: Add workaround for host mode VBUS glitch when boot") Signed-off-by: Sven Peter <sven@kernel.org>
1 parent 3b95e33 commit aa7aced

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

drivers/usb/dwc3/host.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,10 @@ static void dwc3_power_off_all_roothub_ports(struct dwc3 *dwc)
3737

3838
/* xhci regs are not mapped yet, do it temporarily here */
3939
if (dwc->xhci_resources[0].start) {
40-
xhci_regs = ioremap(dwc->xhci_resources[0].start, DWC3_XHCI_REGS_END);
40+
if (dwc->xhci_resources[0].flags & IORESOURCE_MEM_NONPOSTED)
41+
xhci_regs = ioremap_np(dwc->xhci_resources[0].start, DWC3_XHCI_REGS_END);
42+
else
43+
xhci_regs = ioremap(dwc->xhci_resources[0].start, DWC3_XHCI_REGS_END);
4144
if (!xhci_regs) {
4245
dev_err(dwc->dev, "Failed to ioremap xhci_regs\n");
4346
return;

0 commit comments

Comments
 (0)