Skip to content

Commit 8404a1b

Browse files
svenpeter42gregkh
authored andcommitted
usb: dwc3: dwc3_power_off_all_roothub_ports: Use ioremap_np when required
commit 5ed9cc7 upstream. 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") Cc: stable@kernel.org Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com> Reviewed-by: Neal Gompa <neal@gompa.dev> Signed-off-by: Sven Peter <sven@kernel.org> Link: https://patch.msgid.link/20251015-b4-aplpe-dwc3-v2-2-cbd65a2d511a@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 6c36af8 commit 8404a1b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

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 is not mapped yet, do it temperary 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)