Skip to contentSkip to conversation

arm64: dts: qcom: fix USB wakeup interrupts again (pt 2)

PATCH Applied Johan Hovold 5 participants 15 messages Dec 14, 2023 – Dec 19, 2023

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

cover arm64: dts: qcom: fix USB wakeup interrupts again (pt 2)

The USB DP/DM HS PHY interrupts need to be provided by the PDC interrupt controller in order to be able to wake the system up from low-power states and to be able to detect disconnect events, which requires triggering on falling edges.

A recent commit updated the trigger type but failed to change the interrupt provider as required. This leads to the current Linux driver failing to probe instead of printing an error during suspend and USB wakeup not working as intended.

While at it, fix also the SS PHY interrupt so that it too can be used to wakeup the system up.

Thanks to Konrad and Krishna for providing the sdm670 PDC interrupts numbers. The sc8180x SS PHY vectors I inferred from sdm670/sdm845/sm8150 which appear to use the name configuration.

After this series, only sm6375 remains to be fixed and I believe Bjorn is trying to dig out the corresponding vectors.

Also note that these patches have only been compile tested.

Johan

Johan Hovold (3):
arm64: dts: qcom: sdm670: fix USB DP/DM HS PHY interrupts
arm64: dts: qcom: sdm670: fix USB SS wakeup
arm64: dts: qcom: sc8180x: fix USB SS wakeup

 arch/arm64/boot/dts/qcom/sc8180x.dtsi | 4 ++--
 arch/arm64/boot/dts/qcom/sdm670.dtsi  | 8 ++++----
 2 files changed, 6 insertions(+), 6 deletions(-)
Signature · 1 line
2.41.0
#1 lore raw

PATCH 1/3 arm64: dts: qcom: sdm670: fix USB DP/DM HS PHY interrupts

The USB DP/DM HS PHY interrupts need to be provided by the PDC interrupt controller in order to be able to wake the system up from low-power states and to be able to detect disconnect events, which requires triggering on falling edges.

A recent commit updated the trigger type but failed to change the interrupt provider as required. This leads to the current Linux driver failing to probe instead of printing an error during suspend and USB wakeup not working as intended.

Fixes de3b3de30999 ("arm64: dts: qcom: sdm670: fix USB wakeup interrupt types")
Fixes 07c8ded6e373 ("arm64: dts: qcom: add sdm670 and pixel 3a device trees")
Cc Richard Acayan <[email protected]>
---
 arch/arm64/boot/dts/qcom/sdm670.dtsi | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
arch/arm64/boot/dts/qcom/sdm670.dtsi +4 -4
index c873560ae9d5..fe4067c012a0 100644
@@ -1295,10 +1295,10 @@ usb_1: usb@a6f8800 {
 					  <&gcc GCC_USB30_PRIM_MASTER_CLK>;
 			assigned-clock-rates = <19200000>, <150000000>;
 
-			interrupts = <GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>,
-				     <GIC_SPI 486 IRQ_TYPE_LEVEL_HIGH>,
-				     <GIC_SPI 488 IRQ_TYPE_EDGE_BOTH>,
-				     <GIC_SPI 489 IRQ_TYPE_EDGE_BOTH>;
+			interrupts-extended = <&intc GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>,
+					      <&intc GIC_SPI 486 IRQ_TYPE_LEVEL_HIGH>,
+					      <&pdc 8 IRQ_TYPE_EDGE_BOTH>,
+					      <&pdc 9 IRQ_TYPE_EDGE_BOTH>;
 			interrupt-names = "hs_phy_irq", "ss_phy_irq",
 					  "dm_hs_phy_irq", "dp_hs_phy_irq";
 
Signature · 1 line
2.41.0
Reviewed-by on v1 1/3
#2 lore raw

Re: [PATCH 1/3] arm64: dts: qcom: sdm670: fix USB DP/DM HS PHY interrupts

Quoted 10 lines · Johan Hovold

The USB DP/DM HS PHY interrupts need to be provided by the PDC interrupt controller in order to be able to wake the system up from low-power states and to be able to detect disconnect events, which requires triggering on falling edges.

A recent commit updated the trigger type but failed to change the interrupt provider as required. This leads to the current Linux driver failing to probe instead of printing an error during suspend and USB wakeup not working as intended.

Quoted 6 lines
Fixes de3b3de30999 ("arm64: dts: qcom: sdm670: fix USB wakeup interrupt types")
Fixes 07c8ded6e373 ("arm64: dts: qcom: add sdm670 and pixel 3a device trees")
Cc Richard Acayan <[email protected]>

---

Konrad

Tested-by on v1 1/3
#3 lore raw

Re: [PATCH 1/3] arm64: dts: qcom: sdm670: fix USB DP/DM HS PHY interrupts

In reply to Johan Hovold
Quoted 10 lines · Johan Hovold

The USB DP/DM HS PHY interrupts need to be provided by the PDC interrupt controller in order to be able to wake the system up from low-power states and to be able to detect disconnect events, which requires triggering on falling edges.

A recent commit updated the trigger type but failed to change the interrupt provider as required. This leads to the current Linux driver failing to probe instead of printing an error during suspend and USB wakeup not working as intended.

Quoted 6 lines
Fixes de3b3de30999 ("arm64: dts: qcom: sdm670: fix USB wakeup interrupt types")
Fixes 07c8ded6e373 ("arm64: dts: qcom: add sdm670 and pixel 3a device trees")
Cc Richard Acayan <[email protected]>

---

On a Pixel 3a, plugging in a USB cable doesn't wake up the device (presumably because there is no wakeup-source property) but this gets USB working again on linux-next.

#4 lore raw

Re: [PATCH 1/3] arm64: dts: qcom: sdm670: fix USB DP/DM HS PHY interrupts

Quoted 18 lines · Richard Acayan
Quoted 10 lines · Johan Hovold

The USB DP/DM HS PHY interrupts need to be provided by the PDC interrupt controller in order to be able to wake the system up from low-power states and to be able to detect disconnect events, which requires triggering on falling edges.

A recent commit updated the trigger type but failed to change the interrupt provider as required. This leads to the current Linux driver failing to probe instead of printing an error during suspend and USB wakeup not working as intended.

Quoted 6 lines
Fixes de3b3de30999 ("arm64: dts: qcom: sdm670: fix USB wakeup interrupt types")
Fixes 07c8ded6e373 ("arm64: dts: qcom: add sdm670 and pixel 3a device trees")
Cc Richard Acayan <[email protected]>

---

Quoted 5 lines

On a Pixel 3a, plugging in a USB cable doesn't wake up the device (presumably because there is no wakeup-source property) but this gets USB working again on linux-next.

Thanks for testing. And yes, the wakeup interrupts will indeed not be enabled at system suspend unless the wakeup-source property is there. Did you try adding it?

Johan

#5 lore raw

Re: [PATCH 1/3] arm64: dts: qcom: sdm670: fix USB DP/DM HS PHY interrupts

Quoted 21 lines · Johan Hovold
Quoted 20 lines · Richard Acayan
Quoted 10 lines · Johan Hovold

The USB DP/DM HS PHY interrupts need to be provided by the PDC interrupt controller in order to be able to wake the system up from low-power states and to be able to detect disconnect events, which requires triggering on falling edges.

A recent commit updated the trigger type but failed to change the interrupt provider as required. This leads to the current Linux driver failing to probe instead of printing an error during suspend and USB wakeup not working as intended.

Quoted 6 lines
Fixes de3b3de30999 ("arm64: dts: qcom: sdm670: fix USB wakeup interrupt types")
Fixes 07c8ded6e373 ("arm64: dts: qcom: add sdm670 and pixel 3a device trees")
Cc Richard Acayan <[email protected]>

---

Quoted 7 lines
Quoted 3 lines

On a Pixel 3a, plugging in a USB cable doesn't wake up the device (presumably because there is no wakeup-source property) but this gets USB working again on linux-next.

Thanks for testing. And yes, the wakeup interrupts will indeed not be enabled at system suspend unless the wakeup-source property is there. Did you try adding it?

Just tested today. Adding it does not cause the system to wake up when plugging in a laptop on the Pixel 3a, but that might just be because USB wakeups are disabled when the adapter is configured for peripheral mode.

drivers/usb/dwc3/dwc3-qcom.c (dwc3_qcom_suspend):

	/*
	 * The role is stable during suspend as role switching is done from a
	 * freezable workqueue.
	 */
	if (dwc3_qcom_is_host(qcom) && wakeup) {
		qcom->usb2_speed = dwc3_qcom_read_usb2_speed(qcom);
		dwc3_qcom_enable_interrupts(qcom);
	}
#6 lore raw

Re: [PATCH 1/3] arm64: dts: qcom: sdm670: fix USB DP/DM HS PHY interrupts

Quoted 9 lines · Richard Acayan
Quoted 8 lines · Johan Hovold
Quoted 5 lines · Richard Acayan

On a Pixel 3a, plugging in a USB cable doesn't wake up the device (presumably because there is no wakeup-source property) but this gets USB working again on linux-next.

Quoted 8 lines
Quoted 3 lines

Thanks for testing. And yes, the wakeup interrupts will indeed not be enabled at system suspend unless the wakeup-source property is there. Did you try adding it?

Just tested today. Adding it does not cause the system to wake up when plugging in a laptop on the Pixel 3a, but that might just be because USB wakeups are disabled when the adapter is configured for peripheral mode.

Right, wake up is currently only implemented for host mode.

Johan

#7 lore raw

Re: [PATCH 1/3] arm64: dts: qcom: sdm670: fix USB DP/DM HS PHY interrupts

In reply to Johan Hovold
Quoted 5 lines · Johan Hovold

The USB DP/DM HS PHY interrupts need to be provided by the PDC interrupt controller in order to be able to wake the system up from low-power states and to be able to detect disconnect events, which requires triggering on falling edges.

Quoted 8 lines

A recent commit updated the trigger type but failed to change the interrupt provider as required. This leads to the current Linux driver failing to probe instead of printing an error during suspend and USB wakeup not working as intended.

Fixes de3b3de30999 ("arm64: dts: qcom: sdm670: fix USB wakeup interrupt types")
Fixes 07c8ded6e373 ("arm64: dts: qcom: add sdm670 and pixel 3a device trees")

I almost forgot to mention, both SDM670 patches seem to depend on b51ee205dc4f ("arm64: dts: qcom: sdm670: Add PDC") in 6.6 to compile properly.

Quoted 28 lines
Cc Richard Acayan <[email protected]>
---
 arch/arm64/boot/dts/qcom/sdm670.dtsi | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
arch/arm64/boot/dts/qcom/sdm670.dtsi +4 -4
index c873560ae9d5..fe4067c012a0 100644
@@ -1295,10 +1295,10 @@ usb_1: usb@a6f8800 {
 					  <&gcc GCC_USB30_PRIM_MASTER_CLK>;
 			assigned-clock-rates = <19200000>, <150000000>;
 
-			interrupts = <GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>,
-				     <GIC_SPI 486 IRQ_TYPE_LEVEL_HIGH>,
-				     <GIC_SPI 488 IRQ_TYPE_EDGE_BOTH>,
-				     <GIC_SPI 489 IRQ_TYPE_EDGE_BOTH>;
+			interrupts-extended = <&intc GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>,
+					      <&intc GIC_SPI 486 IRQ_TYPE_LEVEL_HIGH>,
+					      <&pdc 8 IRQ_TYPE_EDGE_BOTH>,
+					      <&pdc 9 IRQ_TYPE_EDGE_BOTH>;
 			interrupt-names = "hs_phy_irq", "ss_phy_irq",
 					  "dm_hs_phy_irq", "dp_hs_phy_irq";
 
Signature · 1 line
2.41.0
#8 lore raw

Re: [PATCH 1/3] arm64: dts: qcom: sdm670: fix USB DP/DM HS PHY interrupts

Quoted 11 lines · Richard Acayan
Quoted 10 lines · Johan Hovold

The USB DP/DM HS PHY interrupts need to be provided by the PDC interrupt controller in order to be able to wake the system up from low-power states and to be able to detect disconnect events, which requires triggering on falling edges.

A recent commit updated the trigger type but failed to change the interrupt provider as required. This leads to the current Linux driver failing to probe instead of printing an error during suspend and USB wakeup not working as intended.

Quoted 7 lines
Quoted 3 lines
Fixes de3b3de30999 ("arm64: dts: qcom: sdm670: fix USB wakeup interrupt types")
Fixes 07c8ded6e373 ("arm64: dts: qcom: add sdm670 and pixel 3a device trees")

I almost forgot to mention, both SDM670 patches seem to depend on b51ee205dc4f ("arm64: dts: qcom: sdm670: Add PDC") in 6.6 to compile properly.

Thanks for spotting that. The 6.5 stable tree is EOL now so this will fortunately not be an issue in practice.

Johan

#9 lore raw

PATCH 2/3 arm64: dts: qcom: sdm670: fix USB SS wakeup

In reply to Johan Hovold

The USB SS PHY interrupt needs to be provided by the PDC interrupt controller in order to be able to wake the system up from low-power states.

Fixes 07c8ded6e373 ("arm64: dts: qcom: add sdm670 and pixel 3a device trees")
Cc Richard Acayan <[email protected]>
---
 arch/arm64/boot/dts/qcom/sdm670.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/sdm670.dtsi +1 -1
index fe4067c012a0..730c8351bcaa 100644
@@ -1296,7 +1296,7 @@ usb_1: usb@a6f8800 {
 			assigned-clock-rates = <19200000>, <150000000>;
 
 			interrupts-extended = <&intc GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>,
-					      <&intc GIC_SPI 486 IRQ_TYPE_LEVEL_HIGH>,
+					      <&pdc 6 IRQ_TYPE_LEVEL_HIGH>,
 					      <&pdc 8 IRQ_TYPE_EDGE_BOTH>,
 					      <&pdc 9 IRQ_TYPE_EDGE_BOTH>;
 			interrupt-names = "hs_phy_irq", "ss_phy_irq",
Signature · 1 line
2.41.0
Reviewed-by on v1 2/3
#10 lore raw

Re: [PATCH 2/3] arm64: dts: qcom: sdm670: fix USB SS wakeup

Quoted 9 lines · Johan Hovold

The USB SS PHY interrupt needs to be provided by the PDC interrupt controller in order to be able to wake the system up from low-power states.

Fixes 07c8ded6e373 ("arm64: dts: qcom: add sdm670 and pixel 3a device trees")
Cc Richard Acayan <[email protected]>

---

Konrad

Tested-by on v1 2/3
#11 lore raw

Re: [PATCH 2/3] arm64: dts: qcom: sdm670: fix USB SS wakeup

In reply to Johan Hovold
Quoted 9 lines · Johan Hovold

The USB SS PHY interrupt needs to be provided by the PDC interrupt controller in order to be able to wake the system up from low-power states.

Fixes 07c8ded6e373 ("arm64: dts: qcom: add sdm670 and pixel 3a device trees")
Cc Richard Acayan <[email protected]>

---

#12 lore raw

PATCH 3/3 arm64: dts: qcom: sc8180x: fix USB SS wakeup

In reply to Johan Hovold

The USB SS PHY interrupt needs to be provided by the PDC interrupt controller in order to be able to wake the system up from low-power states.

Fixes b080f53a8f44 ("arm64: dts: qcom: sc8180x: Add remoteprocs, wifi and usb nodes")
Cc Vinod Koul <[email protected]>
---
 arch/arm64/boot/dts/qcom/sc8180x.dtsi | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/qcom/sc8180x.dtsi +2 -2
index 8f95779c75fa..7a53d6d18498 100644
@@ -2549,7 +2549,7 @@ usb_prim: usb@a6f8800 {
 			compatible = "qcom,sc8180x-dwc3", "qcom,dwc3";
 			reg = <0 0x0a6f8800 0 0x400>;
 			interrupts-extended = <&intc GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>,
-					      <&intc GIC_SPI 486 IRQ_TYPE_LEVEL_HIGH>,
+					      <&pdc 6 IRQ_TYPE_LEVEL_HIGH>,
 					      <&pdc 8 IRQ_TYPE_EDGE_BOTH>,
 					      <&pdc 9 IRQ_TYPE_EDGE_BOTH>;
 			interrupt-names = "hs_phy_irq",
@@ -2623,7 +2623,7 @@ usb_sec: usb@a8f8800 {
 			resets = <&gcc GCC_USB30_SEC_BCR>;
 			power-domains = <&gcc USB30_SEC_GDSC>;
 			interrupts-extended = <&intc GIC_SPI 136 IRQ_TYPE_LEVEL_HIGH>,
-					      <&intc GIC_SPI 487 IRQ_TYPE_LEVEL_HIGH>,
+					      <&pdc 7 IRQ_TYPE_LEVEL_HIGH>,
 					      <&pdc 10 IRQ_TYPE_EDGE_BOTH>,
 					      <&pdc 11 IRQ_TYPE_EDGE_BOTH>;
 			interrupt-names = "hs_phy_irq", "ss_phy_irq",
Signature · 1 line
2.41.0
Reviewed-by on v1 3/3
#13 lore raw

Re: [PATCH 3/3] arm64: dts: qcom: sc8180x: fix USB SS wakeup

Quoted 9 lines · Johan Hovold

The USB SS PHY interrupt needs to be provided by the PDC interrupt controller in order to be able to wake the system up from low-power states.

Fixes b080f53a8f44 ("arm64: dts: qcom: sc8180x: Add remoteprocs, wifi and usb nodes")
Cc Vinod Koul <[email protected]>

---

Konrad

maintainer Applied
#14 lore raw
In reply to Johan Hovold
Quoted 11 lines · Johan Hovold

The USB DP/DM HS PHY interrupts need to be provided by the PDC interrupt controller in order to be able to wake the system up from low-power states and to be able to detect disconnect events, which requires triggering on falling edges.

A recent commit updated the trigger type but failed to change the interrupt provider as required. This leads to the current Linux driver failing to probe instead of printing an error during suspend and USB wakeup not working as intended.

[...]

Applied, thanks!

[1/3] arm64: dts: qcom: sdm670: fix USB DP/DM HS PHY interrupts

      commit: c42d12ea105f67b0f137f1e52d5c59d13fe12b1f
[2/3] arm64: dts: qcom: sdm670: fix USB SS wakeup
      commit: 047b2edc35b8db22354b4fba37818b548fc18896
[3/3] arm64: dts: qcom: sc8180x: fix USB SS wakeup
      commit: 0afa885d42d05d30161ab8eab1ebacd993edb82b

Best regards,

Signature · 1 line
Bjorn Andersson <[email protected]>