Skip to content

Commit 85b768b

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 e535b3c commit 85b768b

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
@@ -2218,6 +2218,7 @@ static int dwc3_probe(struct platform_device *pdev)
22182218

22192219
dwc->dr_mode = USB_DR_MODE_OTG;
22202220
dwc->role_switch_reset_quirk = true;
2221+
dwc->no_early_roothub_poweroff = true;
22212222
}
22222223
}
22232224

drivers/usb/dwc3/core.h

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

13901391
unsigned role_switch_reset_quirk:1;
1392+
unsigned no_early_roothub_poweroff:1;
13911393

13921394
u16 imod_interval;
13931395

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)