mirror-linux/drivers/phy
Neill Kapron fe5955b11f phy: rockchip-typec: fix tcphy_get_mode error case
[ Upstream commit 4ca651df07 ]

The existing logic in tcphy_get_mode() can cause the phy to be
incorrectly configured to USB UFP or DisplayPort mode when
extcon_get_state returns an error code.

extcon_get_state() can return 0, 1, or a negative error code.

It is possible to get into the failing state with an extcon driver
which does not support the extcon connector id specified as the
second argument to extcon_get_state().

tcphy_get_mode()
->extcon_get_state()
-->find_cable_index_by_id()
--->return -EINVAL;

Fixes: e96be45cb8 ("phy: Add USB Type-C PHY driver for rk3399")
Signed-off-by: Neill Kapron <nkapron@google.com>
Reviewed-by: Lee Jones <lee@kernel.org>
Link: https://lore.kernel.org/r/20230126001013.3707873-1-nkapron@google.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-03-10 09:33:38 +01:00
..
allwinner phy: sun4i-usb: Add support for the H616 USB PHY 2023-01-04 11:28:56 +01:00
amlogic
broadcom phy: usb: Fix clock imbalance for suspend/resume 2022-12-31 13:32:48 +01:00
cadence
freescale
hisilicon
ingenic
intel
lantiq
marvell
mediatek phy: mediatek: remove temporary variable @mask_ 2023-03-10 09:33:35 +01:00
microchip
motorola
mscc
qualcomm phy: qcom-qmp-combo: fix runtime suspend 2023-02-09 11:28:25 +01:00
ralink
renesas
rockchip phy: rockchip-typec: fix tcphy_get_mode error case 2023-03-10 09:33:38 +01:00
samsung
socionext
st
sunplus phy: usb: sunplus: Fix potential null-ptr-deref in sp_usb_phy_probe() 2023-02-01 08:34:09 +01:00
tegra
ti phy: ti: fix Kconfig warning and operator precedence 2023-02-01 08:34:08 +01:00
xilinx
Kconfig
Makefile
phy-can-transceiver.c phy: phy-can-transceiver: Skip warning if no "max-bitrate" 2023-02-01 08:34:25 +01:00
phy-core-mipi-dphy.c
phy-core.c
phy-lgm-usb.c
phy-lpc18xx-usb-otg.c
phy-pistachio-usb.c
phy-xgene.c