mirror-linux/drivers/usb
Ferry Toth 9bd180b6f9 usb: ulpi: defer ulpi_register on ulpi_read_id timeout
[ Upstream commit 8a7b31d545 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-01-18 11:58:19 +01:00
..
atm
c67x00
cdns3 usb: cdnsp: fix lack of ZLP for ep0 2022-12-31 13:33:09 +01:00
chipidea usb: chipidea: fix deadlock in ci_otg_del_timer 2022-11-09 12:34:18 +01:00
class
common usb: ulpi: defer ulpi_register on ulpi_read_id timeout 2023-01-18 11:58:19 +01:00
core usb: core: hcd: Fix return value check in usb_hcd_setup_local_mem() 2022-12-31 13:32:41 +01:00
dwc2
dwc3 usb: dwc3: xilinx: include linux/gpio/consumer.h 2023-01-12 12:02:34 +01:00
early
gadget usb: gadget: f_hid: fix refcount leak on error path 2022-12-31 13:32:41 +01:00
host xhci: Prevent infinite loop in transaction errors recovery for streams 2022-12-31 13:33:10 +01:00
image
isp1760
misc fbdev: sisfb: use explicitly signed char 2022-10-24 20:28:41 +02:00
mon
mtu3
musb usb: musb: omap2430: Fix probe regression for missing resources 2022-12-31 13:32:39 +01:00
phy
renesas_usbhs
roles usb: roles: fix of node refcount leak in usb_role_switch_is_parent() 2022-12-31 13:32:41 +01:00
serial USB: serial: f81534: fix division by zero on line-speed change 2022-12-21 17:48:08 +01:00
storage usb: storage: Add check for kcalloc 2022-12-31 13:32:42 +01:00
typec usb: typec: wusb3801: fix fwnode refcount leak in wusb3801_probe() 2022-12-31 13:32:42 +01:00
usbip
Kconfig
Makefile
usb-skeleton.c