OpenCloudOS-Kernel/drivers/usb/common
Ferry Toth 8a7b31d545 usb: ulpi: defer ulpi_register 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() on the first test write failing
with -ETIMEDOUT. Currently ulpi_read_id() expects to discover the phy via
DT when the test write fails and returns 0 in that case, even if DT does not
provide the phy. As a result usb probe completes without phy.

Make ulpi_read_id() return -ETIMEDOUT to its user if the first test write
fails. The user should then handle it appropriately. A follow up patch
will make dwc3_core_init() set -EPROBE_DEFER in this case and bail out.

Fixes: ef6a7bcfb0 ("usb: ulpi: Support device discovery via DT")
Cc: stable@vger.kernel.org
Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Ferry Toth <ftoth@exalondelft.nl>
Link: https://lore.kernel.org/r/20221205201527.13525-2-ftoth@exalondelft.nl
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-12-08 16:48:07 +01:00
..
Kconfig Partially revert "usb: Kconfig: using select for USB_COMMON dependency" 2021-10-05 13:45:16 +02:00
Makefile usb: common: add USB GPIO based connection detection driver 2019-09-03 19:01:04 +02:00
common.c usb: common: add helper to get role-switch-default-mode 2021-07-27 15:58:37 +02:00
common.h USB: move usb debugfs directory creation to the usb common core 2019-06-06 08:59:19 +02:00
debug.c usb: common: debug: Check non-standard control requests 2022-08-19 11:04:25 +02:00
led.c USB: move usb debugfs directory creation to the usb common core 2019-06-06 08:59:19 +02:00
ulpi.c usb: ulpi: defer ulpi_register on ulpi_read_id timeout 2022-12-08 16:48:07 +01:00
usb-conn-gpio.c usb: common: usb-conn-gpio: Simplify some error message 2022-08-18 21:16:02 +02:00
usb-otg-fsm.c usb: otg-fsm: Fix hrtimer list corruption 2021-07-27 16:31:31 +02:00