Skip to contentSkip to conversation

soc: loongson: Fix some issues about loongson_pm2

PATCH Applied Binbin Zhou 6 participants 15 messages Aug 31, 2023 – Sep 26, 2023

Subsystems (3)

v2 of 3 Applied 5/5 Latest is v3 →

lore
Share & tools
lore
#0 lore raw

v2 cover soc: loongson: Fix some issues about loongson_pm2

Hi all:

Since commit 67694c076bd7 ("soc: loongson2_pm: add power management support"), the Loongson-2K PM driver was added, some issues have been found and this patchset is planned to fix these issues.

Specific:
Patch 1: Compilation error found by Randy;
Patch 2/3: Rewriting the ls2k-pmc compatible attribute with fallback compatible;
Patch 4/5: Add Loongson-2K SoC reboot/shutdown support as part of power management.

Thanks.

-----
V2:
patch 1:
- Change "depends on INPUT" to "depends on INPUT=y", because the compilation error still exists when "INPUT=m".
patch 2:
- Use ls2k0500 as the fallback compatible;
- Add ls2k2000 compatible.
patch 3:
- Drop ls2k1000 compatible, for ls2k0500 is used as the fallback compatible.
patch 4:
- Drop label;
- Drop regmap property in syscon-reboot, for it's deprecated;
- Add missing space.

Link to V1:
https://lore.kernel.org/all/[email protected]/

Binbin Zhou (5):
soc: loongson: loongson_pm2: Add dependency for INPUT
dt-bindings: soc: loongson,ls2k-pmc: Use fallbacks for ls2k-pmc
compatible
soc: loongson: loongson_pm2: Drop useless of_device_id compatible
dt-bindings: soc: loongson,ls2k-pmc: Allow
syscon-reboot/syscon-poweroff as child
soc: loongson: loongson_pm2: Populate children syscon nodes

 .../soc/loongson/loongson,ls2k-pmc.yaml       | 43 ++++++++++++++++---
 drivers/soc/loongson/Kconfig                  |  1 +
 drivers/soc/loongson/loongson2_pm.c           |  7 ++-
 3 files changed, 44 insertions(+), 7 deletions(-)
Signature · 1 line
2.39.3
#1 lore raw

PATCH v2 1/5 soc: loongson: loongson_pm2: Add dependency for INPUT

Since commit 67694c076bd7 ("soc: loongson2_pm: add power management support"), the Loongson-2K PM driver was added, but it didn't update the Kconfig entry for the INPUT dependency, leading to build errors, so update the Kconfig entry to depend on INPUT.

/opt/crosstool/gcc-13.2.0-nolibc/loongarch64-linux/bin/loongarch64-linux-ld:
drivers/soc/loongson/loongson2_pm.o: in function `loongson2_power_button_init':
/work/lnx/next/linux-next-20230825/LOONG64/../drivers/soc/loongson/loongson2_pm.c:101:(.text+0x350): undefined reference to `input_allocate_device' /opt/crosstool/gcc-13.2.0-nolibc/loongarch64-linux/bin/loongarch64-linux-ld:
/work/lnx/next/linux-next-20230825/LOONG64/../drivers/soc/loongson/loongson2_pm.c:109:(.text+0x3dc): undefined reference to `input_set_capability' /opt/crosstool/gcc-13.2.0-nolibc/loongarch64-linux/bin/loongarch64-linux-ld:
/work/lnx/next/linux-next-20230825/LOONG64/../drivers/soc/loongson/loongson2_pm.c:111:(.text+0x3e4): undefined reference to `input_register_device' /opt/crosstool/gcc-13.2.0-nolibc/loongarch64-linux/bin/loongarch64-linux-ld:
/work/lnx/next/linux-next-20230825/LOONG64/../drivers/soc/loongson/loongson2_pm.c:125:(.text+0x3fc): undefined reference to input_free_device' /opt/crosstool/gcc-13.2.0-nolibc/loongarch64-linux/bin/loongarch64-linux-ld: drivers/soc/loongson/loongson2_pm.o: in function input_report_key':
/work/lnx/next/linux-next-20230825/LOONG64/../include/linux/input.h:425:(.text+0x58c): undefined reference to `input_event'

---
 drivers/soc/loongson/Kconfig | 1 +
 1 file changed, 1 insertion(+)
drivers/soc/loongson/Kconfig +1 -0
index 314e13bb3e01..368344943a93 100644
@@ -20,6 +20,7 @@ config LOONGSON2_GUTS
 config LOONGSON2_PM
 	bool "Loongson-2 SoC Power Management Controller Driver"
 	depends on LOONGARCH && OF
+	depends on INPUT=y
 	help
 	  The Loongson-2's power management controller was ACPI, supports ACPI
 	  S2Idle (Suspend To Idle), ACPI S3 (Suspend To RAM), ACPI S4 (Suspend To
Signature · 1 line
2.39.3
#2 lore raw

Re: [PATCH v2 1/5] soc: loongson: loongson_pm2: Add dependency for INPUT

Quoted 28 lines · Binbin Zhou

Since commit 67694c076bd7 ("soc: loongson2_pm: add power management support"), the Loongson-2K PM driver was added, but it didn't update the Kconfig entry for the INPUT dependency, leading to build errors, so update the Kconfig entry to depend on INPUT.

/opt/crosstool/gcc-13.2.0-nolibc/loongarch64-linux/bin/loongarch64-linux-ld:
drivers/soc/loongson/loongson2_pm.o: in function `loongson2_power_button_init':
/work/lnx/next/linux-next-20230825/LOONG64/../drivers/soc/loongson/loongson2_pm.c:101:(.text+0x350): undefined reference to `input_allocate_device' /opt/crosstool/gcc-13.2.0-nolibc/loongarch64-linux/bin/loongarch64-linux-ld:
/work/lnx/next/linux-next-20230825/LOONG64/../drivers/soc/loongson/loongson2_pm.c:109:(.text+0x3dc): undefined reference to `input_set_capability' /opt/crosstool/gcc-13.2.0-nolibc/loongarch64-linux/bin/loongarch64-linux-ld:
/work/lnx/next/linux-next-20230825/LOONG64/../drivers/soc/loongson/loongson2_pm.c:111:(.text+0x3e4): undefined reference to `input_register_device' /opt/crosstool/gcc-13.2.0-nolibc/loongarch64-linux/bin/loongarch64-linux-ld:
/work/lnx/next/linux-next-20230825/LOONG64/../drivers/soc/loongson/loongson2_pm.c:125:(.text+0x3fc): undefined reference to input_free_device' /opt/crosstool/gcc-13.2.0-nolibc/loongarch64-linux/bin/loongarch64-linux-ld: drivers/soc/loongson/loongson2_pm.o: in function input_report_key':
/work/lnx/next/linux-next-20230825/LOONG64/../include/linux/input.h:425:(.text+0x58c): undefined reference to `input_event'

---
 drivers/soc/loongson/Kconfig | 1 +
 1 file changed, 1 insertion(+)
drivers/soc/loongson/Kconfig +0 -0
index 314e13bb3e01..368344943a93 100644

drivers/soc/loongson/Kconfig config LOONGSON2_GUTS · line 23

Quoted 4 lines
drivers/soc/loongson/Kconfig +1 -0
@@ -20,6 +20,7 @@ config LOONGSON2_GUTS
 config LOONGSON2_PM
 	bool "Loongson-2 SoC Power Management Controller Driver"
 	depends on LOONGARCH && OF
+	depends on INPUT=y

Your commit message should say why INPUT needs to not be a module.

Quoted 6 lines
drivers/soc/loongson/Kconfig +0 -0
 	help
 	  The Loongson-2's power management controller was ACPI, supports ACPI
 	  S2Idle (Suspend To Idle), ACPI S3 (Suspend To RAM), ACPI S4 (Suspend To
Signature · 1 line
2.39.3
#3 lore raw

PATCH v2 2/5 dt-bindings: soc: loongson,ls2k-pmc: Use fallbacks for ls2k-pmc compatible

In reply to Binbin Zhou

The Loongson-2K series chips (ls2k0500/ls2k1000/ls2k2000) share the same PM system controller, using ls2k0500 compatible as fallback for the others.

---
 .../soc/loongson/loongson,ls2k-pmc.yaml         | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)
Documentation/devicetree/bindings/soc/loongson/loongson,ls2k-pmc.yaml +11 -6
index da2dcfeebf12..c45f5e7fc0e6 100644
@@ -11,11 +11,16 @@ maintainers:
 
 properties:
   compatible:
-    items:
-      - enum:
-          - loongson,ls2k0500-pmc
-          - loongson,ls2k1000-pmc
-      - const: syscon
+    oneOf:
+      - items:
+          - const: loongson,ls2k0500-pmc
+          - const: syscon
+      - items:
+          - enum:
+              - loongson,ls2k1000-pmc
+              - loongson,ls2k2000-pmc
+          - const: loongson,ls2k0500-pmc
+          - const: syscon
 
   reg:
     maxItems: 1
@@ -44,7 +49,7 @@ examples:
     #include <dt-bindings/interrupt-controller/irq.h>
 
     power-management@1fe27000 {
-        compatible = "loongson,ls2k1000-pmc", "syscon";
+        compatible = "loongson,ls2k1000-pmc", "loongson,ls2k0500-pmc", "syscon";
         reg = <0x1fe27000 0x58>;
         interrupt-parent = <&liointc1>;
         interrupts = <11 IRQ_TYPE_LEVEL_LOW>;
Signature · 1 line
2.39.3
Acked-by on v2 2/5
#4 lore raw

Re: [PATCH v2 2/5] dt-bindings: soc: loongson,ls2k-pmc: Use fallbacks for ls2k-pmc compatible

Quoted 5 lines · Binbin Zhou

The Loongson-2K series chips (ls2k0500/ls2k1000/ls2k2000) share the same PM system controller, using ls2k0500 compatible as fallback for the others.

Thanks,
Conor.

Quoted 42 lines
---
 .../soc/loongson/loongson,ls2k-pmc.yaml         | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)
Documentation/devicetree/bindings/soc/loongson/loongson,ls2k-pmc.yaml +11 -6
index da2dcfeebf12..c45f5e7fc0e6 100644
@@ -11,11 +11,16 @@ maintainers:
 
 properties:
   compatible:
-    items:
-      - enum:
-          - loongson,ls2k0500-pmc
-          - loongson,ls2k1000-pmc
-      - const: syscon
+    oneOf:
+      - items:
+          - const: loongson,ls2k0500-pmc
+          - const: syscon
+      - items:
+          - enum:
+              - loongson,ls2k1000-pmc
+              - loongson,ls2k2000-pmc
+          - const: loongson,ls2k0500-pmc
+          - const: syscon
 
   reg:
     maxItems: 1
@@ -44,7 +49,7 @@ examples:
     #include <dt-bindings/interrupt-controller/irq.h>
 
     power-management@1fe27000 {
-        compatible = "loongson,ls2k1000-pmc", "syscon";
+        compatible = "loongson,ls2k1000-pmc", "loongson,ls2k0500-pmc", "syscon";
         reg = <0x1fe27000 0x58>;
         interrupt-parent = <&liointc1>;
         interrupts = <11 IRQ_TYPE_LEVEL_LOW>;
Signature · 1 line
2.39.3
#5 lore raw

PATCH v2 3/5 soc: loongson: loongson_pm2: Drop useless of_device_id compatible

In reply to Binbin Zhou

Now, "loongson,ls2k0500-pmc" is used as fallback compatible, so the ls2k1000 compatible in the driver can be dropped directly.

---
 drivers/soc/loongson/loongson2_pm.c | 1 -
 1 file changed, 1 deletion(-)
drivers/soc/loongson/loongson2_pm.c +0 -1
index 796add6e8b63..5ffb77afd9eb 100644
@@ -197,7 +197,6 @@ static int loongson2_pm_probe(struct platform_device *pdev)
 
 static const struct of_device_id loongson2_pm_match[] = {
 	{ .compatible = "loongson,ls2k0500-pmc", },
-	{ .compatible = "loongson,ls2k1000-pmc", },
 	{},
 };
 
Signature · 1 line
2.39.3
#6 lore raw

Re: [PATCH v2 3/5] soc: loongson: loongson_pm2: Drop useless of_device_id compatible

Quoted 13 lines · Binbin Zhou

Now, "loongson,ls2k0500-pmc" is used as fallback compatible, so the ls2k1000 compatible in the driver can be dropped directly.

---
 drivers/soc/loongson/loongson2_pm.c | 1 -
 1 file changed, 1 deletion(-)
drivers/soc/loongson/loongson2_pm.c +0 -0
index 796add6e8b63..5ffb77afd9eb 100644

drivers/soc/loongson/loongson2_pm.c static int loongson2_pm_probe(struct platform_device *pdev) · line 200

Quoted 4 lines
drivers/soc/loongson/loongson2_pm.c +0 -1
@@ -197,7 +197,6 @@ static int loongson2_pm_probe(struct platform_device *pdev)
 
 static const struct of_device_id loongson2_pm_match[] = {
 	{ .compatible = "loongson,ls2k0500-pmc", },
-	{ .compatible = "loongson,ls2k1000-pmc", },

What about older devicetrees that do not have the fallback? Aren't you going to remove support for those?

Quoted 6 lines
drivers/soc/loongson/loongson2_pm.c +0 -0
 	{},
 };
 
Signature · 1 line
2.39.3
#7 lore raw

Re: [PATCH v2 3/5] soc: loongson: loongson_pm2: Drop useless of_device_id compatible

Hi Conor:

Thanks for your reply.

Quoted 16 lines · Conor Dooley
Quoted 14 lines · Binbin Zhou

Now, "loongson,ls2k0500-pmc" is used as fallback compatible, so the ls2k1000 compatible in the driver can be dropped directly.

---
 drivers/soc/loongson/loongson2_pm.c | 1 -
 1 file changed, 1 deletion(-)
drivers/soc/loongson/loongson2_pm.c +0 -0
index 796add6e8b63..5ffb77afd9eb 100644
@@ -197,7 +197,6 @@ static int loongson2_pm_probe(struct platform_device *pdev)
 
Quoted 6 lines

drivers/soc/loongson/loongson2_pm.c static int loongson2_pm_probe(struct platform_device *pdev) · line 200

Quoted 3 lines
drivers/soc/loongson/loongson2_pm.c +0 -1
 static const struct of_device_id loongson2_pm_match[] = {
      { .compatible = "loongson,ls2k0500-pmc", },
-     { .compatible = "loongson,ls2k1000-pmc", },

What about older devicetrees that do not have the fallback? Aren't you going to remove support for those?

This driver was just merged in during the v6.6 window, and no release will use it until now.

commit 67694c076bd7 soc: loongson2_pm: add power management support commit 6054a676e969 soc: dt-bindings: add loongson-2 pm

Of course, it was our mistake not to make better use of fallback compatible when submitting the driver, and we hope to fix this mistake soon.
Also, this driver will only be used by the LoongArch architecture, no need to worry about other architectures.

Thanks.
Binbin

Quoted 7 lines
Quoted 7 lines
drivers/soc/loongson/loongson2_pm.c +0 -1
      {},
 };
 
--

2.39.3

#8 lore raw

Re: [PATCH v2 3/5] soc: loongson: loongson_pm2: Drop useless of_device_id compatible

Quoted 28 lines · Binbin Zhou

Hi Conor:

Thanks for your reply.

Quoted 16 lines · Conor Dooley
Quoted 14 lines · Binbin Zhou

Now, "loongson,ls2k0500-pmc" is used as fallback compatible, so the ls2k1000 compatible in the driver can be dropped directly.

---
 drivers/soc/loongson/loongson2_pm.c | 1 -
 1 file changed, 1 deletion(-)
drivers/soc/loongson/loongson2_pm.c +0 -0
index 796add6e8b63..5ffb77afd9eb 100644
@@ -197,7 +197,6 @@ static int loongson2_pm_probe(struct platform_device *pdev)
 
Quoted 6 lines

drivers/soc/loongson/loongson2_pm.c static int loongson2_pm_probe(struct platform_device *pdev) · line 200

Quoted 3 lines
drivers/soc/loongson/loongson2_pm.c +0 -1
 static const struct of_device_id loongson2_pm_match[] = {
      { .compatible = "loongson,ls2k0500-pmc", },
-     { .compatible = "loongson,ls2k1000-pmc", },

What about older devicetrees that do not have the fallback? Aren't you going to remove support for those?

Quoted 2 lines

This driver was just merged in during the v6.6 window, and no release will use it until now.

Ahh, thanks for the info. Your commits 1-3 should then all have Fixes:
tags pointing to the commits tat introduced the problems, if you intend getting these applied as fixes before v6.6 gets released.

Thanks,
Conor.

Quoted 18 lines

commit 67694c076bd7 soc: loongson2_pm: add power management support commit 6054a676e969 soc: dt-bindings: add loongson-2 pm

Of course, it was our mistake not to make better use of fallback compatible when submitting the driver, and we hope to fix this mistake soon.
Also, this driver will only be used by the LoongArch architecture, no need to worry about other architectures.

Thanks.
Binbin

Quoted 7 lines
Quoted 7 lines
drivers/soc/loongson/loongson2_pm.c +0 -1
      {},
 };
 
--

2.39.3

#9 lore raw

PATCH v2 4/5 dt-bindings: soc: loongson,ls2k-pmc: Allow syscon-reboot/syscon-poweroff as child

In reply to Binbin Zhou

The reboot and poweroff features are actually part of the Power Management Unit system controller, thus allow them as its children, instead of specifying as separate device nodes with syscon phandle.

Without it, the reboot/poweroff feature becomes unavailable.

---
 .../soc/loongson/loongson,ls2k-pmc.yaml       | 26 +++++++++++++++++++
 1 file changed, 26 insertions(+)
Documentation/devicetree/bindings/soc/loongson/loongson,ls2k-pmc.yaml +26 -0
index c45f5e7fc0e6..510f6cb0f084 100644
@@ -37,6 +37,18 @@ properties:
       addition, the PM need according to it to indicate that current
       SoC whether support Suspend To RAM.
 
+  syscon-poweroff:
+    $ref: /schemas/power/reset/syscon-poweroff.yaml#
+    type: object
+    description:
+      Node for power off method
+
+  syscon-reboot:
+    $ref: /schemas/power/reset/syscon-reboot.yaml#
+    type: object
+    description:
+      Node for reboot method
+
 required:
   - compatible
   - reg
@@ -54,4 +66,18 @@ examples:
         interrupt-parent = <&liointc1>;
         interrupts = <11 IRQ_TYPE_LEVEL_LOW>;
         loongson,suspend-address = <0x0 0x1c000500>;
+
+        syscon-reboot {
+            compatible = "syscon-reboot";
+            offset = <0x30>;
+            mask = <0x1>;
+        };
+
+        syscon-poweroff {
+            compatible = "syscon-poweroff";
+            regmap = <&pmc>;
+            offset = <0x14>;
+            mask = <0x3c00>;
+            value = <0x3c00>;
+        };
     };
Signature · 1 line
2.39.3
#10 lore raw

Re: [PATCH v2 4/5] dt-bindings: soc: loongson,ls2k-pmc: Allow syscon-reboot/syscon-poweroff as child

Quoted 7 lines · Binbin Zhou

required:
- compatible
- reg

Documentation/devicetree/bindings/soc/loongson/loongson,ls2k-pmc.yaml +0 -0
@@ -54,4 +66,18 @@ examples:
         interrupt-parent = <&liointc1>;
         interrupts = <11 IRQ_TYPE_LEVEL_LOW>;
         loongson,suspend-address = <0x0 0x1c000500>;

Documentation/devicetree/bindings/soc/loongson/loongson,ls2k-pmc.yaml examples: · line 78

Quoted 10 lines
Documentation/devicetree/bindings/soc/loongson/loongson,ls2k-pmc.yaml +10 -0
+
+        syscon-reboot {
+            compatible = "syscon-reboot";
+            offset = <0x30>;
+            mask = <0x1>;
+        };
+
+        syscon-poweroff {
+            compatible = "syscon-poweroff";
+            regmap = <&pmc>;

???

This is a friendly reminder during the review process.

It seems my previous comments were not fully addressed. Maybe my feedback got lost between the quotes, maybe you just forgot to apply it. Please go back to the previous discussion and either implement all requested changes or keep discussing them.

Thank you.

Best regards,
Krzysztof

#11 lore raw

Re: [PATCH v2 4/5] dt-bindings: soc: loongson,ls2k-pmc: Allow syscon-reboot/syscon-poweroff as child

Hi Krzysztof:

Quoted 13 lines · Krzysztof Kozlowski
Quoted 11 lines · Binbin Zhou

required:
- compatible
- reg

Documentation/devicetree/bindings/soc/loongson/loongson,ls2k-pmc.yaml +4 -0
@@ -54,4 +66,18 @@ examples:
         interrupt-parent = <&liointc1>;
         interrupts = <11 IRQ_TYPE_LEVEL_LOW>;
         loongson,suspend-address = <0x0 0x1c000500>;
+
+        syscon-reboot {
+            compatible = "syscon-reboot";
+            offset = <0x30>;
Quoted 8 lines

Documentation/devicetree/bindings/soc/loongson/loongson,ls2k-pmc.yaml examples: · line 78

Quoted 6 lines
Documentation/devicetree/bindings/soc/loongson/loongson,ls2k-pmc.yaml +6 -0
+            mask = <0x1>;
+        };
+
+        syscon-poweroff {
+            compatible = "syscon-poweroff";
+            regmap = <&pmc>;

???

I did notice that commit [1] changed "regmap" to "unrequired" for "syscon-reboot", but "syscon-poweroff" did not do the same.
So, at least under the current "syscon-poweroff" rule, "regmap" is "required".

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/power/reset/syscon-poweroff.yaml?h=v6.5#n41

I had my doubts before, but seeing that some dts do have "syscon-poweroff" as a separate node, I assumed there was a difference.

commit[1]: 2140d68d69d4 dt-bindings: power: reset: Unrequired regmap property in syscon-reboot node

Thanks.
Binbin

Quoted 13 lines

This is a friendly reminder during the review process.

It seems my previous comments were not fully addressed. Maybe my feedback got lost between the quotes, maybe you just forgot to apply it. Please go back to the previous discussion and either implement all requested changes or keep discussing them.

Thank you.

Best regards,
Krzysztof

#12 lore raw

Re: [PATCH v2 4/5] dt-bindings: soc: loongson,ls2k-pmc: Allow syscon-reboot/syscon-poweroff as child

Quoted 31 lines · Binbin Zhou

Hi Krzysztof:

Quoted 13 lines · Krzysztof Kozlowski
Quoted 11 lines · Binbin Zhou

required:
- compatible
- reg

Documentation/devicetree/bindings/soc/loongson/loongson,ls2k-pmc.yaml +4 -0
@@ -54,4 +66,18 @@ examples:
         interrupt-parent = <&liointc1>;
         interrupts = <11 IRQ_TYPE_LEVEL_LOW>;
         loongson,suspend-address = <0x0 0x1c000500>;
+
+        syscon-reboot {
+            compatible = "syscon-reboot";
+            offset = <0x30>;
Quoted 8 lines

Documentation/devicetree/bindings/soc/loongson/loongson,ls2k-pmc.yaml examples: · line 78

Quoted 6 lines
Documentation/devicetree/bindings/soc/loongson/loongson,ls2k-pmc.yaml +6 -0
+            mask = <0x1>;
+        };
+
+        syscon-poweroff {
+            compatible = "syscon-poweroff";
+            regmap = <&pmc>;

???

I did notice that commit [1] changed "regmap" to "unrequired" for "syscon-reboot", but "syscon-poweroff" did not do the same.
So, at least under the current "syscon-poweroff" rule, "regmap" is "required".

Quoted 9 lines

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/power/reset/syscon-poweroff.yaml?h=v6.5#n41

I had my doubts before, but seeing that some dts do have "syscon-poweroff" as a separate node, I assumed there was a difference.

commit[1]: 2140d68d69d4 dt-bindings: power: reset: Unrequired regmap property in syscon-reboot node

You are right. I wonder why Serge did not change others.

Looks good, thanks for clarification.

Best regards,
Krzysztof

#13 lore raw

PATCH v2 5/5 soc: loongson: loongson_pm2: Populate children syscon nodes

In reply to Binbin Zhou

The syscon poweroff and reboot nodes logically belong to the Power Management Unit so populate possible children.

Without it, the reboot/poweroff feature becomes unavailable.

---
 drivers/soc/loongson/loongson2_pm.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/soc/loongson/loongson2_pm.c +6 -0
index 5ffb77afd9eb..b8e5e1e3528a 100644
@@ -11,6 +11,7 @@
 #include <linux/input.h>
 #include <linux/suspend.h>
 #include <linux/interrupt.h>
+#include <linux/of_platform.h>
 #include <linux/pm_wakeirq.h>
 #include <linux/platform_device.h>
 #include <asm/bootinfo.h>
@@ -192,6 +193,11 @@ static int loongson2_pm_probe(struct platform_device *pdev)
 	if (loongson_sysconf.suspend_addr)
 		suspend_set_ops(&loongson2_suspend_ops);
 
+	/* Populate children */
+	retval = devm_of_platform_populate(dev);
+	if (retval)
+		dev_err(dev, "Error populating children, reboot and poweroff might not work properly\n");
+
 	return 0;
 }
 
Signature · 1 line
2.39.3
#14 lore raw
In reply to Binbin Zhou
This series was applied to soc/soc.git (arm/fixes) by Arnd Bergmann <[email protected]>:

Hello:

This series was applied to soc/soc.git (arm/fixes) by Arnd Bergmann <[email protected]>:

Quoted 6 lines · On Thu, 31 Aug 2023 19:43:10 +0800 you wrote:

Hi all:

Since commit 67694c076bd7 ("soc: loongson2_pm: add power management support"), the Loongson-2K PM driver was added, some issues have been found and this patchset is planned to fix these issues.

Quoted 8 lines

Specific:
Patch 1: Compilation error found by Randy;
Patch 2/3: Rewriting the ls2k-pmc compatible attribute with fallback compatible;
Patch 4/5: Add Loongson-2K SoC reboot/shutdown support as part of power management.

[...]

Here is the summary with links:
- [v2,1/5] soc: loongson: loongson_pm2: Add dependency for INPUT

    https://git.kernel.org/soc/soc/c/9a7c9c7e34ac
  - [v2,2/5] dt-bindings: soc: loongson,ls2k-pmc: Use fallbacks for ls2k-pmc compatible
    https://git.kernel.org/soc/soc/c/8e5f17483ab4
  - [v2,3/5] soc: loongson: loongson_pm2: Drop useless of_device_id compatible
    https://git.kernel.org/soc/soc/c/59598d7ba6a8
  - [v2,4/5] dt-bindings: soc: loongson,ls2k-pmc: Allow syscon-reboot/syscon-poweroff as child
    https://git.kernel.org/soc/soc/c/019d79fe6c3d
  - [v2,5/5] soc: loongson: loongson_pm2: Populate children syscon nodes
    https://git.kernel.org/soc/soc/c/4e7b558e320a

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html