All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v5 0/2] soc: loongson2_pm: add power management support
@ 2023-07-28  7:49 Yinbo Zhu
  2023-07-28  7:49 ` [PATCH v5 1/2] soc: dt-bindings: add loongson-2 pm Yinbo Zhu
                   ` (3 more replies)
  0 siblings, 4 replies; 19+ messages in thread
From: Yinbo Zhu @ 2023-07-28  7:49 UTC (permalink / raw)
  To: Arnd Bergmann, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	linux-pm, devicetree, linux-kernel
  Cc: Jianmin Lv, wanghongliang, Liu Peibao, loongson-kernel,
	Yinbo Zhu, Liu Yun

Loongson-2 platform support Power Management Controller (ACPI) and this
series patch was to add PM driver that base on dts and PM binding support.

Change in v5:
		1. The patch "[PATCH v3 1/3] loongarch: export some arch-specific
		   pm interfaces" had been merged into linux-next tree thus this
		   v4 series patch need drop it and need depend on it and it's
		   patch link was:
https://lore.kernel.org/all/20230615091757.24686-2-zhuyinbo@loongson.cn/
		2. Swap the positions of compatible for 2k1000 and 2k0500.
Change in v4:
		1. The patch "[PATCH v3 1/3] loongarch: export some arch-specific
		   pm interfaces" had been merged into linux-next tree thus this
		   v4 series patch need drop it and need depend on it and it's
		   patch link was:
https://lore.kernel.org/all/20230615091757.24686-2-zhuyinbo@loongson.cn/
		2. Remove the pmc label in dt-binding patch.
		3. Add the Co-developed-by for driver patch.
		4. Simplify the loongson2_suspend_valid_state that "return
		   (state == PM_SUSPEND_MEM)".
		5. Use Using loongson2_pm_irq_enable() to replace.
		   loongson2_power_button_irq_enable().
		6. Remove the "oneOf" in dt-bindings patch.
		7. Replace "suspend-address" that use "loongson,suspend-address".
		8. Use u64 type that for "loongson,suspend-address".
		9. Rename "pm" to "power-mangement" in dt-bindings patch.
		10. Add the reivewed-by for dt-bindings patch.
Change in v3:
		1. Reword the [1/3] patch commit log and title.
		2. Use the old naming for suspend interface for the [1/3] and
		   [3/3] patch.
		3. Combine some small function in the driver patch.
		4. Rename 'pwrbt' to 'button' in the driver patch.
		5. Use the specific compatible in yaml file.
Change in v2:
		1. Fixup the "suspend-address" description.
		2. Remove the "return -EINVAL" in PM driver probe when firmware
		   no configure "suspend-address" property in dts in oder to
		   other PM state to work.

Yinbo Zhu (2):
  soc: dt-bindings: add loongson-2 pm
  soc: loongson2_pm: add power management support

 .../soc/loongson/loongson,ls2k-pmc.yaml       |  52 +++++
 MAINTAINERS                                   |   7 +
 drivers/soc/loongson/Kconfig                  |  10 +
 drivers/soc/loongson/Makefile                 |   1 +
 drivers/soc/loongson/loongson2_pm.c           | 215 ++++++++++++++++++
 5 files changed, 285 insertions(+)

-- 
2.20.1


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

* [PATCH v5 1/2] soc: dt-bindings: add loongson-2 pm
  2023-07-28  7:49 [PATCH v5 0/2] soc: loongson2_pm: add power management support Yinbo Zhu
@ 2023-07-28  7:49 ` Yinbo Zhu
  2023-07-28  7:49 ` [PATCH v5 2/2] soc: loongson2_pm: add power management support Yinbo Zhu
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 19+ messages in thread
From: Yinbo Zhu @ 2023-07-28  7:49 UTC (permalink / raw)
  To: Arnd Bergmann, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	linux-pm, devicetree, linux-kernel
  Cc: Jianmin Lv, wanghongliang, Liu Peibao, loongson-kernel,
	Yinbo Zhu, Liu Yun, Krzysztof Kozlowski

Add the Loongson-2 SoC Power Management Controller binding with DT
schema format using json-schema.

Signed-off-by: Yinbo Zhu <zhuyinbo@loongson.cn>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 .../soc/loongson/loongson,ls2k-pmc.yaml       | 52 +++++++++++++++++++
 MAINTAINERS                                   |  6 +++
 2 files changed, 58 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/soc/loongson/loongson,ls2k-pmc.yaml

diff --git a/Documentation/devicetree/bindings/soc/loongson/loongson,ls2k-pmc.yaml b/Documentation/devicetree/bindings/soc/loongson/loongson,ls2k-pmc.yaml
new file mode 100644
index 000000000000..da2dcfeebf12
--- /dev/null
+++ b/Documentation/devicetree/bindings/soc/loongson/loongson,ls2k-pmc.yaml
@@ -0,0 +1,52 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/soc/loongson/loongson,ls2k-pmc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Loongson-2 Power Manager controller
+
+maintainers:
+  - Yinbo Zhu <zhuyinbo@loongson.cn>
+
+properties:
+  compatible:
+    items:
+      - enum:
+          - loongson,ls2k0500-pmc
+          - loongson,ls2k1000-pmc
+      - const: syscon
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  loongson,suspend-address:
+    $ref: /schemas/types.yaml#/definitions/uint64
+    description:
+      The "loongson,suspend-address" is a deep sleep state (Suspend To
+      RAM) firmware entry address which was jumped from kernel and it's
+      value was dependent on specific platform firmware code. In
+      addition, the PM need according to it to indicate that current
+      SoC whether support Suspend To RAM.
+
+required:
+  - compatible
+  - reg
+  - interrupts
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+
+    power-management@1fe27000 {
+        compatible = "loongson,ls2k1000-pmc", "syscon";
+        reg = <0x1fe27000 0x58>;
+        interrupt-parent = <&liointc1>;
+        interrupts = <11 IRQ_TYPE_LEVEL_LOW>;
+        loongson,suspend-address = <0x0 0x1c000500>;
+    };
diff --git a/MAINTAINERS b/MAINTAINERS
index 7a91f14cad2e..bcd05f1fa5c1 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -12190,6 +12190,12 @@ S:	Maintained
 F:	Documentation/devicetree/bindings/hwinfo/loongson,ls2k-chipid.yaml
 F:	drivers/soc/loongson/loongson2_guts.c
 
+LOONGSON-2 SOC SERIES PM DRIVER
+M:	Yinbo Zhu <zhuyinbo@loongson.cn>
+L:	linux-pm@vger.kernel.org
+S:	Maintained
+F:	Documentation/devicetree/bindings/soc/loongson/loongson,ls2k-pmc.yaml
+
 LOONGSON-2 SOC SERIES PINCTRL DRIVER
 M:	zhanghongchen <zhanghongchen@loongson.cn>
 M:	Yinbo Zhu <zhuyinbo@loongson.cn>
-- 
2.20.1


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

* [PATCH v5 2/2] soc: loongson2_pm: add power management support
  2023-07-28  7:49 [PATCH v5 0/2] soc: loongson2_pm: add power management support Yinbo Zhu
  2023-07-28  7:49 ` [PATCH v5 1/2] soc: dt-bindings: add loongson-2 pm Yinbo Zhu
@ 2023-07-28  7:49 ` Yinbo Zhu
  2023-07-28 10:46   ` Arnd Bergmann
  2023-07-28 12:17   ` Randy Dunlap
  2023-07-28  8:27 ` [PATCH v5 0/2] " 陈华才
  2023-07-28  8:43 ` Conor Dooley
  3 siblings, 2 replies; 19+ messages in thread
From: Yinbo Zhu @ 2023-07-28  7:49 UTC (permalink / raw)
  To: Arnd Bergmann, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	linux-pm, devicetree, linux-kernel
  Cc: Jianmin Lv, wanghongliang, Liu Peibao, loongson-kernel,
	Yinbo Zhu, Liu Yun

The Loongson-2's power management controller was ACPI, supports ACPI
S2Idle (Suspend To Idle), ACPI S3 (Suspend To RAM), ACPI S4 (Suspend To
Disk), ACPI S5 (Soft Shutdown) and supports multiple wake-up methods
(USB, GMAC, PWRBTN, etc.). This driver was to add power management
controller support that base on dts for Loongson-2 series SoCs.

Co-developed-by: Liu Yun <liuyun@loongson.cn>
Signed-off-by: Liu Yun <liuyun@loongson.cn>
Co-developed-by: Liu Peibao <liupeibao@loongson.cn>
Signed-off-by: Liu Peibao <liupeibao@loongson.cn>
Signed-off-by: Yinbo Zhu <zhuyinbo@loongson.cn>
---
 MAINTAINERS                         |   1 +
 drivers/soc/loongson/Kconfig        |  10 ++
 drivers/soc/loongson/Makefile       |   1 +
 drivers/soc/loongson/loongson2_pm.c | 215 ++++++++++++++++++++++++++++
 4 files changed, 227 insertions(+)
 create mode 100644 drivers/soc/loongson/loongson2_pm.c

diff --git a/MAINTAINERS b/MAINTAINERS
index bcd05f1fa5c1..7c4ad0cbaeff 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -12195,6 +12195,7 @@ M:	Yinbo Zhu <zhuyinbo@loongson.cn>
 L:	linux-pm@vger.kernel.org
 S:	Maintained
 F:	Documentation/devicetree/bindings/soc/loongson/loongson,ls2k-pmc.yaml
+F:	drivers/soc/loongson/loongson2_pm.c
 
 LOONGSON-2 SOC SERIES PINCTRL DRIVER
 M:	zhanghongchen <zhanghongchen@loongson.cn>
diff --git a/drivers/soc/loongson/Kconfig b/drivers/soc/loongson/Kconfig
index 707f56358dc4..4f3ce9eb7520 100644
--- a/drivers/soc/loongson/Kconfig
+++ b/drivers/soc/loongson/Kconfig
@@ -16,3 +16,13 @@ config LOONGSON2_GUTS
 	 SoCs. Initially only reading SVR and registering soc device are
 	 supported. Other guts accesses, such as reading firmware configuration
 	 by default, should eventually be added into this driver as well.
+
+config LOONGSON2_PM
+	bool "Loongson-2 SoC Power Management Controller Driver"
+	depends on LOONGARCH && OF
+	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
+	 Disk), ACPI S5 (Soft Shutdown) and supports multiple wake-up methods
+	 (USB, GMAC, PWRBTN, etc.). This driver was to add power management
+	 controller support that base on dts for Loongson-2 series SoCs.
diff --git a/drivers/soc/loongson/Makefile b/drivers/soc/loongson/Makefile
index 263c486df638..4118f50f55e2 100644
--- a/drivers/soc/loongson/Makefile
+++ b/drivers/soc/loongson/Makefile
@@ -4,3 +4,4 @@
 #
 
 obj-$(CONFIG_LOONGSON2_GUTS)		+= loongson2_guts.o
+obj-$(CONFIG_LOONGSON2_PM)		+= loongson2_pm.o
diff --git a/drivers/soc/loongson/loongson2_pm.c b/drivers/soc/loongson/loongson2_pm.c
new file mode 100644
index 000000000000..796add6e8b63
--- /dev/null
+++ b/drivers/soc/loongson/loongson2_pm.c
@@ -0,0 +1,215 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Loongson-2 PM Support
+ *
+ * Copyright (C) 2023 Loongson Technology Corporation Limited
+ */
+
+#include <linux/io.h>
+#include <linux/of.h>
+#include <linux/init.h>
+#include <linux/input.h>
+#include <linux/suspend.h>
+#include <linux/interrupt.h>
+#include <linux/pm_wakeirq.h>
+#include <linux/platform_device.h>
+#include <asm/bootinfo.h>
+#include <asm/suspend.h>
+
+#define LOONGSON2_PM1_CNT_REG		0x14
+#define LOONGSON2_PM1_STS_REG		0x0c
+#define LOONGSON2_PM1_ENA_REG		0x10
+#define LOONGSON2_GPE0_STS_REG		0x28
+#define LOONGSON2_GPE0_ENA_REG		0x2c
+
+#define LOONGSON2_PM1_PWRBTN_STS	BIT(8)
+#define LOONGSON2_PM1_PCIEXP_WAKE_STS	BIT(14)
+#define LOONGSON2_PM1_WAKE_STS		BIT(15)
+#define LOONGSON2_PM1_CNT_INT_EN	BIT(0)
+#define LOONGSON2_PM1_PWRBTN_EN		LOONGSON2_PM1_PWRBTN_STS
+
+static struct loongson2_pm {
+	void __iomem			*base;
+	struct input_dev		*dev;
+	bool				suspended;
+} loongson2_pm;
+
+#define loongson2_pm_readw(reg)		readw(loongson2_pm.base + reg)
+#define loongson2_pm_readl(reg)		readl(loongson2_pm.base + reg)
+#define loongson2_pm_writew(val, reg)	writew(val, loongson2_pm.base + reg)
+#define loongson2_pm_writel(val, reg)	writel(val, loongson2_pm.base + reg)
+
+static void loongson2_pm_status_clear(void)
+{
+	u16 value;
+
+	value = loongson2_pm_readw(LOONGSON2_PM1_STS_REG);
+	value |= (LOONGSON2_PM1_PWRBTN_STS | LOONGSON2_PM1_PCIEXP_WAKE_STS |
+		  LOONGSON2_PM1_WAKE_STS);
+	loongson2_pm_writew(value, LOONGSON2_PM1_STS_REG);
+	loongson2_pm_writel(loongson2_pm_readl(LOONGSON2_GPE0_STS_REG), LOONGSON2_GPE0_STS_REG);
+}
+
+static void loongson2_pm_irq_enable(void)
+{
+	u16 value;
+
+	value = loongson2_pm_readw(LOONGSON2_PM1_CNT_REG);
+	value |= LOONGSON2_PM1_CNT_INT_EN;
+	loongson2_pm_writew(value, LOONGSON2_PM1_CNT_REG);
+
+	value = loongson2_pm_readw(LOONGSON2_PM1_ENA_REG);
+	value |= LOONGSON2_PM1_PWRBTN_EN;
+	loongson2_pm_writew(value, LOONGSON2_PM1_ENA_REG);
+}
+
+static int loongson2_suspend_enter(suspend_state_t state)
+{
+	loongson2_pm_status_clear();
+	loongarch_common_suspend();
+	loongarch_suspend_enter();
+	loongarch_common_resume();
+	loongson2_pm_irq_enable();
+	pm_set_resume_via_firmware();
+
+	return 0;
+}
+
+static int loongson2_suspend_begin(suspend_state_t state)
+{
+	pm_set_suspend_via_firmware();
+
+	return 0;
+}
+
+static int loongson2_suspend_valid_state(suspend_state_t state)
+{
+	return (state == PM_SUSPEND_MEM);
+}
+
+static const struct platform_suspend_ops loongson2_suspend_ops = {
+	.valid	= loongson2_suspend_valid_state,
+	.begin	= loongson2_suspend_begin,
+	.enter	= loongson2_suspend_enter,
+};
+
+static int loongson2_power_button_init(struct device *dev, int irq)
+{
+	int ret;
+	struct input_dev *button;
+
+	button = input_allocate_device();
+	if (!dev)
+		return -ENOMEM;
+
+	button->name = "Power Button";
+	button->phys = "pm/button/input0";
+	button->id.bustype = BUS_HOST;
+	button->dev.parent = NULL;
+	input_set_capability(button, EV_KEY, KEY_POWER);
+
+	ret = input_register_device(button);
+	if (ret)
+		goto free_dev;
+
+	dev_pm_set_wake_irq(&button->dev, irq);
+	device_set_wakeup_capable(&button->dev, true);
+	device_set_wakeup_enable(&button->dev, true);
+
+	loongson2_pm.dev = button;
+	dev_info(dev, "Power Button: Init successful!\n");
+
+	return 0;
+
+free_dev:
+	input_free_device(button);
+
+	return ret;
+}
+
+static irqreturn_t loongson2_pm_irq_handler(int irq, void *dev_id)
+{
+	u16 status = loongson2_pm_readw(LOONGSON2_PM1_STS_REG);
+
+	if (!loongson2_pm.suspended && (status & LOONGSON2_PM1_PWRBTN_STS)) {
+		pr_info("Power Button pressed...\n");
+		input_report_key(loongson2_pm.dev, KEY_POWER, 1);
+		input_sync(loongson2_pm.dev);
+		input_report_key(loongson2_pm.dev, KEY_POWER, 0);
+		input_sync(loongson2_pm.dev);
+	}
+
+	loongson2_pm_status_clear();
+
+	return IRQ_HANDLED;
+}
+
+static int __maybe_unused loongson2_pm_suspend(struct device *dev)
+{
+	loongson2_pm.suspended = true;
+
+	return 0;
+}
+
+static int __maybe_unused loongson2_pm_resume(struct device *dev)
+{
+	loongson2_pm.suspended = false;
+
+	return 0;
+}
+static SIMPLE_DEV_PM_OPS(loongson2_pm_ops, loongson2_pm_suspend, loongson2_pm_resume);
+
+static int loongson2_pm_probe(struct platform_device *pdev)
+{
+	int irq, retval;
+	u64 suspend_addr;
+	struct device *dev = &pdev->dev;
+
+	loongson2_pm.base = devm_platform_ioremap_resource(pdev, 0);
+	if (IS_ERR(loongson2_pm.base))
+		return PTR_ERR(loongson2_pm.base);
+
+	irq = platform_get_irq(pdev, 0);
+	if (irq < 0)
+		return irq;
+
+	if (!device_property_read_u64(dev, "loongson,suspend-address", &suspend_addr))
+		loongson_sysconf.suspend_addr = (u64)phys_to_virt(suspend_addr);
+	else
+		dev_err(dev, "No loongson,suspend-address, could not support S3!\n");
+
+	if (loongson2_power_button_init(dev, irq))
+		return -EINVAL;
+
+	retval = devm_request_irq(&pdev->dev, irq, loongson2_pm_irq_handler,
+				  IRQF_SHARED, "pm_irq", &loongson2_pm);
+	if (retval)
+		return retval;
+
+	loongson2_pm_irq_enable();
+	loongson2_pm_status_clear();
+
+	if (loongson_sysconf.suspend_addr)
+		suspend_set_ops(&loongson2_suspend_ops);
+
+	return 0;
+}
+
+static const struct of_device_id loongson2_pm_match[] = {
+	{ .compatible = "loongson,ls2k0500-pmc", },
+	{ .compatible = "loongson,ls2k1000-pmc", },
+	{},
+};
+
+static struct platform_driver loongson2_pm_driver = {
+	.driver = {
+		.name = "ls2k-pm",
+		.pm = &loongson2_pm_ops,
+		.of_match_table = loongson2_pm_match,
+	},
+	.probe = loongson2_pm_probe,
+};
+module_platform_driver(loongson2_pm_driver);
+
+MODULE_DESCRIPTION("Loongson-2 PM driver");
+MODULE_LICENSE("GPL");
-- 
2.20.1


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

* Re: [PATCH v5 0/2] soc: loongson2_pm: add power management support
  2023-07-28  7:49 [PATCH v5 0/2] soc: loongson2_pm: add power management support Yinbo Zhu
  2023-07-28  7:49 ` [PATCH v5 1/2] soc: dt-bindings: add loongson-2 pm Yinbo Zhu
  2023-07-28  7:49 ` [PATCH v5 2/2] soc: loongson2_pm: add power management support Yinbo Zhu
@ 2023-07-28  8:27 ` 陈华才
  2023-07-28  8:36   ` Krzysztof Kozlowski
  2023-07-28  8:43 ` Conor Dooley
  3 siblings, 1 reply; 19+ messages in thread
From: 陈华才 @ 2023-07-28  8:27 UTC (permalink / raw)
  To: loongson-kernel
  Cc: Arnd Bergmann, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	linux-pm, devicetree, linux-kernel, Jianmin Lv, wanghongliang,
	Liu Peibao, Yinbo Zhu, Liu Yun

Reviewd-by: Huacai Chen <chenhuacai@loongson.cn>


> -----原始邮件-----
> 发件人: "Yinbo Zhu" <zhuyinbo@loongson.cn>
> 发送时间:2023-07-28 15:49:42 (星期五)
> 收件人: "Arnd Bergmann" <arnd@arndb.de>, "Rob Herring" <robh+dt@kernel.org>, "Krzysztof Kozlowski" <krzysztof.kozlowski+dt@linaro.org>, "Conor Dooley" <conor+dt@kernel.org>, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
> 抄送: "Jianmin Lv" <lvjianmin@loongson.cn>, wanghongliang@loongson.cn, "Liu Peibao" <liupeibao@loongson.cn>, loongson-kernel@lists.loongnix.cn, "Yinbo Zhu" <zhuyinbo@loongson.cn>, "Liu Yun" <liuyun@loongson.cn>
> 主题: [PATCH v5 0/2] soc: loongson2_pm: add power management support
> 
> Loongson-2 platform support Power Management Controller (ACPI) and this
> series patch was to add PM driver that base on dts and PM binding support.
> 
> Change in v5:
> 		1. The patch "[PATCH v3 1/3] loongarch: export some arch-specific
> 		   pm interfaces" had been merged into linux-next tree thus this
> 		   v4 series patch need drop it and need depend on it and it's
> 		   patch link was:
> https://lore.kernel.org/all/20230615091757.24686-2-zhuyinbo@loongson.cn/
> 		2. Swap the positions of compatible for 2k1000 and 2k0500.
> Change in v4:
> 		1. The patch "[PATCH v3 1/3] loongarch: export some arch-specific
> 		   pm interfaces" had been merged into linux-next tree thus this
> 		   v4 series patch need drop it and need depend on it and it's
> 		   patch link was:
> https://lore.kernel.org/all/20230615091757.24686-2-zhuyinbo@loongson.cn/
> 		2. Remove the pmc label in dt-binding patch.
> 		3. Add the Co-developed-by for driver patch.
> 		4. Simplify the loongson2_suspend_valid_state that "return
> 		   (state == PM_SUSPEND_MEM)".
> 		5. Use Using loongson2_pm_irq_enable() to replace.
> 		   loongson2_power_button_irq_enable().
> 		6. Remove the "oneOf" in dt-bindings patch.
> 		7. Replace "suspend-address" that use "loongson,suspend-address".
> 		8. Use u64 type that for "loongson,suspend-address".
> 		9. Rename "pm" to "power-mangement" in dt-bindings patch.
> 		10. Add the reivewed-by for dt-bindings patch.
> Change in v3:
> 		1. Reword the [1/3] patch commit log and title.
> 		2. Use the old naming for suspend interface for the [1/3] and
> 		   [3/3] patch.
> 		3. Combine some small function in the driver patch.
> 		4. Rename 'pwrbt' to 'button' in the driver patch.
> 		5. Use the specific compatible in yaml file.
> Change in v2:
> 		1. Fixup the "suspend-address" description.
> 		2. Remove the "return -EINVAL" in PM driver probe when firmware
> 		   no configure "suspend-address" property in dts in oder to
> 		   other PM state to work.
> 
> Yinbo Zhu (2):
>   soc: dt-bindings: add loongson-2 pm
>   soc: loongson2_pm: add power management support
> 
>  .../soc/loongson/loongson,ls2k-pmc.yaml       |  52 +++++
>  MAINTAINERS                                   |   7 +
>  drivers/soc/loongson/Kconfig                  |  10 +
>  drivers/soc/loongson/Makefile                 |   1 +
>  drivers/soc/loongson/loongson2_pm.c           | 215 ++++++++++++++++++
>  5 files changed, 285 insertions(+)
> 
> -- 
> 2.20.1
> 
> _______________________________________________
> Loongson-kernel mailing list -- loongson-kernel@lists.loongnix.cn
> To unsubscribe send an email to loongson-kernel-leave@lists.loongnix.cn


本邮件及其附件含有龙芯中科的商业秘密信息,仅限于发送给上面地址中列出的个人或群组。禁止任何其他人以任何形式使用(包括但不限于全部或部分地泄露、复制或散发)本邮件及其附件中的信息。如果您错收本邮件,请您立即电话或邮件通知发件人并删除本邮件。 
This email and its attachments contain confidential information from Loongson Technology , which is intended only for the person or entity whose address is listed above. Any use of the information contained herein in any way (including, but not limited to, total or partial disclosure, reproduction or dissemination) by persons other than the intended recipient(s) is prohibited. If you receive this email in error, please notify the sender by phone or email immediately and delete it. 

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

* Re: [PATCH v5 0/2] soc: loongson2_pm: add power management support
  2023-07-28  8:27 ` [PATCH v5 0/2] " 陈华才
@ 2023-07-28  8:36   ` Krzysztof Kozlowski
  2023-07-28  9:18     ` Conor Dooley
  0 siblings, 1 reply; 19+ messages in thread
From: Krzysztof Kozlowski @ 2023-07-28  8:36 UTC (permalink / raw)
  To: 陈华才, loongson-kernel
  Cc: Arnd Bergmann, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	linux-pm, devicetree, linux-kernel, Jianmin Lv, wanghongliang,
	Liu Peibao, Yinbo Zhu, Liu Yun

On 28/07/2023 10:27, 陈华才 wrote:
> Reviewd-by: Huacai Chen <chenhuacai@loongson.cn>

...

> 
> 
> 本邮件及其附件含有龙芯中科的商业秘密信息,仅限于发送给上面地址中列出的个人或群组。禁止任何其他人以任何形式使用(包括但不限于全部或部分地泄露、复制或散发)本邮件及其附件中的信息。如果您错收本邮件,请您立即电话或邮件通知发件人并删除本邮件。 
> This email and its attachments contain confidential information from Loongson Technology , which is intended only for the person or entity whose address is listed above. Any use of the information contained herein in any way (including, but not limited to, total or partial disclosure, reproduction or dissemination) by persons other than the intended recipient(s) is prohibited. If you receive this email in error, please notify the sender by phone or email immediately and delete it. 


Ooops!

Are we intended person/entities to receive your Reviewed-by tag? We will
be using it (total/partial disclosure, reproduction, dissemination).
People not on To/Cc will also do it and for sure they are not intended
recipients.

Please talk with your IT that such disclaimers in open-source are not
desired (if not harmful even).

Best regards,
Krzysztof


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

* Re: [PATCH v5 0/2] soc: loongson2_pm: add power management support
  2023-07-28  7:49 [PATCH v5 0/2] soc: loongson2_pm: add power management support Yinbo Zhu
                   ` (2 preceding siblings ...)
  2023-07-28  8:27 ` [PATCH v5 0/2] " 陈华才
@ 2023-07-28  8:43 ` Conor Dooley
  2023-07-28  9:48   ` Huacai Chen
  3 siblings, 1 reply; 19+ messages in thread
From: Conor Dooley @ 2023-07-28  8:43 UTC (permalink / raw)
  To: Yinbo Zhu
  Cc: Arnd Bergmann, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	linux-pm, devicetree, linux-kernel, Jianmin Lv, wanghongliang,
	Liu Peibao, loongson-kernel, Liu Yun, chenhuacai, kernel

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

Hey,

+CC Huacai & WANG.

On Fri, Jul 28, 2023 at 03:49:42PM +0800, Yinbo Zhu wrote:
> Loongson-2 platform support Power Management Controller (ACPI) and this
> series patch was to add PM driver that base on dts and PM binding support.
> 
> Change in v5:
> 		1. The patch "[PATCH v3 1/3] loongarch: export some arch-specific
> 		   pm interfaces" had been merged into linux-next tree thus this
> 		   v4 series patch need drop it and need depend on it and it's
> 		   patch link was:
> https://lore.kernel.org/all/20230615091757.24686-2-zhuyinbo@loongson.cn/

Just to note, it might be in linux-next, but more importantly it is also
in v6.5-rc1, so there is no issue with dependencies.

> 		2. Swap the positions of compatible for 2k1000 and 2k0500.

I noticed you sent a mail pinging the v4 of this series yesterday as it
had not been picked up. Who do you actually expect to apply these
patches? There does not appear to be a maintainer listed for the
drivers/soc/loongson directory, just one for your GUTS driver.

As a result, patches like
<https://lore.kernel.org/all/a69170cb55cfc73e378b40ccf1d9c16f@208suo.com/>
have gone ignored. Granted, that patch is probably crap that does not
apply, due to 208suo.com people sending corrupted patches, but you the
point.

More interestingly there is also
<https://lore.kernel.org/all/40b324af-3483-4b3d-b65a-a97944aa4a70@app.fastmail.com/>
which seems to have also gone missing (I don't see it in linux-next),
despite some discussion about how the patch should be merged.

Looks to me like drivers/soc/loongson/ needs someone to take
responsibility for picking up patches for the directory & sending them
to the soc maintainers (with a new MAINTAINERS entry reflecting that) so
that patches don't fall through the cracks.

Thanks,
Conor.

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

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

* Re: [PATCH v5 0/2] soc: loongson2_pm: add power management support
  2023-07-28  8:36   ` Krzysztof Kozlowski
@ 2023-07-28  9:18     ` Conor Dooley
  2023-07-28  9:45       ` Krzysztof Kozlowski
  0 siblings, 1 reply; 19+ messages in thread
From: Conor Dooley @ 2023-07-28  9:18 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: 陈华才,
	loongson-kernel, Arnd Bergmann, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, linux-pm, devicetree, linux-kernel, Jianmin Lv,
	wanghongliang, Liu Peibao, Yinbo Zhu, Liu Yun

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

On Fri, Jul 28, 2023 at 10:36:42AM +0200, Krzysztof Kozlowski wrote:
> On 28/07/2023 10:27, 陈华才 wrote:
> > Reviewd-by: Huacai Chen <chenhuacai@loongson.cn>
> 
> ...
> 
> > 
> > 
> > 本邮件及其附件含有龙芯中科的商业秘密信息,仅限于发送给上面地址中列出的个人或群组。禁止任何其他人以任何形式使用(包括但不限于全部或部分地泄露、复制或散发)本邮件及其附件中的信息。如果您错收本邮件,请您立即电话或邮件通知发件人并删除本邮件。 
> > This email and its attachments contain confidential information from Loongson Technology , which is intended only for the person or entity whose address is listed above. Any use of the information contained herein in any way (including, but not limited to, total or partial disclosure, reproduction or dissemination) by persons other than the intended recipient(s) is prohibited. If you receive this email in error, please notify the sender by phone or email immediately and delete it. 
> 
> 
> Ooops!
> 
> Are we intended person/entities to receive your Reviewed-by tag?

It's okay, you only got a "Reviewd-by" tag ;)

> We will
> be using it (total/partial disclosure, reproduction, dissemination).
> People not on To/Cc will also do it and for sure they are not intended
> recipients.
> 
> Please talk with your IT that such disclaimers in open-source are not
> desired (if not harmful even).


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

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

* Re: [PATCH v5 0/2] soc: loongson2_pm: add power management support
  2023-07-28  9:18     ` Conor Dooley
@ 2023-07-28  9:45       ` Krzysztof Kozlowski
  2023-07-28 10:14         ` Conor Dooley
  0 siblings, 1 reply; 19+ messages in thread
From: Krzysztof Kozlowski @ 2023-07-28  9:45 UTC (permalink / raw)
  To: Conor Dooley
  Cc: 陈华才,
	loongson-kernel, Arnd Bergmann, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, linux-pm, devicetree, linux-kernel, Jianmin Lv,
	wanghongliang, Liu Peibao, Yinbo Zhu, Liu Yun

On 28/07/2023 11:18, Conor Dooley wrote:
> On Fri, Jul 28, 2023 at 10:36:42AM +0200, Krzysztof Kozlowski wrote:
>> On 28/07/2023 10:27, 陈华才 wrote:
>>> Reviewd-by: Huacai Chen <chenhuacai@loongson.cn>
>>
>> ...
>>
>>>
>>>
>>> 本邮件及其附件含有龙芯中科的商业秘密信息,仅限于发送给上面地址中列出的个人或群组。禁止任何其他人以任何形式使用(包括但不限于全部或部分地泄露、复制或散发)本邮件及其附件中的信息。如果您错收本邮件,请您立即电话或邮件通知发件人并删除本邮件。 
>>> This email and its attachments contain confidential information from Loongson Technology , which is intended only for the person or entity whose address is listed above. Any use of the information contained herein in any way (including, but not limited to, total or partial disclosure, reproduction or dissemination) by persons other than the intended recipient(s) is prohibited. If you receive this email in error, please notify the sender by phone or email immediately and delete it. 
>>
>>
>> Ooops!
>>
>> Are we intended person/entities to receive your Reviewed-by tag?
> 
> It's okay, you only got a "Reviewd-by" tag ;)

I guess so, especially that this disclaimer should be useless. But on
the other hand, do I want to deal with it if once Loongson sends me
Cease-and-desist letter for something? Why even thinking about this
should be my problem? Why should I even consider this topic: is it
harmless or is there any risk?

Best regards,
Krzysztof


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

* Re: [PATCH v5 0/2] soc: loongson2_pm: add power management support
  2023-07-28  8:43 ` Conor Dooley
@ 2023-07-28  9:48   ` Huacai Chen
  2023-07-28 10:18     ` Conor Dooley
  0 siblings, 1 reply; 19+ messages in thread
From: Huacai Chen @ 2023-07-28  9:48 UTC (permalink / raw)
  To: Conor Dooley
  Cc: Yinbo Zhu, Arnd Bergmann, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, linux-pm, devicetree, linux-kernel, Jianmin Lv,
	wanghongliang, Liu Peibao, loongson-kernel, Liu Yun, kernel

Hi, Conor, Arnd,

On Fri, Jul 28, 2023 at 4:44 PM Conor Dooley <conor.dooley@microchip.com> wrote:
>
> Hey,
>
> +CC Huacai & WANG.
>
> On Fri, Jul 28, 2023 at 03:49:42PM +0800, Yinbo Zhu wrote:
> > Loongson-2 platform support Power Management Controller (ACPI) and this
> > series patch was to add PM driver that base on dts and PM binding support.
> >
> > Change in v5:
> >               1. The patch "[PATCH v3 1/3] loongarch: export some arch-specific
> >                  pm interfaces" had been merged into linux-next tree thus this
> >                  v4 series patch need drop it and need depend on it and it's
> >                  patch link was:
> > https://lore.kernel.org/all/20230615091757.24686-2-zhuyinbo@loongson.cn/
>
> Just to note, it might be in linux-next, but more importantly it is also
> in v6.5-rc1, so there is no issue with dependencies.
>
> >               2. Swap the positions of compatible for 2k1000 and 2k0500.
>
> I noticed you sent a mail pinging the v4 of this series yesterday as it
> had not been picked up. Who do you actually expect to apply these
> patches? There does not appear to be a maintainer listed for the
> drivers/soc/loongson directory, just one for your GUTS driver.
>
> As a result, patches like
> <https://lore.kernel.org/all/a69170cb55cfc73e378b40ccf1d9c16f@208suo.com/>
> have gone ignored. Granted, that patch is probably crap that does not
> apply, due to 208suo.com people sending corrupted patches, but you the
> point.
>
> More interestingly there is also
> <https://lore.kernel.org/all/40b324af-3483-4b3d-b65a-a97944aa4a70@app.fastmail.com/>
> which seems to have also gone missing (I don't see it in linux-next),
> despite some discussion about how the patch should be merged.
>
> Looks to me like drivers/soc/loongson/ needs someone to take
> responsibility for picking up patches for the directory & sending them
> to the soc maintainers (with a new MAINTAINERS entry reflecting that) so
> that patches don't fall through the cracks.
As discussed when the guts driver gets merged, I think it is better to
go via Arnd's soc tree for these patches under drivers/soc/loongson/.

To Krzysztof,

I'm very sorry for the disclaimer, I will remove it, and please take it easy.

Huacai

>
> Thanks,
> Conor.

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

* Re: [PATCH v5 0/2] soc: loongson2_pm: add power management support
  2023-07-28  9:45       ` Krzysztof Kozlowski
@ 2023-07-28 10:14         ` Conor Dooley
  2023-07-28 10:21           ` Krzysztof Kozlowski
  0 siblings, 1 reply; 19+ messages in thread
From: Conor Dooley @ 2023-07-28 10:14 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: 陈华才,
	loongson-kernel, Arnd Bergmann, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, linux-pm, devicetree, linux-kernel, Jianmin Lv,
	wanghongliang, Liu Peibao, Yinbo Zhu, Liu Yun

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

On Fri, Jul 28, 2023 at 11:45:48AM +0200, Krzysztof Kozlowski wrote:
> On 28/07/2023 11:18, Conor Dooley wrote:
> > On Fri, Jul 28, 2023 at 10:36:42AM +0200, Krzysztof Kozlowski wrote:

> >> Are we intended person/entities to receive your Reviewed-by tag?
> > 
> > It's okay, you only got a "Reviewd-by" tag ;)
> 
> I guess so, especially that this disclaimer should be useless. But on
> the other hand, do I want to deal with it if once Loongson sends me
> Cease-and-desist letter for something? Why even thinking about this
> should be my problem? Why should I even consider this topic: is it
> harmless or is there any risk?

Oh for sure complain. My corp email is not in the CC, but it arrived in
my inbox there...
I was just noting that the tag was not correctly provided in the first
place.

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

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

* Re: [PATCH v5 0/2] soc: loongson2_pm: add power management support
  2023-07-28  9:48   ` Huacai Chen
@ 2023-07-28 10:18     ` Conor Dooley
  2023-07-31 14:13       ` Huacai Chen
  0 siblings, 1 reply; 19+ messages in thread
From: Conor Dooley @ 2023-07-28 10:18 UTC (permalink / raw)
  To: Huacai Chen
  Cc: Yinbo Zhu, Arnd Bergmann, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, linux-pm, devicetree, linux-kernel, Jianmin Lv,
	wanghongliang, Liu Peibao, loongson-kernel, Liu Yun, kernel

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

On Fri, Jul 28, 2023 at 05:48:29PM +0800, Huacai Chen wrote:
> On Fri, Jul 28, 2023 at 4:44 PM Conor Dooley <conor.dooley@microchip.com> wrote:
> > On Fri, Jul 28, 2023 at 03:49:42PM +0800, Yinbo Zhu wrote:
> > > Loongson-2 platform support Power Management Controller (ACPI) and this
> > > series patch was to add PM driver that base on dts and PM binding support.
> > >
> > > Change in v5:
> > >               1. The patch "[PATCH v3 1/3] loongarch: export some arch-specific
> > >                  pm interfaces" had been merged into linux-next tree thus this
> > >                  v4 series patch need drop it and need depend on it and it's
> > >                  patch link was:
> > > https://lore.kernel.org/all/20230615091757.24686-2-zhuyinbo@loongson.cn/
> >
> > Just to note, it might be in linux-next, but more importantly it is also
> > in v6.5-rc1, so there is no issue with dependencies.
> >
> > >               2. Swap the positions of compatible for 2k1000 and 2k0500.
> >
> > I noticed you sent a mail pinging the v4 of this series yesterday as it
> > had not been picked up. Who do you actually expect to apply these
> > patches? There does not appear to be a maintainer listed for the
> > drivers/soc/loongson directory, just one for your GUTS driver.
> >
> > As a result, patches like
> > <https://lore.kernel.org/all/a69170cb55cfc73e378b40ccf1d9c16f@208suo.com/>
> > have gone ignored. Granted, that patch is probably crap that does not
> > apply, due to 208suo.com people sending corrupted patches, but you the
> > point.
> >
> > More interestingly there is also
> > <https://lore.kernel.org/all/40b324af-3483-4b3d-b65a-a97944aa4a70@app.fastmail.com/>
> > which seems to have also gone missing (I don't see it in linux-next),
> > despite some discussion about how the patch should be merged.
> >
> > Looks to me like drivers/soc/loongson/ needs someone to take
> > responsibility for picking up patches for the directory & sending them
> > to the soc maintainers (with a new MAINTAINERS entry reflecting that) so
> > that patches don't fall through the cracks.

> As discussed when the guts driver gets merged, I think it is better to
> go via Arnd's soc tree for these patches under drivers/soc/loongson/.

Discussed perhaps, and that does seem to me like the correct thing to do,
but nobody actually did anything about it.
Somebody needs to set up a git tree, add a MAINTAINERS entry for the
directory, actually apply the patches and then send a PR to the soc
maintainers (as mentioned by Arnd in the second patch I linked there).

Perhaps that someone is you, or maybe it is Yinbo, up to you guys to
decide :)

Cheers,
Conor.


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

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

* Re: [PATCH v5 0/2] soc: loongson2_pm: add power management support
  2023-07-28 10:14         ` Conor Dooley
@ 2023-07-28 10:21           ` Krzysztof Kozlowski
  0 siblings, 0 replies; 19+ messages in thread
From: Krzysztof Kozlowski @ 2023-07-28 10:21 UTC (permalink / raw)
  To: Conor Dooley
  Cc: 陈华才,
	loongson-kernel, Arnd Bergmann, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, linux-pm, devicetree, linux-kernel, Jianmin Lv,
	wanghongliang, Liu Peibao, Yinbo Zhu, Liu Yun

On 28/07/2023 12:14, Conor Dooley wrote:
> On Fri, Jul 28, 2023 at 11:45:48AM +0200, Krzysztof Kozlowski wrote:
>> On 28/07/2023 11:18, Conor Dooley wrote:
>>> On Fri, Jul 28, 2023 at 10:36:42AM +0200, Krzysztof Kozlowski wrote:
> 
>>>> Are we intended person/entities to receive your Reviewed-by tag?
>>>
>>> It's okay, you only got a "Reviewd-by" tag ;)
>>
>> I guess so, especially that this disclaimer should be useless. But on
>> the other hand, do I want to deal with it if once Loongson sends me
>> Cease-and-desist letter for something? Why even thinking about this
>> should be my problem? Why should I even consider this topic: is it
>> harmless or is there any risk?
> 
> Oh for sure complain. My corp email is not in the CC, but it arrived in
> my inbox there...
> I was just noting that the tag was not correctly provided in the first
> place.

Ah, I misunderstood. Indeed, the tag is not correct.

Best regards,
Krzysztof


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

* Re: [PATCH v5 2/2] soc: loongson2_pm: add power management support
  2023-07-28  7:49 ` [PATCH v5 2/2] soc: loongson2_pm: add power management support Yinbo Zhu
@ 2023-07-28 10:46   ` Arnd Bergmann
  2023-07-31  3:12     ` Yinbo Zhu
  2023-07-28 12:17   ` Randy Dunlap
  1 sibling, 1 reply; 19+ messages in thread
From: Arnd Bergmann @ 2023-07-28 10:46 UTC (permalink / raw)
  To: Yinbo Zhu, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	linux-pm, devicetree, linux-kernel, Ulf Hansson
  Cc: Jianmin Lv, wanghongliang, Liu Peibao, loongson-kernel, Liu Yun

On Fri, Jul 28, 2023, at 09:49, Yinbo Zhu wrote:
> The Loongson-2's power management controller was ACPI, supports ACPI
> S2Idle (Suspend To Idle), ACPI S3 (Suspend To RAM), ACPI S4 (Suspend To
> Disk), ACPI S5 (Soft Shutdown) and supports multiple wake-up methods
> (USB, GMAC, PWRBTN, etc.). This driver was to add power management
> controller support that base on dts for Loongson-2 series SoCs.
>
> Co-developed-by: Liu Yun <liuyun@loongson.cn>
> Signed-off-by: Liu Yun <liuyun@loongson.cn>
> Co-developed-by: Liu Peibao <liupeibao@loongson.cn>
> Signed-off-by: Liu Peibao <liupeibao@loongson.cn>
> Signed-off-by: Yinbo Zhu <zhuyinbo@loongson.cn>

Adding Ulf Hansson to Cc

Ulf has recently split out the "genpd" framework and split out
drivers/genpd from drivers/soc since I'm generally not that involved
in the pwoer management side.

Can you have a look at whether this driver should also be part
of drivers/genpd rather than drivers/soc, and/or converted
to use the genpd infrastructure?

Thanks,

       Arnd

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

* Re: [PATCH v5 2/2] soc: loongson2_pm: add power management support
  2023-07-28  7:49 ` [PATCH v5 2/2] soc: loongson2_pm: add power management support Yinbo Zhu
  2023-07-28 10:46   ` Arnd Bergmann
@ 2023-07-28 12:17   ` Randy Dunlap
  2023-07-31  3:14     ` Yinbo Zhu
  1 sibling, 1 reply; 19+ messages in thread
From: Randy Dunlap @ 2023-07-28 12:17 UTC (permalink / raw)
  To: Yinbo Zhu, Arnd Bergmann, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, linux-pm, devicetree, linux-kernel
  Cc: Jianmin Lv, wanghongliang, Liu Peibao, loongson-kernel, Liu Yun

Hi--

On 7/28/23 00:49, Yinbo Zhu wrote:
> +config LOONGSON2_PM
> +	bool "Loongson-2 SoC Power Management Controller Driver"
> +	depends on LOONGARCH && OF
> +	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
> +	 Disk), ACPI S5 (Soft Shutdown) and supports multiple wake-up methods
> +	 (USB, GMAC, PWRBTN, etc.). This driver was to add power management
> +	 controller support that base on dts for Loongson-2 series SoCs.

Kconfig help text should be indented with one tab +2 spaces, as documented
in Documentation/process/coding-style.rst.

thanks.
-- 
~Randy

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

* Re: [PATCH v5 2/2] soc: loongson2_pm: add power management support
  2023-07-28 10:46   ` Arnd Bergmann
@ 2023-07-31  3:12     ` Yinbo Zhu
  0 siblings, 0 replies; 19+ messages in thread
From: Yinbo Zhu @ 2023-07-31  3:12 UTC (permalink / raw)
  To: Arnd Bergmann, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	linux-pm, devicetree, linux-kernel, Ulf Hansson
  Cc: Jianmin Lv, wanghongliang, Liu Peibao, loongson-kernel, Liu Yun,
	zhuyinbo



在 2023/7/28 下午6:46, Arnd Bergmann 写道:
> On Fri, Jul 28, 2023, at 09:49, Yinbo Zhu wrote:
>> The Loongson-2's power management controller was ACPI, supports ACPI
>> S2Idle (Suspend To Idle), ACPI S3 (Suspend To RAM), ACPI S4 (Suspend To
>> Disk), ACPI S5 (Soft Shutdown) and supports multiple wake-up methods
>> (USB, GMAC, PWRBTN, etc.). This driver was to add power management
>> controller support that base on dts for Loongson-2 series SoCs.
>>
>> Co-developed-by: Liu Yun <liuyun@loongson.cn>
>> Signed-off-by: Liu Yun <liuyun@loongson.cn>
>> Co-developed-by: Liu Peibao <liupeibao@loongson.cn>
>> Signed-off-by: Liu Peibao <liupeibao@loongson.cn>
>> Signed-off-by: Yinbo Zhu <zhuyinbo@loongson.cn>
> 
> Adding Ulf Hansson to Cc


okay, I will add ulf hansson to Cc.

> 
> Ulf has recently split out the "genpd" framework and split out
> drivers/genpd from drivers/soc since I'm generally not that involved
> in the pwoer management side.

okay, I got it.

> 
> Can you have a look at whether this driver should also be part
> of drivers/genpd rather than drivers/soc, and/or converted
> to use the genpd infrastructure?


I have a look drivers/soc and drivers/genpd, there seems to be power
manager code in both paths, but drivers/genpd seems more suitable. I
will move the code to drivers/genpd

Thanks,
Yinbo


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

* Re: [PATCH v5 2/2] soc: loongson2_pm: add power management support
  2023-07-28 12:17   ` Randy Dunlap
@ 2023-07-31  3:14     ` Yinbo Zhu
  0 siblings, 0 replies; 19+ messages in thread
From: Yinbo Zhu @ 2023-07-31  3:14 UTC (permalink / raw)
  To: Randy Dunlap, Arnd Bergmann, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, linux-pm, devicetree, linux-kernel
  Cc: Jianmin Lv, wanghongliang, Liu Peibao, loongson-kernel, Liu Yun,
	zhuyinbo



在 2023/7/28 下午8:17, Randy Dunlap 写道:
> Hi--
> 
> On 7/28/23 00:49, Yinbo Zhu wrote:
>> +config LOONGSON2_PM
>> +	bool "Loongson-2 SoC Power Management Controller Driver"
>> +	depends on LOONGARCH && OF
>> +	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
>> +	 Disk), ACPI S5 (Soft Shutdown) and supports multiple wake-up methods
>> +	 (USB, GMAC, PWRBTN, etc.). This driver was to add power management
>> +	 controller support that base on dts for Loongson-2 series SoCs.
> 
> Kconfig help text should be indented with one tab +2 spaces, as documented
> in Documentation/process/coding-style.rst.


okay, I got it.

Thanks,
Yinbo


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

* Re: [PATCH v5 0/2] soc: loongson2_pm: add power management support
  2023-07-28 10:18     ` Conor Dooley
@ 2023-07-31 14:13       ` Huacai Chen
  2023-07-31 19:28         ` Arnd Bergmann
  0 siblings, 1 reply; 19+ messages in thread
From: Huacai Chen @ 2023-07-31 14:13 UTC (permalink / raw)
  To: Conor Dooley
  Cc: Yinbo Zhu, Arnd Bergmann, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, linux-pm, devicetree, linux-kernel, Jianmin Lv,
	wanghongliang, Liu Peibao, loongson-kernel, Liu Yun, kernel

Hi, Conor and Arnd,

On Fri, Jul 28, 2023 at 6:18 PM Conor Dooley <conor.dooley@microchip.com> wrote:
>
> On Fri, Jul 28, 2023 at 05:48:29PM +0800, Huacai Chen wrote:
> > On Fri, Jul 28, 2023 at 4:44 PM Conor Dooley <conor.dooley@microchip.com> wrote:
> > > On Fri, Jul 28, 2023 at 03:49:42PM +0800, Yinbo Zhu wrote:
> > > > Loongson-2 platform support Power Management Controller (ACPI) and this
> > > > series patch was to add PM driver that base on dts and PM binding support.
> > > >
> > > > Change in v5:
> > > >               1. The patch "[PATCH v3 1/3] loongarch: export some arch-specific
> > > >                  pm interfaces" had been merged into linux-next tree thus this
> > > >                  v4 series patch need drop it and need depend on it and it's
> > > >                  patch link was:
> > > > https://lore.kernel.org/all/20230615091757.24686-2-zhuyinbo@loongson.cn/
> > >
> > > Just to note, it might be in linux-next, but more importantly it is also
> > > in v6.5-rc1, so there is no issue with dependencies.
> > >
> > > >               2. Swap the positions of compatible for 2k1000 and 2k0500.
> > >
> > > I noticed you sent a mail pinging the v4 of this series yesterday as it
> > > had not been picked up. Who do you actually expect to apply these
> > > patches? There does not appear to be a maintainer listed for the
> > > drivers/soc/loongson directory, just one for your GUTS driver.
> > >
> > > As a result, patches like
> > > <https://lore.kernel.org/all/a69170cb55cfc73e378b40ccf1d9c16f@208suo.com/>
> > > have gone ignored. Granted, that patch is probably crap that does not
> > > apply, due to 208suo.com people sending corrupted patches, but you the
> > > point.
> > >
> > > More interestingly there is also
> > > <https://lore.kernel.org/all/40b324af-3483-4b3d-b65a-a97944aa4a70@app.fastmail.com/>
> > > which seems to have also gone missing (I don't see it in linux-next),
> > > despite some discussion about how the patch should be merged.
> > >
> > > Looks to me like drivers/soc/loongson/ needs someone to take
> > > responsibility for picking up patches for the directory & sending them
> > > to the soc maintainers (with a new MAINTAINERS entry reflecting that) so
> > > that patches don't fall through the cracks.
>
> > As discussed when the guts driver gets merged, I think it is better to
> > go via Arnd's soc tree for these patches under drivers/soc/loongson/.
>
> Discussed perhaps, and that does seem to me like the correct thing to do,
> but nobody actually did anything about it.
> Somebody needs to set up a git tree, add a MAINTAINERS entry for the
> directory, actually apply the patches and then send a PR to the soc
> maintainers (as mentioned by Arnd in the second patch I linked there).
>
> Perhaps that someone is you, or maybe it is Yinbo, up to you guys to
> decide :)
I'm a "merge hater" and "rebase lover", so I think it is better that
Arnd picks up these patches to the soc tree directly. But if
necessary, I can also create a "soc-loongson-next" branch in my tree
and then send PR to Arnd.

Huacai
>
> Cheers,
> Conor.
>

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

* Re: [PATCH v5 0/2] soc: loongson2_pm: add power management support
  2023-07-31 14:13       ` Huacai Chen
@ 2023-07-31 19:28         ` Arnd Bergmann
  2023-08-01  8:16           ` Conor Dooley
  0 siblings, 1 reply; 19+ messages in thread
From: Arnd Bergmann @ 2023-07-31 19:28 UTC (permalink / raw)
  To: Huacai Chen, Conor.Dooley
  Cc: Yinbo Zhu, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	linux-pm, devicetree, linux-kernel, Jianmin Lv, wanghongliang,
	Liu Peibao, loongson-kernel, Liu Yun, WANG Xuerui

On Mon, Jul 31, 2023, at 16:13, Huacai Chen wrote:
> On Fri, Jul 28, 2023 at 6:18 PM Conor Dooley <conor.dooley@microchip.com> wrote:

>>
>> Perhaps that someone is you, or maybe it is Yinbo, up to you guys to
>> decide :)
> I'm a "merge hater" and "rebase lover", so I think it is better that
> Arnd picks up these patches to the soc tree directly. But if
> necessary, I can also create a "soc-loongson-next" branch in my tree
> and then send PR to Arnd.

Separate patches are fine for a short series, it doesn't have
to be a pull request, but do make sure to send it to
soc@kernel.org after review is complete so I'll be sure to
take care of it in patchwork, I otherwise skip a lot of
patches as I expect them to be picked up into a platform
specific tree first.

Also, if this ends up being a genpd driver, then patches
after 6.6-rc1 need to go through Ulf's tree instead, not
the soc tree.

      Arnd

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

* Re: [PATCH v5 0/2] soc: loongson2_pm: add power management support
  2023-07-31 19:28         ` Arnd Bergmann
@ 2023-08-01  8:16           ` Conor Dooley
  0 siblings, 0 replies; 19+ messages in thread
From: Conor Dooley @ 2023-08-01  8:16 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Huacai Chen, Conor.Dooley, Yinbo Zhu, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, linux-pm, devicetree,
	linux-kernel, Jianmin Lv, wanghongliang, Liu Peibao,
	loongson-kernel, Liu Yun, WANG Xuerui

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

On Mon, Jul 31, 2023 at 09:28:11PM +0200, Arnd Bergmann wrote:
> On Mon, Jul 31, 2023, at 16:13, Huacai Chen wrote:
> > On Fri, Jul 28, 2023 at 6:18 PM Conor Dooley <conor.dooley@microchip.com> wrote:
> 
> >>
> >> Perhaps that someone is you, or maybe it is Yinbo, up to you guys to
> >> decide :)
> > I'm a "merge hater" and "rebase lover", so I think it is better that
> > Arnd picks up these patches to the soc tree directly. But if
> > necessary, I can also create a "soc-loongson-next" branch in my tree
> > and then send PR to Arnd.
> 
> Separate patches are fine for a short series, it doesn't have
> to be a pull request, but do make sure to send it to
> soc@kernel.org after review is complete so I'll be sure to
> take care of it in patchwork, I otherwise skip a lot of
> patches as I expect them to be picked up into a platform
> specific tree first.
> 
> Also, if this ends up being a genpd driver, then patches
> after 6.6-rc1 need to go through Ulf's tree instead, not
> the soc tree.

Just to get the ball rolling, I've made the maintainers entry for you
Huacai :) Perhaps you can pick up the two patches I mentioned earlier in
the thread, as both appear to be fixes?

Thanks,
Conor.

-- >8 --
From 4423897634c0e54274df90a0a933e05f8f78074f Mon Sep 17 00:00:00 2001
From: Conor Dooley <conor.dooley@microchip.com>
Date: Tue, 1 Aug 2023 09:08:21 +0100
Subject: [PATCH] MAINTAINERS: add loongson soc driver entry

As a result of there being no entry covering Loongson SoC drivers, some
fixes have fallen through the cracks. Add Huacai Chen as a supporter of
drivers, who will forward patches to the SoC maintainers.

Link: https://lore.kernel.org/all/58500dc7-af1b-4edb-bb2b-93be454ec151@app.fastmail.com/
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
---
 MAINTAINERS | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 3be1bdfe8ecc..0225bf871bab 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -12250,6 +12250,12 @@ S:	Maintained
 F:	Documentation/devicetree/bindings/i2c/loongson,ls2x-i2c.yaml
 F:	drivers/i2c/busses/i2c-ls2x.c
 
+LOONGSON SOC DRIVERS
+M:	Huacai Chen <chenhuacai@kernel.org>
+L:	loongarch@lists.linux.dev
+S:	Supported
+F:	drivers/soc/loongson/
+
 LOONGSON-2 SOC SERIES CLOCK DRIVER
 M:	Yinbo Zhu <zhuyinbo@loongson.cn>
 L:	linux-clk@vger.kernel.org
-- 
2.39.2



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

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

end of thread, other threads:[~2023-08-01  8:16 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-28  7:49 [PATCH v5 0/2] soc: loongson2_pm: add power management support Yinbo Zhu
2023-07-28  7:49 ` [PATCH v5 1/2] soc: dt-bindings: add loongson-2 pm Yinbo Zhu
2023-07-28  7:49 ` [PATCH v5 2/2] soc: loongson2_pm: add power management support Yinbo Zhu
2023-07-28 10:46   ` Arnd Bergmann
2023-07-31  3:12     ` Yinbo Zhu
2023-07-28 12:17   ` Randy Dunlap
2023-07-31  3:14     ` Yinbo Zhu
2023-07-28  8:27 ` [PATCH v5 0/2] " 陈华才
2023-07-28  8:36   ` Krzysztof Kozlowski
2023-07-28  9:18     ` Conor Dooley
2023-07-28  9:45       ` Krzysztof Kozlowski
2023-07-28 10:14         ` Conor Dooley
2023-07-28 10:21           ` Krzysztof Kozlowski
2023-07-28  8:43 ` Conor Dooley
2023-07-28  9:48   ` Huacai Chen
2023-07-28 10:18     ` Conor Dooley
2023-07-31 14:13       ` Huacai Chen
2023-07-31 19:28         ` Arnd Bergmann
2023-08-01  8:16           ` Conor Dooley

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.