Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

phy: rockchip-inno-usb2: Ignore OTG IRQs in host mode

When the OTG port is fixed to host mode, the driver does not request its
IRQs, nor does it enable those IRQs in hardware. Similarly, the driver
should ignore the OTG port IRQs when handling the shared interrupt.

Otherwise, it would update the extcon based on an ID pin which may be in
an undefined state, or try to queue a uninitialized work item.

Fixes: 6a98df08ccd5 ("phy: rockchip-inno-usb2: Fix muxed interrupt support")
Reported-by: Frank Wunderlich <frank-w@public-files.de>
Signed-off-by: Samuel Holland <samuel@sholland.org>
Tested-by: Peter Geis <pgwipeout@gmail.com>
Tested-by: Frank Wunderlich <frank-w@public-files.de>
Link: https://lore.kernel.org/r/20220708061434.38115-1-samuel@sholland.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Samuel Holland and committed by
Vinod Koul
fd7d4748 38b6dbcc

+3 -1
+3 -1
drivers/phy/rockchip/phy-rockchip-inno-usb2.c
··· 978 978 979 979 switch (rport->port_id) { 980 980 case USB2PHY_PORT_OTG: 981 - ret |= rockchip_usb2phy_otg_mux_irq(irq, rport); 981 + if (rport->mode != USB_DR_MODE_HOST && 982 + rport->mode != USB_DR_MODE_UNKNOWN) 983 + ret |= rockchip_usb2phy_otg_mux_irq(irq, rport); 982 984 break; 983 985 case USB2PHY_PORT_HOST: 984 986 ret |= rockchip_usb2phy_linestate_irq(irq, rport);