Skip to contentSkip to conversation

usb: dwc3-generic: Fix ref clock enable error check

PATCH Marek Vasut 2 participants 2 messages Sep 28 – Sep 29 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Marek Vasut

author Reviewed-by
#1 lore raw
Quoted 17 lines · Jonas Karlman

The commit 84de44e5e71e ("usb: dwc3-generic: fix ref clock lookup indexing wrong clk_bulk array") introduced a clk_enable() call for the ref clock.

However, clk_enable() may return -ENOSYS when a clock driver does not implement the .enable ops, i.e., for most Rockchip SoCs where most/all clocks typically are un-gated out of system reset.

The new clk_enable() call may cause USB to fail on such platforms, e.g.:

=> ums mmc 0
UMS: LUN 0, dev mmc 0, hwpart 0, sector 0x0, count 0x3a3e000 dwc3-generic-peripheral usb@fcc00000: failed to enable ref clock: -38 dwc3-generic-peripheral usb@fcc00000: failed to enable ref clock: -38 No USB device found
Couldn't init USB controller.

Quoted 5 lines

Ignore -ENOSYS errors from clk_enable() to restore DWC3 to a working state on affected platforms.

Fixes 84de44e5e71e ("usb: dwc3-generic: fix ref clock lookup indexing wrong clk_bulk array")

Tom, can you please pick this directly into main ?

Thank you!

#2 lore raw
In reply to a message not in the archive
Quoted 17 lines · Jonas Karlman

The commit 84de44e5e71e ("usb: dwc3-generic: fix ref clock lookup indexing wrong clk_bulk array") introduced a clk_enable() call for the ref clock.

However, clk_enable() may return -ENOSYS when a clock driver does not implement the .enable ops, i.e., for most Rockchip SoCs where most/all clocks typically are un-gated out of system reset.

The new clk_enable() call may cause USB to fail on such platforms, e.g.:

=> ums mmc 0
UMS: LUN 0, dev mmc 0, hwpart 0, sector 0x0, count 0x3a3e000 dwc3-generic-peripheral usb@fcc00000: failed to enable ref clock: -38 dwc3-generic-peripheral usb@fcc00000: failed to enable ref clock: -38 No USB device found
Couldn't init USB controller.

Quoted 6 lines

Ignore -ENOSYS errors from clk_enable() to restore DWC3 to a working state on affected platforms.

Fixes 84de44e5e71e ("usb: dwc3-generic: fix ref clock lookup indexing wrong clk_bulk array")

Applied to u-boot/main, thanks!

Signature · 1 line
Tom