Skip to contentSkip to conversation

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

PATCH Applied Samuel Holland 4 participants 4 messages Jul 8, 2022 – Jul 15, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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")

---

 drivers/phy/rockchip/phy-rockchip-inno-usb2.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/phy/rockchip/phy-rockchip-inno-usb2.c +3 -1
index 6711659f727c..26b841c49ec6 100644
@@ -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);
Signature · 1 line
2.35.1
Tested-by on v1 1/1
#1 lore raw

Hi Samuel

thx for the fix...with this it works again

regards Frank

Quoted 40 lines

Gesendet: Freitag, 08. Juli 2022 um 08:14 Uhr
Von: "Samuel Holland" <[email protected]>
An: "Frank Wunderlich" <[email protected]>, "Vinod Koul" <[email protected]>
Cc: "Greg Kroah-Hartman" <[email protected]>, "Peter Geis" <[email protected]>, "Samuel Holland" <[email protected]>, "Heiko Stuebner" <[email protected]>, "Kishon Vijay Abraham I" <[email protected]>, [email protected], [email protected], [email protected], [email protected]
Betreff: [PATCH] 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")

---

 drivers/phy/rockchip/phy-rockchip-inno-usb2.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/phy/rockchip/phy-rockchip-inno-usb2.c +3 -2
index 6711659f727c..26b841c49ec6 100644
@@ -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);
--

2.35.1

Signature · 3 lines
linux-phy mailing list
[email protected]
https://lists.infradead.org/mailman/listinfo/linux-phy
Tested-by
#2 lore raw

Good Morning,

I've confirmed this also resolves the issues with phy warnings on quartz64-a.

Very Respectfully,
Peter Geis

Quoted 50 lines · Frank Wunderlich

Hi Samuel

thx for the fix...with this it works again

regards Frank

Quoted 40 lines

Gesendet: Freitag, 08. Juli 2022 um 08:14 Uhr
Von: "Samuel Holland" <[email protected]>
An: "Frank Wunderlich" <[email protected]>, "Vinod Koul" <[email protected]>
Cc: "Greg Kroah-Hartman" <[email protected]>, "Peter Geis" <[email protected]>, "Samuel Holland" <[email protected]>, "Heiko Stuebner" <[email protected]>, "Kishon Vijay Abraham I" <[email protected]>, [email protected], [email protected], [email protected], [email protected]
Betreff: [PATCH] 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")

---

 drivers/phy/rockchip/phy-rockchip-inno-usb2.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/phy/rockchip/phy-rockchip-inno-usb2.c +3 -2
index 6711659f727c..26b841c49ec6 100644
@@ -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);
--

2.35.1

maintainer Applied
#3 lore raw
In reply to Samuel Holland
Quoted 6 lines · Samuel Holland

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.

Applied, thanks

Signature · 1 line
~Vinod