]> git.baikalelectronics.ru Git - kernel.git/commitdiff
phy: rockchip-inno-usb2: Ignore OTG IRQs in host mode
authorSamuel Holland <samuel@sholland.org>
Fri, 8 Jul 2022 06:14:34 +0000 (01:14 -0500)
committerVinod Koul <vkoul@kernel.org>
Fri, 15 Jul 2022 11:50:04 +0000 (17:20 +0530)
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: 51efb686e6c2 ("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>
drivers/phy/rockchip/phy-rockchip-inno-usb2.c

index 706a2263b0b2ae4d88d8dbdd14823688b001f9cb..0b1e9337ee8e2b169989cdb34724d073c42fc4a7 100644 (file)
@@ -978,7 +978,9 @@ static irqreturn_t rockchip_usb2phy_irq(int irq, void *data)
 
                switch (rport->port_id) {
                case USB2PHY_PORT_OTG:
-                       ret |= rockchip_usb2phy_otg_mux_irq(irq, rport);
+                       if (rport->mode != USB_DR_MODE_HOST &&
+                           rport->mode != USB_DR_MODE_UNKNOWN)
+                               ret |= rockchip_usb2phy_otg_mux_irq(irq, rport);
                        break;
                case USB2PHY_PORT_HOST:
                        ret |= rockchip_usb2phy_linestate_irq(irq, rport);