OpenCloudOS-Kernel/drivers/usb/dwc3
Ferry Toth 63130462c9 usb: dwc3: core: defer probe on ulpi_read_id timeout
Since commit 0f01017191 ("usb: dwc3: Don't switch OTG -> peripheral
if extcon is present"), Dual Role support on Intel Merrifield platform
broke due to rearranging the call to dwc3_get_extcon().

It appears to be caused by ulpi_read_id() masking the timeout on the first
test write. In the past dwc3 probe continued by calling dwc3_core_soft_reset()
followed by dwc3_get_extcon() which happend to return -EPROBE_DEFER.
On deferred probe ulpi_read_id() finally succeeded. Due to above mentioned
rearranging -EPROBE_DEFER is not returned and probe completes without phy.

On Intel Merrifield the timeout on the first test write issue is reproducible
but it is difficult to find the root cause. Using a mainline kernel and
rootfs with buildroot ulpi_read_id() succeeds. As soon as adding
ftrace / bootconfig to find out why, ulpi_read_id() fails and we can't
analyze the flow. Using another rootfs ulpi_read_id() fails even without
adding ftrace. We suspect the issue is some kind of timing / race, but
merely retrying ulpi_read_id() does not resolve the issue.

As we now changed ulpi_read_id() to return -ETIMEDOUT in this case, we
need to handle the error by calling dwc3_core_soft_reset() and request
-EPROBE_DEFER. On deferred probe ulpi_read_id() is retried and succeeds.

Fixes: ef6a7bcfb0 ("usb: ulpi: Support device discovery via DT")
Cc: stable@vger.kernel.org
Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Signed-off-by: Ferry Toth <ftoth@exalondelft.nl>
Link: https://lore.kernel.org/r/20221205201527.13525-3-ftoth@exalondelft.nl
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-12-08 16:48:07 +01:00
..
Kconfig usb: dwc3: improve the config dependency of USB_DWC3_XILINX 2022-11-22 17:30:21 +01:00
Makefile drivers: usb: dwc3: Add AM62 USB wrapper driver 2022-04-21 18:31:56 +02:00
core.c usb: dwc3: core: defer probe on ulpi_read_id timeout 2022-12-08 16:48:07 +01:00
core.h usb: dwc3: core: Enable GUCTL1 bit 10 for fixing termination error after resume bug 2022-09-22 15:52:30 +02:00
debug.h usb: dwc3: debug: show events parameters in hex 2022-08-19 11:03:52 +02:00
debugfs.c USB: dwc3: remove debugfs root dentry storage 2021-06-10 19:57:21 +02:00
drd.c usb: dwc3: Don't switch OTG -> peripheral if extcon is present 2022-10-22 12:29:43 +02:00
dwc3-am62.c usb: dwc3-am62: remove unnecesary clk_put() 2022-06-29 21:04:55 +02:00
dwc3-exynos.c usb: dwc3: exynos: Fix remove() function 2022-11-22 16:51:45 +01:00
dwc3-haps.c usb: dwc3: haps: Constify the software node 2021-02-04 15:42:06 +01:00
dwc3-imx8mp.c usb: dwc3: imx8mp: Add support for setting SOC specific flags 2022-03-15 15:37:11 +01:00
dwc3-keystone.c usb: dwc3: fix incorrect kernel-doc comment syntax in files 2021-04-02 15:20:51 +02:00
dwc3-meson-g12a.c usb: dwc3-meson-g12a: constify drvdata structs 2022-03-15 15:33:52 +01:00
dwc3-of-simple.c usb: dwc3: Add driver for Xilinx platforms 2021-03-23 12:48:14 +01:00
dwc3-omap.c usb: dwc3: omap: fix "unbalanced disables for smps10_out1" on omap5evm 2022-03-15 15:44:46 +01:00
dwc3-pci.c usb: dwc3: pci: Update PCIe device ID for USB3 controller on CPU sub-system for Raptor Lake 2022-11-29 08:56:09 +01:00
dwc3-qcom.c usb: dwc3: qcom: Fix memory leak in dwc3_qcom_interconnect_init 2022-12-08 16:43:34 +01:00
dwc3-st.c usb: dwc3: st: Rely on child's compatible instead of name 2022-10-25 19:06:13 +02:00
dwc3-xilinx.c usb: dwc3: xilinx: fix usb3 non-wakeup source resume failure 2022-09-22 15:52:30 +02:00
ep0.c usb: dwc3: Avoid unmapping USB requests if endxfer is not complete 2022-09-07 16:26:26 +02:00
gadget.c Merge 6.1-rc7 into usb-next 2022-11-28 17:56:10 +01:00
gadget.h usb: dwc3: Fix ep0 handling when getting reset while doing control transfer 2022-05-19 18:14:16 +02:00
host.c Revert "usb: dwc3: disable USB core PHY management" 2022-11-08 16:45:12 +01:00
io.h usb: dwc3: fix incorrect kernel-doc comment syntax in files 2021-04-02 15:20:51 +02:00
trace.c usb: dwc3: fix incorrect kernel-doc comment syntax in files 2021-04-02 15:20:51 +02:00
trace.h usb: dwc3: trace: add Start of Frame Number to trace event 2022-08-19 11:03:52 +02:00
ulpi.c usb: dwc3: ulpi: Fix USB2.0 HS/FS/LS PHY suspend regression 2020-12-28 15:55:44 +01:00