soc.lore.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/5] soc: loongson: Fix some issues about loongson2_pm
@ 2023-09-02  8:47 Binbin Zhou
  2023-09-02  8:47 ` [PATCH v3 1/5] soc: loongson: loongson2_pm: Add dependency for INPUT Binbin Zhou
                   ` (5 more replies)
  0 siblings, 6 replies; 13+ messages in thread
From: Binbin Zhou @ 2023-09-02  8:47 UTC (permalink / raw)
  To: Binbin Zhou, Huacai Chen, Yinbo Zhu, Arnd Bergmann, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley
  Cc: Huacai Chen, loongson-kernel, soc, devicetree, linux-pm,
	Xuerui Wang, loongarch, Binbin Zhou

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.

-----
V3:
- Changes "loongson_pm2" to "loongson2_pm" in all subject lines.
  Sorry, it was a clerical error.
patch 1:
  - Add Fixes tag;
  - Update commit message.
patch 2:
  - Add Fixes and Acked-by tag.
patch 3:
  - Add Fixes tag;
patch 4:
  - Add Reviewed-by tag.

Link to V2:
https://lore.kernel.org/all/cover.1693474728.git.zhoubinbin@loongson.cn/

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/cover.1693218539.git.zhoubinbin@loongson.cn/

Binbin Zhou (5):
  soc: loongson: loongson2_pm: Add dependency for INPUT
  dt-bindings: soc: loongson,ls2k-pmc: Use fallbacks for ls2k-pmc
    compatible
  soc: loongson: loongson2_pm: Drop useless of_device_id compatible
  dt-bindings: soc: loongson,ls2k-pmc: Allow
    syscon-reboot/syscon-poweroff as child
  soc: loongson: loongson2_pm: 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(-)

-- 
2.39.3


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH v3 1/5] soc: loongson: loongson2_pm: Add dependency for INPUT
  2023-09-02  8:47 [PATCH v3 0/5] soc: loongson: Fix some issues about loongson2_pm Binbin Zhou
@ 2023-09-02  8:47 ` Binbin Zhou
  2023-09-02 15:43   ` Randy Dunlap
  2023-09-02  8:47 ` [PATCH v3 2/5] dt-bindings: soc: loongson,ls2k-pmc: Use fallbacks for ls2k-pmc compatible Binbin Zhou
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 13+ messages in thread
From: Binbin Zhou @ 2023-09-02  8:47 UTC (permalink / raw)
  To: Binbin Zhou, Huacai Chen, Yinbo Zhu, Arnd Bergmann, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley
  Cc: Huacai Chen, loongson-kernel, soc, devicetree, linux-pm,
	Xuerui Wang, loongarch, Binbin Zhou, Randy Dunlap

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:

/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'

Also, since this driver can only be built-in, it fails to link when the
INPUT is in a loadable module, so we should update the Kconfig entry to
depend on INPUT=y.

Fixes: 67694c076bd7 ("soc: loongson2_pm: add power management support")
Reported-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>
---
 drivers/soc/loongson/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/soc/loongson/Kconfig b/drivers/soc/loongson/Kconfig
index 314e13bb3e01..368344943a93 100644
--- a/drivers/soc/loongson/Kconfig
+++ b/drivers/soc/loongson/Kconfig
@@ -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
-- 
2.39.3


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH v3 2/5] dt-bindings: soc: loongson,ls2k-pmc: Use fallbacks for ls2k-pmc compatible
  2023-09-02  8:47 [PATCH v3 0/5] soc: loongson: Fix some issues about loongson2_pm Binbin Zhou
  2023-09-02  8:47 ` [PATCH v3 1/5] soc: loongson: loongson2_pm: Add dependency for INPUT Binbin Zhou
@ 2023-09-02  8:47 ` Binbin Zhou
  2023-09-02  8:47 ` [PATCH v3 3/5] soc: loongson: loongson2_pm: Drop useless of_device_id compatible Binbin Zhou
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 13+ messages in thread
From: Binbin Zhou @ 2023-09-02  8:47 UTC (permalink / raw)
  To: Binbin Zhou, Huacai Chen, Yinbo Zhu, Arnd Bergmann, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley
  Cc: Huacai Chen, loongson-kernel, soc, devicetree, linux-pm,
	Xuerui Wang, loongarch, Binbin Zhou, Conor Dooley

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

Fixes: 6054a676e969 ("soc: dt-bindings: add loongson-2 pm")
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>
---
 .../soc/loongson/loongson,ls2k-pmc.yaml         | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/Documentation/devicetree/bindings/soc/loongson/loongson,ls2k-pmc.yaml b/Documentation/devicetree/bindings/soc/loongson/loongson,ls2k-pmc.yaml
index da2dcfeebf12..c45f5e7fc0e6 100644
--- a/Documentation/devicetree/bindings/soc/loongson/loongson,ls2k-pmc.yaml
+++ b/Documentation/devicetree/bindings/soc/loongson/loongson,ls2k-pmc.yaml
@@ -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>;
-- 
2.39.3


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH v3 3/5] soc: loongson: loongson2_pm: Drop useless of_device_id compatible
  2023-09-02  8:47 [PATCH v3 0/5] soc: loongson: Fix some issues about loongson2_pm Binbin Zhou
  2023-09-02  8:47 ` [PATCH v3 1/5] soc: loongson: loongson2_pm: Add dependency for INPUT Binbin Zhou
  2023-09-02  8:47 ` [PATCH v3 2/5] dt-bindings: soc: loongson,ls2k-pmc: Use fallbacks for ls2k-pmc compatible Binbin Zhou
@ 2023-09-02  8:47 ` Binbin Zhou
  2023-09-02  8:47 ` [PATCH v3 4/5] dt-bindings: soc: loongson,ls2k-pmc: Allow syscon-reboot/syscon-poweroff as child Binbin Zhou
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 13+ messages in thread
From: Binbin Zhou @ 2023-09-02  8:47 UTC (permalink / raw)
  To: Binbin Zhou, Huacai Chen, Yinbo Zhu, Arnd Bergmann, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley
  Cc: Huacai Chen, loongson-kernel, soc, devicetree, linux-pm,
	Xuerui Wang, loongarch, Binbin Zhou

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

Fixes: 67694c076bd7 ("soc: loongson2_pm: add power management support")
Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>
---
 drivers/soc/loongson/loongson2_pm.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/soc/loongson/loongson2_pm.c b/drivers/soc/loongson/loongson2_pm.c
index 796add6e8b63..5ffb77afd9eb 100644
--- a/drivers/soc/loongson/loongson2_pm.c
+++ b/drivers/soc/loongson/loongson2_pm.c
@@ -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", },
 	{},
 };
 
-- 
2.39.3


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH v3 4/5] dt-bindings: soc: loongson,ls2k-pmc: Allow syscon-reboot/syscon-poweroff as child
  2023-09-02  8:47 [PATCH v3 0/5] soc: loongson: Fix some issues about loongson2_pm Binbin Zhou
                   ` (2 preceding siblings ...)
  2023-09-02  8:47 ` [PATCH v3 3/5] soc: loongson: loongson2_pm: Drop useless of_device_id compatible Binbin Zhou
@ 2023-09-02  8:47 ` Binbin Zhou
  2023-09-02  8:47 ` [PATCH v3 5/5] soc: loongson: loongson2_pm: Populate children syscon nodes Binbin Zhou
  2023-09-26 21:03 ` [PATCH v3 0/5] soc: loongson: Fix some issues about loongson2_pm patchwork-bot+linux-soc
  5 siblings, 0 replies; 13+ messages in thread
From: Binbin Zhou @ 2023-09-02  8:47 UTC (permalink / raw)
  To: Binbin Zhou, Huacai Chen, Yinbo Zhu, Arnd Bergmann, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley
  Cc: Huacai Chen, loongson-kernel, soc, devicetree, linux-pm,
	Xuerui Wang, loongarch, Binbin Zhou, Krzysztof Kozlowski

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.

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>
---
 .../soc/loongson/loongson,ls2k-pmc.yaml       | 26 +++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/Documentation/devicetree/bindings/soc/loongson/loongson,ls2k-pmc.yaml b/Documentation/devicetree/bindings/soc/loongson/loongson,ls2k-pmc.yaml
index c45f5e7fc0e6..510f6cb0f084 100644
--- a/Documentation/devicetree/bindings/soc/loongson/loongson,ls2k-pmc.yaml
+++ b/Documentation/devicetree/bindings/soc/loongson/loongson,ls2k-pmc.yaml
@@ -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>;
+        };
     };
-- 
2.39.3


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH v3 5/5] soc: loongson: loongson2_pm: Populate children syscon nodes
  2023-09-02  8:47 [PATCH v3 0/5] soc: loongson: Fix some issues about loongson2_pm Binbin Zhou
                   ` (3 preceding siblings ...)
  2023-09-02  8:47 ` [PATCH v3 4/5] dt-bindings: soc: loongson,ls2k-pmc: Allow syscon-reboot/syscon-poweroff as child Binbin Zhou
@ 2023-09-02  8:47 ` Binbin Zhou
  2023-09-26 21:03 ` [PATCH v3 0/5] soc: loongson: Fix some issues about loongson2_pm patchwork-bot+linux-soc
  5 siblings, 0 replies; 13+ messages in thread
From: Binbin Zhou @ 2023-09-02  8:47 UTC (permalink / raw)
  To: Binbin Zhou, Huacai Chen, Yinbo Zhu, Arnd Bergmann, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley
  Cc: Huacai Chen, loongson-kernel, soc, devicetree, linux-pm,
	Xuerui Wang, loongarch, 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.

Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>
---
 drivers/soc/loongson/loongson2_pm.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/soc/loongson/loongson2_pm.c b/drivers/soc/loongson/loongson2_pm.c
index 5ffb77afd9eb..b8e5e1e3528a 100644
--- a/drivers/soc/loongson/loongson2_pm.c
+++ b/drivers/soc/loongson/loongson2_pm.c
@@ -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;
 }
 
-- 
2.39.3


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH v3 1/5] soc: loongson: loongson2_pm: Add dependency for INPUT
  2023-09-02  8:47 ` [PATCH v3 1/5] soc: loongson: loongson2_pm: Add dependency for INPUT Binbin Zhou
@ 2023-09-02 15:43   ` Randy Dunlap
  2023-09-19 15:36     ` Randy Dunlap
  0 siblings, 1 reply; 13+ messages in thread
From: Randy Dunlap @ 2023-09-02 15:43 UTC (permalink / raw)
  To: Binbin Zhou, Binbin Zhou, Huacai Chen, Yinbo Zhu, Arnd Bergmann,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley
  Cc: Huacai Chen, loongson-kernel, soc, devicetree, linux-pm,
	Xuerui Wang, loongarch



On 9/2/23 01:47, Binbin Zhou wrote:
> 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:
> 
> /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'
> 
> Also, since this driver can only be built-in, it fails to link when the
> INPUT is in a loadable module, so we should update the Kconfig entry to
> depend on INPUT=y.
> 
> Fixes: 67694c076bd7 ("soc: loongson2_pm: add power management support")
> Reported-by: Randy Dunlap <rdunlap@infradead.org>
> Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>

Reviewed-by: Randy Dunlap <rdunlap@infradead.org>
Tested-by: Randy Dunlap <rdunlap@infradead.org>

Thanks.

> ---
>  drivers/soc/loongson/Kconfig | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/soc/loongson/Kconfig b/drivers/soc/loongson/Kconfig
> index 314e13bb3e01..368344943a93 100644
> --- a/drivers/soc/loongson/Kconfig
> +++ b/drivers/soc/loongson/Kconfig
> @@ -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

-- 
~Randy

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v3 1/5] soc: loongson: loongson2_pm: Add dependency for INPUT
  2023-09-02 15:43   ` Randy Dunlap
@ 2023-09-19 15:36     ` Randy Dunlap
  2023-09-19 15:48       ` Conor Dooley
  0 siblings, 1 reply; 13+ messages in thread
From: Randy Dunlap @ 2023-09-19 15:36 UTC (permalink / raw)
  To: Binbin Zhou, Binbin Zhou, Huacai Chen, Yinbo Zhu, Arnd Bergmann,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley
  Cc: Huacai Chen, loongson-kernel, soc, devicetree, linux-pm,
	Xuerui Wang, loongarch

Hi--

On 9/2/23 08:43, Randy Dunlap wrote:
> 
> 
> On 9/2/23 01:47, Binbin Zhou wrote:
>> 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:
>>
>> /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'
>>
>> Also, since this driver can only be built-in, it fails to link when the
>> INPUT is in a loadable module, so we should update the Kconfig entry to
>> depend on INPUT=y.
>>
>> Fixes: 67694c076bd7 ("soc: loongson2_pm: add power management support")
>> Reported-by: Randy Dunlap <rdunlap@infradead.org>
>> Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>
> 
> Reviewed-by: Randy Dunlap <rdunlap@infradead.org>
> Tested-by: Randy Dunlap <rdunlap@infradead.org>
> 
> Thanks.

What's the status of this patch?
linux-next builds are still failing without this patch.

Thanks.

> 
>> ---
>>  drivers/soc/loongson/Kconfig | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/soc/loongson/Kconfig b/drivers/soc/loongson/Kconfig
>> index 314e13bb3e01..368344943a93 100644
>> --- a/drivers/soc/loongson/Kconfig
>> +++ b/drivers/soc/loongson/Kconfig
>> @@ -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
> 

-- 
~Randy

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v3 1/5] soc: loongson: loongson2_pm: Add dependency for INPUT
  2023-09-19 15:36     ` Randy Dunlap
@ 2023-09-19 15:48       ` Conor Dooley
  2023-09-19 16:15         ` Huacai Chen
  0 siblings, 1 reply; 13+ messages in thread
From: Conor Dooley @ 2023-09-19 15:48 UTC (permalink / raw)
  To: Randy Dunlap
  Cc: Binbin Zhou, Binbin Zhou, Huacai Chen, Yinbo Zhu, Arnd Bergmann,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Huacai Chen,
	loongson-kernel, soc, devicetree, linux-pm, Xuerui Wang,
	loongarch

[-- Attachment #1: Type: text/plain, Size: 3403 bytes --]

On Tue, Sep 19, 2023 at 08:36:50AM -0700, Randy Dunlap wrote:
> Hi--
> 
> On 9/2/23 08:43, Randy Dunlap wrote:
> > 
> > 
> > On 9/2/23 01:47, Binbin Zhou wrote:
> >> 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:
> >>
> >> /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'
> >>
> >> Also, since this driver can only be built-in, it fails to link when the
> >> INPUT is in a loadable module, so we should update the Kconfig entry to
> >> depend on INPUT=y.
> >>
> >> Fixes: 67694c076bd7 ("soc: loongson2_pm: add power management support")
> >> Reported-by: Randy Dunlap <rdunlap@infradead.org>
> >> Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>
> > 
> > Reviewed-by: Randy Dunlap <rdunlap@infradead.org>
> > Tested-by: Randy Dunlap <rdunlap@infradead.org>
> > 
> > Thanks.
> 
> What's the status of this patch?
> linux-next builds are still failing without this patch.

Likely suffering (still) from:

https://lore.kernel.org/all/58500dc7-af1b-4edb-bb2b-93be454ec151@app.fastmail.com/

:)

Seemingly this was sent again in isolation 2 weeks ago, but neither the
maintainer (Huacai) nor soc@kernel.org were on cc:

https://lore.kernel.org/all/20230905123629.4510-1-zhuyinbo@loongson.cn/

/shrug
Conor.

> 
> Thanks.
> 
> > 
> >> ---
> >>  drivers/soc/loongson/Kconfig | 1 +
> >>  1 file changed, 1 insertion(+)
> >>
> >> diff --git a/drivers/soc/loongson/Kconfig b/drivers/soc/loongson/Kconfig
> >> index 314e13bb3e01..368344943a93 100644
> >> --- a/drivers/soc/loongson/Kconfig
> >> +++ b/drivers/soc/loongson/Kconfig
> >> @@ -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
> > 
> 
> -- 
> ~Randy

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v3 1/5] soc: loongson: loongson2_pm: Add dependency for INPUT
  2023-09-19 15:48       ` Conor Dooley
@ 2023-09-19 16:15         ` Huacai Chen
  2023-09-22 14:42           ` Arnd Bergmann
  0 siblings, 1 reply; 13+ messages in thread
From: Huacai Chen @ 2023-09-19 16:15 UTC (permalink / raw)
  To: Conor Dooley
  Cc: Randy Dunlap, Binbin Zhou, Binbin Zhou, Huacai Chen, Yinbo Zhu,
	Arnd Bergmann, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	loongson-kernel, soc, devicetree, linux-pm, Xuerui Wang,
	loongarch

Hi, Conor,

On Tue, Sep 19, 2023 at 11:48 PM Conor Dooley <conor@kernel.org> wrote:
>
> On Tue, Sep 19, 2023 at 08:36:50AM -0700, Randy Dunlap wrote:
> > Hi--
> >
> > On 9/2/23 08:43, Randy Dunlap wrote:
> > >
> > >
> > > On 9/2/23 01:47, Binbin Zhou wrote:
> > >> 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:
> > >>
> > >> /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'
> > >>
> > >> Also, since this driver can only be built-in, it fails to link when the
> > >> INPUT is in a loadable module, so we should update the Kconfig entry to
> > >> depend on INPUT=y.
> > >>
> > >> Fixes: 67694c076bd7 ("soc: loongson2_pm: add power management support")
> > >> Reported-by: Randy Dunlap <rdunlap@infradead.org>
> > >> Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>
> > >
> > > Reviewed-by: Randy Dunlap <rdunlap@infradead.org>
> > > Tested-by: Randy Dunlap <rdunlap@infradead.org>
> > >
> > > Thanks.
> >
> > What's the status of this patch?
> > linux-next builds are still failing without this patch.
>
> Likely suffering (still) from:
>
> https://lore.kernel.org/all/58500dc7-af1b-4edb-bb2b-93be454ec151@app.fastmail.com/
>
> :)
>
> Seemingly this was sent again in isolation 2 weeks ago, but neither the
> maintainer (Huacai) nor soc@kernel.org were on cc:
>
> https://lore.kernel.org/all/20230905123629.4510-1-zhuyinbo@loongson.cn/
v3 indeed cc-ed soc@kernel.org. :)

Arnd, could you please take this series to the soc tree? And also this series:
https://lore.kernel.org/loongarch/cover.1693534134.git.zhoubinbin@loongson.cn/T/#t

Thanks,
Huacai

>
> /shrug
> Conor.
>
> >
> > Thanks.
> >
> > >
> > >> ---
> > >>  drivers/soc/loongson/Kconfig | 1 +
> > >>  1 file changed, 1 insertion(+)
> > >>
> > >> diff --git a/drivers/soc/loongson/Kconfig b/drivers/soc/loongson/Kconfig
> > >> index 314e13bb3e01..368344943a93 100644
> > >> --- a/drivers/soc/loongson/Kconfig
> > >> +++ b/drivers/soc/loongson/Kconfig
> > >> @@ -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
> > >
> >
> > --
> > ~Randy

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v3 1/5] soc: loongson: loongson2_pm: Add dependency for INPUT
  2023-09-19 16:15         ` Huacai Chen
@ 2023-09-22 14:42           ` Arnd Bergmann
  2023-09-24 12:21             ` Binbin Zhou
  0 siblings, 1 reply; 13+ messages in thread
From: Arnd Bergmann @ 2023-09-22 14:42 UTC (permalink / raw)
  To: Huacai Chen, Conor Dooley
  Cc: Randy Dunlap, Binbin Zhou, Binbin Zhou, Huacai Chen, Yinbo Zhu,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, loongson-kernel,
	soc, devicetree, linux-pm, WANG Xuerui, loongarch

On Tue, Sep 19, 2023, at 12:15, Huacai Chen wrote:
> On Tue, Sep 19, 2023 at 11:48 PM Conor Dooley <conor@kernel.org> wrote:
>> On Tue, Sep 19, 2023 at 08:36:50AM -0700, Randy Dunlap wrote:
>>
>> Seemingly this was sent again in isolation 2 weeks ago, but neither the
>> maintainer (Huacai) nor soc@kernel.org were on cc:
>>
>> https://lore.kernel.org/all/20230905123629.4510-1-zhuyinbo@loongson.cn/
> v3 indeed cc-ed soc@kernel.org. :)
>
> Arnd, could you please take this series to the soc tree? And also this 
> series:
> https://lore.kernel.org/loongarch/cover.1693534134.git.zhoubinbin@loongson.cn/T/#t

Sorry, I have been traveling and not pushed out the tree yet.

Can you confirm that the input dependency is required for 6.6
and the other series can wait until 6.7? When you send patches
to soc@kernel.org, please always mention which tree you intend
them for. I might disagree, but it's better than having to guess.

     Arnd

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v3 1/5] soc: loongson: loongson2_pm: Add dependency for INPUT
  2023-09-22 14:42           ` Arnd Bergmann
@ 2023-09-24 12:21             ` Binbin Zhou
  0 siblings, 0 replies; 13+ messages in thread
From: Binbin Zhou @ 2023-09-24 12:21 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Huacai Chen, Conor Dooley, Randy Dunlap, Binbin Zhou,
	Huacai Chen, Yinbo Zhu, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, loongson-kernel, soc, devicetree, linux-pm,
	WANG Xuerui, loongarch

On Fri, Sep 22, 2023 at 10:43 PM Arnd Bergmann <arnd@arndb.de> wrote:
>
> On Tue, Sep 19, 2023, at 12:15, Huacai Chen wrote:
> > On Tue, Sep 19, 2023 at 11:48 PM Conor Dooley <conor@kernel.org> wrote:
> >> On Tue, Sep 19, 2023 at 08:36:50AM -0700, Randy Dunlap wrote:
> >>
> >> Seemingly this was sent again in isolation 2 weeks ago, but neither the
> >> maintainer (Huacai) nor soc@kernel.org were on cc:
> >>
> >> https://lore.kernel.org/all/20230905123629.4510-1-zhuyinbo@loongson.cn/
> > v3 indeed cc-ed soc@kernel.org. :)
> >
> > Arnd, could you please take this series to the soc tree? And also this
> > series:
> > https://lore.kernel.org/loongarch/cover.1693534134.git.zhoubinbin@loongson.cn/T/#t
>
> Sorry, I have been traveling and not pushed out the tree yet.
>
> Can you confirm that the input dependency is required for 6.6
> and the other series can wait until 6.7? When you send patches
> to soc@kernel.org, please always mention which tree you intend
> them for. I might disagree, but it's better than having to guess.
>
Hi Arnd:

Thanks for your reply.

As we know, 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

Now, since the Loongson-2K series SoCs are indifferent at the driver
level, we used fallback compatible and added
syscon-reboot/syscon-poweroff subnodes for power on/off functionality.
These somewhat break the original devicetree rules.
So, I think these patches need to be merged in before the v6.6 release
to avoid unnecessary compatibility issues.
Of course, I added the "Fixes:" tag in the corresponding patch.

Thanks.
Binbin

>      Arnd

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v3 0/5] soc: loongson: Fix some issues about loongson2_pm
  2023-09-02  8:47 [PATCH v3 0/5] soc: loongson: Fix some issues about loongson2_pm Binbin Zhou
                   ` (4 preceding siblings ...)
  2023-09-02  8:47 ` [PATCH v3 5/5] soc: loongson: loongson2_pm: Populate children syscon nodes Binbin Zhou
@ 2023-09-26 21:03 ` patchwork-bot+linux-soc
  5 siblings, 0 replies; 13+ messages in thread
From: patchwork-bot+linux-soc @ 2023-09-26 21:03 UTC (permalink / raw)
  To: Binbin Zhou; +Cc: soc

Hello:

This series was applied to soc/soc.git (arm/fixes)
by Arnd Bergmann <arnd@arndb.de>:

On Sat,  2 Sep 2023 16:47:26 +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.
> 
> 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:
  - [v3,1/5] soc: loongson: loongson2_pm: Add dependency for INPUT
    https://git.kernel.org/soc/soc/c/9a7c9c7e34ac
  - [v3,2/5] dt-bindings: soc: loongson,ls2k-pmc: Use fallbacks for ls2k-pmc compatible
    https://git.kernel.org/soc/soc/c/8e5f17483ab4
  - [v3,3/5] soc: loongson: loongson2_pm: Drop useless of_device_id compatible
    https://git.kernel.org/soc/soc/c/59598d7ba6a8
  - [v3,4/5] dt-bindings: soc: loongson,ls2k-pmc: Allow syscon-reboot/syscon-poweroff as child
    https://git.kernel.org/soc/soc/c/019d79fe6c3d
  - [v3,5/5] soc: loongson: loongson2_pm: Populate children syscon nodes
    https://git.kernel.org/soc/soc/c/4e7b558e320a

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2023-09-26 21:03 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-02  8:47 [PATCH v3 0/5] soc: loongson: Fix some issues about loongson2_pm Binbin Zhou
2023-09-02  8:47 ` [PATCH v3 1/5] soc: loongson: loongson2_pm: Add dependency for INPUT Binbin Zhou
2023-09-02 15:43   ` Randy Dunlap
2023-09-19 15:36     ` Randy Dunlap
2023-09-19 15:48       ` Conor Dooley
2023-09-19 16:15         ` Huacai Chen
2023-09-22 14:42           ` Arnd Bergmann
2023-09-24 12:21             ` Binbin Zhou
2023-09-02  8:47 ` [PATCH v3 2/5] dt-bindings: soc: loongson,ls2k-pmc: Use fallbacks for ls2k-pmc compatible Binbin Zhou
2023-09-02  8:47 ` [PATCH v3 3/5] soc: loongson: loongson2_pm: Drop useless of_device_id compatible Binbin Zhou
2023-09-02  8:47 ` [PATCH v3 4/5] dt-bindings: soc: loongson,ls2k-pmc: Allow syscon-reboot/syscon-poweroff as child Binbin Zhou
2023-09-02  8:47 ` [PATCH v3 5/5] soc: loongson: loongson2_pm: Populate children syscon nodes Binbin Zhou
2023-09-26 21:03 ` [PATCH v3 0/5] soc: loongson: Fix some issues about loongson2_pm patchwork-bot+linux-soc

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).