Commit 5ed9cc71 authored by Sven Peter's avatar Sven Peter Committed by Greg Kroah-Hartman
Browse files

usb: dwc3: dwc3_power_off_all_roothub_ports: Use ioremap_np when required



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: 2d2a3349 ("usb: dwc3: Add workaround for host mode VBUS glitch when boot")
Cc: stable@kernel.org
Acked-by: default avatarThinh Nguyen <Thinh.Nguyen@synopsys.com>
Reviewed-by: default avatarNeal Gompa <neal@gompa.dev>
Signed-off-by: default avatarSven Peter <sven@kernel.org>
Link: https://patch.msgid.link/20251015-b4-aplpe-dwc3-v2-2-cbd65a2d511a@kernel.org


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 71e13cc1
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -37,6 +37,9 @@ static void dwc3_power_off_all_roothub_ports(struct dwc3 *dwc)

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