Skip to contentSkip to conversation

rockchip: Fix devices suspend freeze on RK3568/RK3566

PATCH In review Jonas Karlman 5 participants 7 messages Jun 24 – Oct 15

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

v2 cover rockchip: Fix devices suspend freeze on RK3568/RK3566

This series fixes a system freeze during suspend in ohci_suspend() due to clk_usbphy1_480m not being enabled when EHCI/OHCI registers are accessed on e.g. a Raxa ROCK 3C board.

Following pm_test modes work on my ROCK 3C with the missing usbphy clk refs added:

echo N > /sys/module/printk/parameters/console_suspend

echo devices > /sys/power/pm_test
echo platform > /sys/power/pm_test
echo processors > /sys/power/pm_test
echo core > /sys/power/pm_test

echo mem > /sys/power/state

Changes in v2:
- Include rockchip,rk3588-ehci in the EHCI constraint
- Make clocks prop required for EHCI and OHCI
- Collect t-b tag

Jonas Karlman (2):
dt-bindings: usb: Add Rockchip RK3568 compatible for EHCI and OHCI
arm64: dts: rockchip: Fix devices suspend freeze on RK3568/RK3566

 .../devicetree/bindings/usb/generic-ehci.yaml    | 14 ++++++++++++++
 .../devicetree/bindings/usb/generic-ohci.yaml    |  7 ++++++-
 arch/arm64/boot/dts/rockchip/rk356x-base.dtsi    | 16 ++++++++--------
 3 files changed, 28 insertions(+), 9 deletions(-)
Signature · 7 lines
2.54.0


_______________________________________________
Linux-rockchip mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-rockchip
#1 lore raw

PATCH v2 1/2 dt-bindings: usb: Add Rockchip RK3568 compatible for EHCI and OHCI

The Rockchip RK3568 EHCI/OHCI controller depends on clk_usbphy1_480m being enabled, or the system may freeze when registers are accessed.

Add Rockchip RK3568 EHCI and OHCI compatibles with a similar four-clock constraint as RK3588, also extend the EHCI constraint to include RK3588 to match similar requirements of RK3588.

---
Existing DTs for RK3568 use the plain generic-ehci/ohci compatible, next patch make use of these new compatibles and adds the missing clk_usbphy1_480m clock references.

Existing DTs for RK3588 have contained the required four clocks since the initial addition of the EHCI/OHCI nodes.

Changes in v2:
- Include rockchip,rk3588-ehci in the EHCI constraint
- Make clocks prop required for EHCI and OHCI

---
 .../devicetree/bindings/usb/generic-ehci.yaml      | 14 ++++++++++++++
 .../devicetree/bindings/usb/generic-ohci.yaml      |  7 ++++++-
 2 files changed, 20 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/usb/generic-ehci.yaml +14 -0
index 55a5aa7d7a54..a39f01e740b1 100644
@@ -52,6 +52,7 @@ properties:
               - ibm,476gtr-ehci
               - nxp,lpc1850-ehci
               - qca,ar7100-ehci
+              - rockchip,rk3568-ehci
               - rockchip,rk3588-ehci
               - snps,hsdk-v1.0-ehci
               - socionext,uniphier-ehci
@@ -186,6 +187,19 @@ allOf:
       required:
         - clocks
         - clock-names
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - rockchip,rk3568-ehci
+              - rockchip,rk3588-ehci
+    then:
+      properties:
+        clocks:
+          minItems: 4
+      required:
+        - clocks
 
 unevaluatedProperties: false
 
Documentation/devicetree/bindings/usb/generic-ohci.yaml +6 -1
index d42f448fa204..19449a6b3033 100644
@@ -47,6 +47,7 @@ properties:
               - hpe,gxp-ohci
               - ibm,476gtr-ohci
               - ingenic,jz4740-ohci
+              - rockchip,rk3568-ohci
               - rockchip,rk3588-ohci
               - snps,hsdk-v1.0-ohci
           - const: generic-ohci
@@ -198,11 +199,15 @@ allOf:
       properties:
         compatible:
           contains:
-            const: rockchip,rk3588-ohci
+            enum:
+              - rockchip,rk3568-ohci
+              - rockchip,rk3588-ohci
     then:
       properties:
         clocks:
           minItems: 4
+      required:
+        - clocks
     else:
       properties:
         clocks:
Signature · 1 line
2.54.0
#2 lore raw

Re: [PATCH v2 1/2] dt-bindings: usb: Add Rockchip RK3568 compatible for EHCI and OHCI

Quoted 43 lines · Jonas Karlman

The Rockchip RK3568 EHCI/OHCI controller depends on clk_usbphy1_480m being enabled, or the system may freeze when registers are accessed.

Add Rockchip RK3568 EHCI and OHCI compatibles with a similar four-clock constraint as RK3588, also extend the EHCI constraint to include RK3588 to match similar requirements of RK3588.

---
Existing DTs for RK3568 use the plain generic-ehci/ohci compatible, next patch make use of these new compatibles and adds the missing clk_usbphy1_480m clock references.

Existing DTs for RK3588 have contained the required four clocks since the initial addition of the EHCI/OHCI nodes.

Changes in v2:
- Include rockchip,rk3588-ehci in the EHCI constraint
- Make clocks prop required for EHCI and OHCI

---
 .../devicetree/bindings/usb/generic-ehci.yaml      | 14 ++++++++++++++
 .../devicetree/bindings/usb/generic-ohci.yaml      |  7 ++++++-
 2 files changed, 20 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/usb/generic-ehci.yaml +4 -0
index 55a5aa7d7a54..a39f01e740b1 100644
@@ -52,6 +52,7 @@ properties:
               - ibm,476gtr-ehci
               - nxp,lpc1850-ehci
               - qca,ar7100-ehci
+              - rockchip,rk3568-ehci
               - rockchip,rk3588-ehci
               - snps,hsdk-v1.0-ehci
               - socionext,uniphier-ehci
@@ -186,6 +187,19 @@ allOf:
       required:
         - clocks
         - clock-names
+  - if:
+      properties:
+        compatible:

Documentation/devicetree/bindings/usb/generic-ehci.yaml allOf: · line 202

Quoted 10 lines
Documentation/devicetree/bindings/usb/generic-ehci.yaml +10 -0
+          contains:
+            enum:
+              - rockchip,rk3568-ehci
+              - rockchip,rk3588-ehci
+    then:
+      properties:
+        clocks:
+          minItems: 4
+      required:
+        - clocks

This is ABI break for RK3588, so your commit msg should also mention that RK3588 is not working for example. Otherwise you provided rationale only for breaking RK3568 ABI.

Same for OHCI part.

Best regards,
Krzysztof

#3 lore raw

PATCH v2 2/2 arm64: dts: rockchip: Fix devices suspend freeze on RK3568/RK3566

In reply to Jonas Karlman

The EHCI/OHCI controller depends on clk_usbphy1_480m being enabled, or the system may freeze when registers are accessed, i.e. during suspend in ohci_suspend().

Add the missing clk_usbphy1_480m clocks reference to EHCI/OHCI controllers to ensure the clock is enabled when ECHI/OHCI registers are accessed to prevent a system freeze.

Fixes suspend pm_test issue with EHCI/OHCI devices due to the missing clk_usbphy1_480m reference and makes following pm_test modes work:

echo N > /sys/module/printk/parameters/console_suspend

echo devices > /sys/power/pm_test
echo platform > /sys/power/pm_test
echo processors > /sys/power/pm_test
echo core > /sys/power/pm_test

echo mem > /sys/power/state

Fixes 91c4c3e06a25 ("arm64: dts: rockchip: add usb2 nodes to rk3568 device tree")
Fixes 78f7186095db ("arm64: dts: rockchip: rename and sort the rk356x usb2 phy handles")

---
v2: Collect t-b tag

---
 arch/arm64/boot/dts/rockchip/rk356x-base.dtsi | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
arch/arm64/boot/dts/rockchip/rk356x-base.dtsi +8 -8
index a5832895bd39..c930a6fd6ea0 100644
@@ -321,44 +321,44 @@ its: msi-controller@fd440000 {
 	};
 
 	usb_host0_ehci: usb@fd800000 {
-		compatible = "generic-ehci";
+		compatible = "rockchip,rk3568-ehci", "generic-ehci";
 		reg = <0x0 0xfd800000 0x0 0x40000>;
 		interrupts = <GIC_SPI 130 IRQ_TYPE_LEVEL_HIGH>;
 		clocks = <&cru HCLK_USB2HOST0>, <&cru HCLK_USB2HOST0_ARB>,
-			 <&cru PCLK_USB>;
+			 <&cru PCLK_USB>, <&usb2phy1>;
 		phys = <&usb2phy1_otg>;
 		phy-names = "usb";
 		status = "disabled";
 	};
 
 	usb_host0_ohci: usb@fd840000 {
-		compatible = "generic-ohci";
+		compatible = "rockchip,rk3568-ohci", "generic-ohci";
 		reg = <0x0 0xfd840000 0x0 0x40000>;
 		interrupts = <GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>;
 		clocks = <&cru HCLK_USB2HOST0>, <&cru HCLK_USB2HOST0_ARB>,
-			 <&cru PCLK_USB>;
+			 <&cru PCLK_USB>, <&usb2phy1>;
 		phys = <&usb2phy1_otg>;
 		phy-names = "usb";
 		status = "disabled";
 	};
 
 	usb_host1_ehci: usb@fd880000 {
-		compatible = "generic-ehci";
+		compatible = "rockchip,rk3568-ehci", "generic-ehci";
 		reg = <0x0 0xfd880000 0x0 0x40000>;
 		interrupts = <GIC_SPI 133 IRQ_TYPE_LEVEL_HIGH>;
 		clocks = <&cru HCLK_USB2HOST1>, <&cru HCLK_USB2HOST1_ARB>,
-			 <&cru PCLK_USB>;
+			 <&cru PCLK_USB>, <&usb2phy1>;
 		phys = <&usb2phy1_host>;
 		phy-names = "usb";
 		status = "disabled";
 	};
 
 	usb_host1_ohci: usb@fd8c0000 {
-		compatible = "generic-ohci";
+		compatible = "rockchip,rk3568-ohci", "generic-ohci";
 		reg = <0x0 0xfd8c0000 0x0 0x40000>;
 		interrupts = <GIC_SPI 134 IRQ_TYPE_LEVEL_HIGH>;
 		clocks = <&cru HCLK_USB2HOST1>, <&cru HCLK_USB2HOST1_ARB>,
-			 <&cru PCLK_USB>;
+			 <&cru PCLK_USB>, <&usb2phy1>;
 		phys = <&usb2phy1_host>;
 		phy-names = "usb";
 		status = "disabled";
Signature · 1 line
2.54.0
Acked-by on v2 2/2
#4 lore raw

Re: [PATCH v2 2/2] arm64: dts: rockchip: Fix devices suspend freeze on RK3568/RK3566

Hi Jonas,

Quoted 18 lines · Jonas Karlman

The EHCI/OHCI controller depends on clk_usbphy1_480m being enabled, or the system may freeze when registers are accessed, i.e. during suspend in ohci_suspend().

Add the missing clk_usbphy1_480m clocks reference to EHCI/OHCI controllers to ensure the clock is enabled when ECHI/OHCI registers are accessed to prevent a system freeze.

Fixes suspend pm_test issue with EHCI/OHCI devices due to the missing clk_usbphy1_480m reference and makes following pm_test modes work:

echo N > /sys/module/printk/parameters/console_suspend

echo devices > /sys/power/pm_test
echo platform > /sys/power/pm_test
echo processors > /sys/power/pm_test
echo core > /sys/power/pm_test

Quoted 6 lines

echo mem > /sys/power/state

Fixes 91c4c3e06a25 ("arm64: dts: rockchip: add usb2 nodes to rk3568 device tree")
Fixes 78f7186095db ("arm64: dts: rockchip: rename and sort the rk356x usb2 phy handles")

Thanks and best regards,
Michael

Quoted 53 lines

---
v2: Collect t-b tag

---
 arch/arm64/boot/dts/rockchip/rk356x-base.dtsi | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
arch/arm64/boot/dts/rockchip/rk356x-base.dtsi +6 -6
index a5832895bd39..c930a6fd6ea0 100644
@@ -321,44 +321,44 @@ its: msi-controller@fd440000 {
 	};
 
 	usb_host0_ehci: usb@fd800000 {
-		compatible = "generic-ehci";
+		compatible = "rockchip,rk3568-ehci", "generic-ehci";
 		reg = <0x0 0xfd800000 0x0 0x40000>;
 		interrupts = <GIC_SPI 130 IRQ_TYPE_LEVEL_HIGH>;
 		clocks = <&cru HCLK_USB2HOST0>, <&cru HCLK_USB2HOST0_ARB>,
-			 <&cru PCLK_USB>;
+			 <&cru PCLK_USB>, <&usb2phy1>;
 		phys = <&usb2phy1_otg>;
 		phy-names = "usb";
 		status = "disabled";
 	};
 
 	usb_host0_ohci: usb@fd840000 {
-		compatible = "generic-ohci";
+		compatible = "rockchip,rk3568-ohci", "generic-ohci";
 		reg = <0x0 0xfd840000 0x0 0x40000>;
 		interrupts = <GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>;
 		clocks = <&cru HCLK_USB2HOST0>, <&cru HCLK_USB2HOST0_ARB>,
-			 <&cru PCLK_USB>;
+			 <&cru PCLK_USB>, <&usb2phy1>;
 		phys = <&usb2phy1_otg>;
 		phy-names = "usb";
 		status = "disabled";
 	};
 
 	usb_host1_ehci: usb@fd880000 {
-		compatible = "generic-ehci";
+		compatible = "rockchip,rk3568-ehci", "generic-ehci";
 		reg = <0x0 0xfd880000 0x0 0x40000>;
 		interrupts = <GIC_SPI 133 IRQ_TYPE_LEVEL_HIGH>;
 		clocks = <&cru HCLK_USB2HOST1>, <&cru HCLK_USB2HOST1_ARB>,
-			 <&cru PCLK_USB>;
+			 <&cru PCLK_USB>, <&usb2phy1>;
 		phys = <&usb2phy1_host>;
 		phy-names = "usb";
 		status = "disabled";
 	};
 
 	usb_host1_ohci: usb@fd8c0000 {

arch/arm64/boot/dts/rockchip/rk356x-base.dtsi its: msi-controller@fd440000 { · line 364

Quoted 10 lines
arch/arm64/boot/dts/rockchip/rk356x-base.dtsi +2 -2
-		compatible = "generic-ohci";
+		compatible = "rockchip,rk3568-ohci", "generic-ohci";
 		reg = <0x0 0xfd8c0000 0x0 0x40000>;
 		interrupts = <GIC_SPI 134 IRQ_TYPE_LEVEL_HIGH>;
 		clocks = <&cru HCLK_USB2HOST1>, <&cru HCLK_USB2HOST1_ARB>,
-			 <&cru PCLK_USB>;
+			 <&cru PCLK_USB>, <&usb2phy1>;
 		phys = <&usb2phy1_host>;
 		phy-names = "usb";
 		status = "disabled";

_______________________________________________
Linux-rockchip mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-rockchip

Tested-by on v2 2/2
#5 lore raw

Re: [PATCH v2 2/2] arm64: dts: rockchip: Fix devices suspend freeze on RK3568/RK3566

In reply to Jonas Karlman

Tested on ODROID-M1 (RK3568) with 7.3-rc7: without this patch pm_test=devices hung while suspending the first OHCI controller 4 of 14 times, with it all 31 runs passed.

_______________________________________________
Linux-rockchip mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-rockchip

maintainer
#6 lore raw
In reply to Jonas Karlman

Hi Jonas,

Am Mittwoch, 24. Juni 2026, 21:27:23 Mitteleuropäische Sommerzeit schrieb Jonas Karlman:

Quoted 16 lines

This series fixes a system freeze during suspend in ohci_suspend() due to clk_usbphy1_480m not being enabled when EHCI/OHCI registers are accessed on e.g. a Raxa ROCK 3C board.

Following pm_test modes work on my ROCK 3C with the missing usbphy clk refs added:

echo N > /sys/module/printk/parameters/console_suspend

echo devices > /sys/power/pm_test
echo platform > /sys/power/pm_test
echo processors > /sys/power/pm_test
echo core > /sys/power/pm_test

echo mem > /sys/power/state

Quoted 7 lines

Changes in v2:
- Include rockchip,rk3588-ehci in the EHCI constraint
- Make clocks prop required for EHCI and OHCI
- Collect t-b tag

Jonas Karlman (2):
dt-bindings: usb: Add Rockchip RK3568 compatible for EHCI and OHCI

it seems I wasn't in Cc for the first patch, so can't know if and when that gets/got applied.

Also I think I remember Greg preferring not having to split apart patch series', so I think the binding patch might be better off standing alone.

Heiko