Skip to content

Commit d899d4d

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 5e56626 commit d899d4d

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
@@ -2270,6 +2270,7 @@ int dwc3_core_probe(const struct dwc3_probe_data *data)
22702270

22712271
dwc->dr_mode = USB_DR_MODE_OTG;
22722272
dwc->role_switch_reset_quirk = true;
2273+
dwc->no_early_roothub_poweroff = true;
22732274
}
22742275
}
22752276

drivers/usb/dwc3/core.h

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

13961397
unsigned role_switch_reset_quirk:1;
1398+
unsigned no_early_roothub_poweroff:1;
13971399

13981400
u16 imod_interval;
13991401

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)