Skip to content

Commit 5e0f8c9

Browse files
committed
usb: dwc3: apple: Do not use host-vbus-glitches workaround
It results in SErrors during init presumedly because MMIO accesses fail while certain parts are shutdown. Fixes: a6ba1e4 ("usb: dwc3: apply snps,host-vbus-glitches workaround unconditionally") Signed-off-by: Janne Grunau <j@jannau.net>
1 parent 0ebc0eb commit 5e0f8c9

3 files changed

Lines changed: 7 additions & 1 deletion

File tree

drivers/usb/dwc3/core.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2265,6 +2265,7 @@ static int dwc3_probe(struct platform_device *pdev)
22652265

22662266
dwc->dr_mode = USB_DR_MODE_OTG;
22672267
dwc->role_switch_reset_quirk = true;
2268+
dwc->no_early_roothub_poweroff = true;
22682269
}
22692270
}
22702271

drivers/usb/dwc3/core.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1154,6 +1154,7 @@ struct dwc3_scratchpad_array {
11541154
* @susphy_state: state of DWC3_GUSB2PHYCFG_SUSPHY + DWC3_GUSB3PIPECTL_SUSPHY
11551155
* before PM suspend.
11561156
* @role_switch_reset_quirk: set to force reinitialization after any role switch
1157+
* @no_early_roothub_poweroff: set to skip early root hub port power off
11571158
* @imod_interval: set the interrupt moderation interval in 250ns
11581159
* increments or 0 to disable.
11591160
* @max_cfg_eps: current max number of IN eps used across all USB configs.
@@ -1392,6 +1393,7 @@ struct dwc3 {
13921393
unsigned susphy_state:1;
13931394

13941395
unsigned role_switch_reset_quirk:1;
1396+
unsigned no_early_roothub_poweroff:1;
13951397

13961398
u16 imod_interval;
13971399

drivers/usb/dwc3/host.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,11 @@ int dwc3_host_init(struct dwc3 *dwc)
134134
/*
135135
* Some platforms need to power off all Root hub ports immediately after DWC3 set to host
136136
* mode to avoid VBUS glitch happen when xhci get reset later.
137+
* On Apple platforms we must not touch any MMIO yet because dwc3
138+
* will not work correctly before its PHY has been initialized.
137139
*/
138-
dwc3_power_off_all_roothub_ports(dwc);
140+
if (!dwc->no_early_roothub_poweroff)
141+
dwc3_power_off_all_roothub_ports(dwc);
139142

140143
irq = dwc3_host_get_irq(dwc);
141144
if (irq < 0)

0 commit comments

Comments
 (0)