* [PATCH v2 0/3] Add SiFive power provider driver
@ 2025-06-11 3:10 Nick Hu
2025-06-11 3:10 ` [PATCH v2 1/3] dt-bindings: power: Add SiFive Domain Management controllers Nick Hu
` (2 more replies)
0 siblings, 3 replies; 11+ messages in thread
From: Nick Hu @ 2025-06-11 3:10 UTC (permalink / raw)
To: conor+dt, krzk+dt, Alexandre Ghiti, linux-riscv
Cc: Nick Hu, Paul Walmsley, Palmer Dabbelt, Albert Ou, Samuel Holland
The v1 can be found in [1].
This patch introduces the SiFive power provider driver, which sets up a
generic power domain (genpd) provider to coordinate with the RISC-V SBI
cpuidle driver.
To enable this coordination, several functions from the cpuidle-riscv-sbi
driver are exposed for use by the external power provider. This allows
coordination between power domain management and CPU idle states on
SiFive platforms.
Changes in v2:
- Add the driver for SiFive TMC, CMC and SMC
- Drop the `sifive,feature-level` property
Links:
- [1] https://lore.kernel.org/linux-riscv/20250509021605.26764-1-nick.hu@sifive.com/
Nick Hu (3):
dt-bindings: power: Add SiFive Domain Management controllers
cpuidle: riscv-sbi: Work with the external pmdomain driver
cpuidle: Add SiFive power provider
.../devicetree/bindings/power/sifive,tmc.yaml | 70 ++++++++++++
drivers/cpuidle/Kconfig.riscv | 11 ++
drivers/cpuidle/Makefile | 1 +
drivers/cpuidle/cpuidle-riscv-sbi.c | 17 +--
drivers/cpuidle/cpuidle-riscv-sbi.h | 20 ++++
drivers/cpuidle/cpuidle-sifive-dmc-pd.c | 102 ++++++++++++++++++
6 files changed, 215 insertions(+), 6 deletions(-)
create mode 100644 Documentation/devicetree/bindings/power/sifive,tmc.yaml
create mode 100644 drivers/cpuidle/cpuidle-riscv-sbi.h
create mode 100644 drivers/cpuidle/cpuidle-sifive-dmc-pd.c
--
2.17.1
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v2 1/3] dt-bindings: power: Add SiFive Domain Management controllers
2025-06-11 3:10 [PATCH v2 0/3] Add SiFive power provider driver Nick Hu
@ 2025-06-11 3:10 ` Nick Hu
2025-06-11 6:57 ` Krzysztof Kozlowski
2025-06-11 3:10 ` [PATCH v2 2/3] cpuidle: riscv-sbi: Work with the external pmdomain driver Nick Hu
2025-06-11 3:10 ` [PATCH v2 3/3] cpuidle: Add SiFive power provider Nick Hu
2 siblings, 1 reply; 11+ messages in thread
From: Nick Hu @ 2025-06-11 3:10 UTC (permalink / raw)
To: conor+dt, krzk+dt, Cyan Yang, Nick Hu, Samuel Holland, devicetree,
linux-riscv, linux-kernel
Cc: Rob Herring, Paul Walmsley
SiFive Domain Management controller includes the following components
- SiFive Tile Management Controller
- SiFive Cluster Management Controller
- SiFive Core Complex Management Controller
These controllers control the clock and power domain of the
corresponding domain.
However, Since we don't have a SoC specific compatible string yet, so
add '- {}' for the first entry [1][2].
Links:
- [1] https://lore.kernel.org/lkml/20250311195953.GA14239-robh@kernel.org/
- [2] https://lore.kernel.org/lkml/CAKddAkAzDGL-7MbroRqQnZzPXOquUMKNuGGppqB-d_XZXbcvBA@mail.gmail.com/T/#t
Signed-off-by: Nick Hu <nick.hu@sifive.com>
Reviewed-by: Samuel Holland <samuel.holland@sifive.com>
---
.../devicetree/bindings/power/sifive,tmc.yaml | 70 +++++++++++++++++++
1 file changed, 70 insertions(+)
create mode 100644 Documentation/devicetree/bindings/power/sifive,tmc.yaml
diff --git a/Documentation/devicetree/bindings/power/sifive,tmc.yaml b/Documentation/devicetree/bindings/power/sifive,tmc.yaml
new file mode 100644
index 000000000000..4567d51148e1
--- /dev/null
+++ b/Documentation/devicetree/bindings/power/sifive,tmc.yaml
@@ -0,0 +1,70 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/power/sifive,tmc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: SiFive Domain Management Controller
+
+maintainers:
+ - Cyan Yang <cyan.yang@sifive.com>
+ - Nick Hu <nick.hu@sifive.com>
+ - Samuel Holland <samuel.holland@sifive.com>
+
+description: |
+ SiFive Domain Management Controllers includes the following components
+ - Tile Management Controller (TMC)
+ - Cluster Management Controller (CMC)
+ - Subsystem Management Controller (SMC)
+ These controllers manage both the clock and power domains of the
+ associated components. They support the SiFive Quiet Interface Protocol
+ (SQIP) starting from Version 1. The control method differs from Version
+ 0, making them incompatible.
+
+allOf:
+ - $ref: power-domain.yaml#
+
+properties:
+ compatible:
+ oneOf:
+ - items:
+ - {} # Leave a empty for future SoC specific compatible string
+ - const: sifive,cmc3
+ - const: sifive,cmc2
+ - items:
+ - {} # Leave a empty for future SoC specific compatible string
+ - const: sifive,cmc2
+ - items:
+ - {} # Leave a empty for future SoC specific compatible string
+ - const: sifive,smc0
+ - items:
+ - {} # Leave a empty for future SoC specific compatible string
+ - const: sifive,smc1
+ - items:
+ - {} # Leave a empty for future SoC specific compatible string
+ - const: sifive,smc3
+ - const: sifive,smc1
+ - items:
+ - {} # Leave a empty for future SoC specific compatible string
+ - const: sifive,tmc0
+ - items:
+ - {} # Leave a empty for future SoC specific compatible string
+ - const: sifive,tmc1
+ - items:
+ - {} # Leave a empty for future SoC specific compatible string
+ - const: sifive,tmc3
+ - const: sifive,tmc1
+
+ reg:
+ maxItems: 1
+
+ "#power-domain-cells":
+ const: 0
+
+required:
+ - compatible
+ - reg
+
+additionalProperties: false
+
+# The example will be added once the SoC specific compatible string is available
--
2.17.1
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v2 2/3] cpuidle: riscv-sbi: Work with the external pmdomain driver
2025-06-11 3:10 [PATCH v2 0/3] Add SiFive power provider driver Nick Hu
2025-06-11 3:10 ` [PATCH v2 1/3] dt-bindings: power: Add SiFive Domain Management controllers Nick Hu
@ 2025-06-11 3:10 ` Nick Hu
2025-06-11 3:10 ` [PATCH v2 3/3] cpuidle: Add SiFive power provider Nick Hu
2 siblings, 0 replies; 11+ messages in thread
From: Nick Hu @ 2025-06-11 3:10 UTC (permalink / raw)
To: conor+dt, krzk+dt, Alexandre Ghiti, linux-kernel, linux-pm,
linux-riscv
Cc: Nick Hu, Samuel Holland, Anup Patel, Rafael J. Wysocki,
Daniel Lezcano, Paul Walmsley, Palmer Dabbelt, Albert Ou
To work with the external pmdomain driver, exposing the
`sbi_cpuidle_pd_power_off` and `sbi_dt_parse_state_node` so the external
pmdomain driver can parse the riscv idle state data and set the domain
idle state where powering off. In addition, defer the driver without
error message when the parent domain is not ready.
Co-developed-by: Samuel Holland <samuel.holland@sifive.com>
Signed-off-by: Samuel Holland <samuel.holland@sifive.com>
Signed-off-by: Nick Hu <nick.hu@sifive.com>
---
drivers/cpuidle/cpuidle-riscv-sbi.c | 17 +++++++++++------
drivers/cpuidle/cpuidle-riscv-sbi.h | 20 ++++++++++++++++++++
2 files changed, 31 insertions(+), 6 deletions(-)
create mode 100644 drivers/cpuidle/cpuidle-riscv-sbi.h
diff --git a/drivers/cpuidle/cpuidle-riscv-sbi.c b/drivers/cpuidle/cpuidle-riscv-sbi.c
index 0fe1ece9fbdc..d53254601522 100644
--- a/drivers/cpuidle/cpuidle-riscv-sbi.c
+++ b/drivers/cpuidle/cpuidle-riscv-sbi.c
@@ -27,6 +27,7 @@
#include <asm/suspend.h>
#include "cpuidle.h"
+#include "cpuidle-riscv-sbi.h"
#include "dt_idle_states.h"
#include "dt_idle_genpd.h"
@@ -188,7 +189,7 @@ static const struct of_device_id sbi_cpuidle_state_match[] = {
{ },
};
-static int sbi_dt_parse_state_node(struct device_node *np, u32 *state)
+int sbi_dt_parse_state_node(struct device_node *np, u32 *state)
{
int err = of_property_read_u32(np, "riscv,sbi-suspend-param", state);
@@ -325,8 +326,9 @@ static int sbi_cpuidle_init_cpu(struct device *dev, int cpu)
/* Initialize idle states from DT. */
ret = sbi_cpuidle_dt_init_states(dev, drv, cpu, state_count);
if (ret) {
- pr_err("HART%ld: failed to init idle states\n",
- cpuid_to_hartid_map(cpu));
+ if (ret != -EPROBE_DEFER)
+ pr_err("HART%ld: failed to init idle states\n",
+ cpuid_to_hartid_map(cpu));
return ret;
}
@@ -356,7 +358,7 @@ static void sbi_cpuidle_domain_sync_state(struct device *dev)
#ifdef CONFIG_DT_IDLE_GENPD
-static int sbi_cpuidle_pd_power_off(struct generic_pm_domain *pd)
+int sbi_cpuidle_pd_power_off(struct generic_pm_domain *pd)
{
struct genpd_power_state *state = &pd->states[pd->state_idx];
u32 *pd_state;
@@ -533,8 +535,11 @@ static int sbi_cpuidle_probe(struct platform_device *pdev)
for_each_present_cpu(cpu) {
ret = sbi_cpuidle_init_cpu(&pdev->dev, cpu);
if (ret) {
- pr_debug("HART%ld: idle driver init failed\n",
- cpuid_to_hartid_map(cpu));
+ if (ret == -EPROBE_DEFER)
+ pr_debug("idle driver probe deferred\n");
+ else
+ pr_debug("HART%ld: idle driver init failed\n",
+ cpuid_to_hartid_map(cpu));
goto out_fail;
}
}
diff --git a/drivers/cpuidle/cpuidle-riscv-sbi.h b/drivers/cpuidle/cpuidle-riscv-sbi.h
new file mode 100644
index 000000000000..f39186b65a10
--- /dev/null
+++ b/drivers/cpuidle/cpuidle-riscv-sbi.h
@@ -0,0 +1,20 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef __CPUIDLE_RISCV_SBI
+#define __CPUIDLE_RISCV_SBI
+
+#ifdef CONFIG_DT_IDLE_GENPD
+
+int sbi_cpuidle_pd_power_off(struct generic_pm_domain *pd);
+
+#else
+
+static inline int sbi_cpuidle_pd_power_off(struct generic_pm_domain *pd)
+{
+ return 0;
+}
+
+#endif
+
+int sbi_dt_parse_state_node(struct device_node *np, u32 *state);
+
+#endif
--
2.17.1
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v2 3/3] cpuidle: Add SiFive power provider
2025-06-11 3:10 [PATCH v2 0/3] Add SiFive power provider driver Nick Hu
2025-06-11 3:10 ` [PATCH v2 1/3] dt-bindings: power: Add SiFive Domain Management controllers Nick Hu
2025-06-11 3:10 ` [PATCH v2 2/3] cpuidle: riscv-sbi: Work with the external pmdomain driver Nick Hu
@ 2025-06-11 3:10 ` Nick Hu
2025-06-11 22:09 ` kernel test robot
` (2 more replies)
2 siblings, 3 replies; 11+ messages in thread
From: Nick Hu @ 2025-06-11 3:10 UTC (permalink / raw)
To: conor+dt, krzk+dt, Alexandre Ghiti, linux-kernel, linux-pm,
linux-riscv
Cc: Nick Hu, Rafael J. Wysocki, Daniel Lezcano, Paul Walmsley,
Palmer Dabbelt, Albert Ou, Samuel Holland
The SiFive DMC is the power provider of the devices that inside the
SiFive CPU power domains, which include Tile, Cluster and Core Complex
power domains. Before the cpu entering the firmware-based idle state,
each devices that inside the corresponding domain should be suspended
properly. So this driver will create the power provider and set the
correct idle state.
Signed-off-by: Nick Hu <nick.hu@sifive.com>
---
drivers/cpuidle/Kconfig.riscv | 11 +++
drivers/cpuidle/Makefile | 1 +
drivers/cpuidle/cpuidle-sifive-dmc-pd.c | 102 ++++++++++++++++++++++++
3 files changed, 114 insertions(+)
create mode 100644 drivers/cpuidle/cpuidle-sifive-dmc-pd.c
diff --git a/drivers/cpuidle/Kconfig.riscv b/drivers/cpuidle/Kconfig.riscv
index 78518c26af74..af802afefa21 100644
--- a/drivers/cpuidle/Kconfig.riscv
+++ b/drivers/cpuidle/Kconfig.riscv
@@ -13,3 +13,14 @@ config RISCV_SBI_CPUIDLE
Select this option to enable RISC-V SBI firmware based CPU idle
driver for RISC-V systems. This drivers also supports hierarchical
DT based layout of the idle state.
+
+config SIFIVE_DMC_PD_CPUIDLE
+ bool "SiFive DMC SBI PD Provider Driver"
+ depends on ARCH_SIFIVE
+ select PM_GENERIC_DOMAINS_OF
+ select RISCV_SBI_CPUIDLE
+ default y
+ help
+ Select this option to enable SiFive DMC SBI PD Provider driver.
+ This driver will create the genpd provider and work with the
+ RISC-V SBI firmware based CPU idle driver.
diff --git a/drivers/cpuidle/Makefile b/drivers/cpuidle/Makefile
index 1de9e92c5b0f..1f8e01b415e8 100644
--- a/drivers/cpuidle/Makefile
+++ b/drivers/cpuidle/Makefile
@@ -42,3 +42,4 @@ obj-$(CONFIG_POWERNV_CPUIDLE) += cpuidle-powernv.o
###############################################################################
# RISC-V drivers
obj-$(CONFIG_RISCV_SBI_CPUIDLE) += cpuidle-riscv-sbi.o
+obj-$(CONFIG_SIFIVE_DMC_PD_CPUIDLE) += cpuidle-sifive-dmc-pd.o
diff --git a/drivers/cpuidle/cpuidle-sifive-dmc-pd.c b/drivers/cpuidle/cpuidle-sifive-dmc-pd.c
new file mode 100644
index 000000000000..1c6b2131e573
--- /dev/null
+++ b/drivers/cpuidle/cpuidle-sifive-dmc-pd.c
@@ -0,0 +1,102 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * SiFive CPUIDLE SBI PD driver
+ */
+
+#define pr_fmt(fmt) "sifive_cpuidle_sbi_pd: " fmt
+
+#include <linux/of_device.h>
+#include <linux/platform_device.h>
+#include <linux/pm_domain.h>
+#include <linux/pm_runtime.h>
+
+#include "cpuidle-riscv-sbi.h"
+#include "dt_idle_genpd.h"
+
+static void sifive_dmc_remove(struct platform_device *pdev)
+{
+ struct generic_pm_domain *pd = platform_get_drvdata(pdev);
+ struct device *dev = &pdev->dev;
+
+ pm_runtime_disable(dev);
+ of_genpd_del_provider(dev->of_node);
+ pm_genpd_remove(pd);
+ dt_idle_pd_free(pd);
+}
+
+static int sifive_dmc_probe(struct platform_device *pdev)
+{
+ struct device *dev = &pdev->dev;
+ struct device_node *np = dev->of_node;
+ struct generic_pm_domain *pd;
+ struct of_phandle_args child, parent;
+ int ret = -ENOMEM;
+
+ pd = dt_idle_pd_alloc(np, sbi_dt_parse_state_node);
+ if (!pd)
+ goto fail;
+
+ pd->flags |= GENPD_FLAG_IRQ_SAFE | GENPD_FLAG_CPU_DOMAIN;
+ pd->power_off = sbi_cpuidle_pd_power_off;
+
+ ret = pm_genpd_init(pd, &pm_domain_cpu_gov, false);
+ if (ret)
+ goto free_pd;
+
+ ret = of_genpd_add_provider_simple(np, pd);
+ if (ret)
+ goto remove_pd;
+
+ if (of_parse_phandle_with_args(np, "power-domains",
+ "#power-domain-cells", 0,
+ &parent) == 0) {
+ child.np = np;
+ child.args_count = 0;
+
+ if (of_genpd_add_subdomain(&parent, &child))
+ pr_warn("%pOF failed to add subdomain: %pOF\n",
+ parent.np, child.np);
+ else
+ pr_debug("%pOF has a child subdomain: %pOF.\n",
+ parent.np, child.np);
+ }
+
+ platform_set_drvdata(pdev, pd);
+ pm_runtime_enable(dev);
+ pr_info("%s create success\n", pd->name);
+ return 0;
+
+remove_pd:
+ pm_genpd_remove(pd);
+free_pd:
+ dt_idle_pd_free(pd);
+fail:
+ pr_info("%s create fail\n", pd->name);
+
+ return ret;
+}
+
+static const struct of_device_id sifive_dmc_of_match[] = {
+ { .compatible = "sifive,tmc1", },
+ { .compatible = "sifive,tmc0", },
+ { .compatible = "sifive,smc1", },
+ { .compatible = "sifive,smc0", },
+ { .compatible = "sifive,cmc2", },
+ {}
+};
+
+static struct platform_driver sifive_dmc_driver = {
+ .probe = sifive_dmc_probe,
+ .remove = sifive_dmc_remove,
+ .driver = {
+ .name = "sifive_dmc",
+ .of_match_table = sifive_dmc_of_match,
+ .suppress_bind_attrs = true,
+ },
+};
+
+static int __init sifive_dmc_init(void)
+{
+ return platform_driver_register(&sifive_dmc_driver);
+}
+arch_initcall(sifive_dmc_init);
--
2.17.1
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH v2 1/3] dt-bindings: power: Add SiFive Domain Management controllers
2025-06-11 3:10 ` [PATCH v2 1/3] dt-bindings: power: Add SiFive Domain Management controllers Nick Hu
@ 2025-06-11 6:57 ` Krzysztof Kozlowski
2025-06-11 7:15 ` Nick Hu
0 siblings, 1 reply; 11+ messages in thread
From: Krzysztof Kozlowski @ 2025-06-11 6:57 UTC (permalink / raw)
To: Nick Hu, conor+dt, krzk+dt, Cyan Yang, Samuel Holland, devicetree,
linux-riscv, linux-kernel
Cc: Rob Herring, Paul Walmsley
On 11/06/2025 05:10, Nick Hu wrote:
> SiFive Domain Management controller includes the following components
> - SiFive Tile Management Controller
> - SiFive Cluster Management Controller
> - SiFive Core Complex Management Controller
>
> These controllers control the clock and power domain of the
> corresponding domain.
>
> However, Since we don't have a SoC specific compatible string yet, so
> add '- {}' for the first entry [1][2].
But you must have Soc specific compatible strings. See previous discussion.
Best regards,
Krzysztof
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 1/3] dt-bindings: power: Add SiFive Domain Management controllers
2025-06-11 6:57 ` Krzysztof Kozlowski
@ 2025-06-11 7:15 ` Nick Hu
2025-06-11 7:20 ` Krzysztof Kozlowski
0 siblings, 1 reply; 11+ messages in thread
From: Nick Hu @ 2025-06-11 7:15 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: conor+dt, krzk+dt, Cyan Yang, Samuel Holland, devicetree,
linux-riscv, linux-kernel, Rob Herring, Paul Walmsley
On Wed, Jun 11, 2025 at 2:57 PM Krzysztof Kozlowski <krzk@kernel.org> wrote:
>
> On 11/06/2025 05:10, Nick Hu wrote:
> > SiFive Domain Management controller includes the following components
> > - SiFive Tile Management Controller
> > - SiFive Cluster Management Controller
> > - SiFive Core Complex Management Controller
> >
> > These controllers control the clock and power domain of the
> > corresponding domain.
> >
> > However, Since we don't have a SoC specific compatible string yet, so
> > add '- {}' for the first entry [1][2].
>
>
> But you must have Soc specific compatible strings. See previous discussion.
>
Maybe I'm missing something, but since we don't have a SoC-specific compatible
string yet, I thought we agreed to include a `- {}` as the first
entry, along with an
explanation in both the commit message and comments [1].
Links:
- [1] https://lore.kernel.org/linux-riscv/c91d99c9-0ecb-4dcd-9beb-5a1e9fadc619@kernel.org/
> Best regards,
> Krzysztof
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 1/3] dt-bindings: power: Add SiFive Domain Management controllers
2025-06-11 7:15 ` Nick Hu
@ 2025-06-11 7:20 ` Krzysztof Kozlowski
2025-06-16 1:48 ` Nick Hu
0 siblings, 1 reply; 11+ messages in thread
From: Krzysztof Kozlowski @ 2025-06-11 7:20 UTC (permalink / raw)
To: Nick Hu
Cc: conor+dt, krzk+dt, Cyan Yang, Samuel Holland, devicetree,
linux-riscv, linux-kernel, Rob Herring, Paul Walmsley
On 11/06/2025 09:15, Nick Hu wrote:
> On Wed, Jun 11, 2025 at 2:57 PM Krzysztof Kozlowski <krzk@kernel.org> wrote:
>>
>> On 11/06/2025 05:10, Nick Hu wrote:
>>> SiFive Domain Management controller includes the following components
>>> - SiFive Tile Management Controller
>>> - SiFive Cluster Management Controller
>>> - SiFive Core Complex Management Controller
>>>
>>> These controllers control the clock and power domain of the
>>> corresponding domain.
>>>
>>> However, Since we don't have a SoC specific compatible string yet, so
>>> add '- {}' for the first entry [1][2].
>>
>>
>> But you must have Soc specific compatible strings. See previous discussion.
>>
> Maybe I'm missing something, but since we don't have a SoC-specific compatible
> string yet, I thought we agreed to include a `- {}` as the first
> entry, along with an
> explanation in both the commit message and comments [1].
But your commit msg does not explain. You need to explain why you do not
have SoC specific compatibles. Saying "I do not have a SoC specific
compatible" is not an argument explaining why you do not have SoC
specific compatible.
Best regards,
Krzysztof
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 3/3] cpuidle: Add SiFive power provider
2025-06-11 3:10 ` [PATCH v2 3/3] cpuidle: Add SiFive power provider Nick Hu
@ 2025-06-11 22:09 ` kernel test robot
2025-06-11 23:11 ` kernel test robot
2025-06-12 1:16 ` kernel test robot
2 siblings, 0 replies; 11+ messages in thread
From: kernel test robot @ 2025-06-11 22:09 UTC (permalink / raw)
To: Nick Hu, conor+dt, krzk+dt, Alexandre Ghiti, linux-kernel,
linux-pm, linux-riscv
Cc: Paul Gazzillo, Necip Fazil Yildiran, oe-kbuild-all, Nick Hu,
Rafael J. Wysocki, Daniel Lezcano, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Samuel Holland
Hi Nick,
kernel test robot noticed the following build warnings:
[auto build test WARNING on rafael-pm/linux-next]
[also build test WARNING on rafael-pm/bleeding-edge robh/for-next linus/master v6.16-rc1 next-20250611]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Nick-Hu/cpuidle-riscv-sbi-Work-with-the-external-pmdomain-driver/20250611-121115
base: https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git linux-next
patch link: https://lore.kernel.org/r/20250611031023.28769-4-nick.hu%40sifive.com
patch subject: [PATCH v2 3/3] cpuidle: Add SiFive power provider
config: riscv-kismet-CONFIG_PM_GENERIC_DOMAINS_OF-CONFIG_SIFIVE_DMC_PD_CPUIDLE-0-0 (https://download.01.org/0day-ci/archive/20250612/202506120535.f1iULf9O-lkp@intel.com/config)
reproduce: (https://download.01.org/0day-ci/archive/20250612/202506120535.f1iULf9O-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202506120535.f1iULf9O-lkp@intel.com/
kismet warnings: (new ones prefixed by >>)
>> kismet: WARNING: unmet direct dependencies detected for PM_GENERIC_DOMAINS_OF when selected by SIFIVE_DMC_PD_CPUIDLE
WARNING: unmet direct dependencies detected for PM_GENERIC_DOMAINS_OF
Depends on [n]: PM_GENERIC_DOMAINS [=n] && OF [=y]
Selected by [y]:
- SIFIVE_DMC_PD_CPUIDLE [=y] && CPU_IDLE [=y] && RISCV [=y] && ARCH_SIFIVE [=y]
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 3/3] cpuidle: Add SiFive power provider
2025-06-11 3:10 ` [PATCH v2 3/3] cpuidle: Add SiFive power provider Nick Hu
2025-06-11 22:09 ` kernel test robot
@ 2025-06-11 23:11 ` kernel test robot
2025-06-12 1:16 ` kernel test robot
2 siblings, 0 replies; 11+ messages in thread
From: kernel test robot @ 2025-06-11 23:11 UTC (permalink / raw)
To: Nick Hu, conor+dt, krzk+dt, Alexandre Ghiti, linux-kernel,
linux-pm, linux-riscv
Cc: Paul Gazzillo, Necip Fazil Yildiran, oe-kbuild-all, Nick Hu,
Rafael J. Wysocki, Daniel Lezcano, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Samuel Holland
Hi Nick,
kernel test robot noticed the following build warnings:
[auto build test WARNING on rafael-pm/linux-next]
[also build test WARNING on rafael-pm/bleeding-edge robh/for-next linus/master v6.16-rc1 next-20250611]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Nick-Hu/cpuidle-riscv-sbi-Work-with-the-external-pmdomain-driver/20250611-121115
base: https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git linux-next
patch link: https://lore.kernel.org/r/20250611031023.28769-4-nick.hu%40sifive.com
patch subject: [PATCH v2 3/3] cpuidle: Add SiFive power provider
config: riscv-kismet-CONFIG_RISCV_SBI_CPUIDLE-CONFIG_SIFIVE_DMC_PD_CPUIDLE-0-0 (https://download.01.org/0day-ci/archive/20250612/202506120735.Ek7I6Nze-lkp@intel.com/config)
reproduce: (https://download.01.org/0day-ci/archive/20250612/202506120735.Ek7I6Nze-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202506120735.Ek7I6Nze-lkp@intel.com/
kismet warnings: (new ones prefixed by >>)
>> kismet: WARNING: unmet direct dependencies detected for RISCV_SBI_CPUIDLE when selected by SIFIVE_DMC_PD_CPUIDLE
WARNING: unmet direct dependencies detected for PM_GENERIC_DOMAINS_OF
Depends on [n]: PM_GENERIC_DOMAINS [=n] && OF [=y]
Selected by [y]:
- SIFIVE_DMC_PD_CPUIDLE [=y] && CPU_IDLE [=y] && RISCV [=y] && ARCH_SIFIVE [=y]
WARNING: unmet direct dependencies detected for RISCV_SBI_CPUIDLE
Depends on [n]: CPU_IDLE [=y] && RISCV [=y] && RISCV_SBI [=n]
Selected by [y]:
- SIFIVE_DMC_PD_CPUIDLE [=y] && CPU_IDLE [=y] && RISCV [=y] && ARCH_SIFIVE [=y]
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 3/3] cpuidle: Add SiFive power provider
2025-06-11 3:10 ` [PATCH v2 3/3] cpuidle: Add SiFive power provider Nick Hu
2025-06-11 22:09 ` kernel test robot
2025-06-11 23:11 ` kernel test robot
@ 2025-06-12 1:16 ` kernel test robot
2 siblings, 0 replies; 11+ messages in thread
From: kernel test robot @ 2025-06-12 1:16 UTC (permalink / raw)
To: Nick Hu, conor+dt, krzk+dt, Alexandre Ghiti, linux-kernel,
linux-pm, linux-riscv
Cc: llvm, oe-kbuild-all, Nick Hu, Rafael J. Wysocki, Daniel Lezcano,
Paul Walmsley, Palmer Dabbelt, Albert Ou, Samuel Holland
Hi Nick,
kernel test robot noticed the following build errors:
[auto build test ERROR on rafael-pm/linux-next]
[also build test ERROR on rafael-pm/bleeding-edge robh/for-next linus/master v6.16-rc1 next-20250611]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Nick-Hu/cpuidle-riscv-sbi-Work-with-the-external-pmdomain-driver/20250611-121115
base: https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git linux-next
patch link: https://lore.kernel.org/r/20250611031023.28769-4-nick.hu%40sifive.com
patch subject: [PATCH v2 3/3] cpuidle: Add SiFive power provider
config: riscv-randconfig-002-20250612 (https://download.01.org/0day-ci/archive/20250612/202506120817.nRfhoHbQ-lkp@intel.com/config)
compiler: clang version 21.0.0git (https://github.com/llvm/llvm-project f819f46284f2a79790038e1f6649172789734ae8)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250612/202506120817.nRfhoHbQ-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202506120817.nRfhoHbQ-lkp@intel.com/
All errors (new ones prefixed by >>):
In file included from drivers/cpuidle/cpuidle-sifive-dmc-pd.c:8:
In file included from include/linux/of_device.h:5:
In file included from include/linux/device/driver.h:21:
In file included from include/linux/module.h:19:
In file included from include/linux/elf.h:6:
In file included from arch/riscv/include/asm/elf.h:12:
In file included from include/linux/compat.h:17:
include/linux/fs.h:3975:15: warning: label followed by a declaration is a C23 extension [-Wc23-extensions]
3975 | if (unlikely(get_user(c, path)))
| ^
arch/riscv/include/asm/uaccess.h:274:3: note: expanded from macro 'get_user'
274 | __get_user((x), __p) : \
| ^
arch/riscv/include/asm/uaccess.h:244:2: note: expanded from macro '__get_user'
244 | __get_user_error(__gu_val, __gu_ptr, __gu_err); \
| ^
arch/riscv/include/asm/uaccess.h:207:2: note: expanded from macro '__get_user_error'
207 | __get_user_nocheck(x, ptr, __gu_failed); \
| ^
arch/riscv/include/asm/uaccess.h:196:3: note: expanded from macro '__get_user_nocheck'
196 | __get_user_8((x), __gu_ptr, label); \
| ^
arch/riscv/include/asm/uaccess.h:130:2: note: expanded from macro '__get_user_8'
130 | u32 __user *__ptr = (u32 __user *)(ptr); \
| ^
>> drivers/cpuidle/cpuidle-sifive-dmc-pd.c:42:27: error: use of undeclared identifier 'pm_domain_cpu_gov'
42 | ret = pm_genpd_init(pd, &pm_domain_cpu_gov, false);
| ^
1 warning and 1 error generated.
--
In file included from drivers/cpuidle/cpuidle-riscv-sbi.c:16:
In file included from include/linux/cpu_cooling.h:17:
In file included from include/linux/thermal.h:15:
In file included from include/linux/device.h:32:
In file included from include/linux/device/driver.h:21:
In file included from include/linux/module.h:19:
In file included from include/linux/elf.h:6:
In file included from arch/riscv/include/asm/elf.h:12:
In file included from include/linux/compat.h:17:
include/linux/fs.h:3975:15: warning: label followed by a declaration is a C23 extension [-Wc23-extensions]
3975 | if (unlikely(get_user(c, path)))
| ^
arch/riscv/include/asm/uaccess.h:274:3: note: expanded from macro 'get_user'
274 | __get_user((x), __p) : \
| ^
arch/riscv/include/asm/uaccess.h:244:2: note: expanded from macro '__get_user'
244 | __get_user_error(__gu_val, __gu_ptr, __gu_err); \
| ^
arch/riscv/include/asm/uaccess.h:207:2: note: expanded from macro '__get_user_error'
207 | __get_user_nocheck(x, ptr, __gu_failed); \
| ^
arch/riscv/include/asm/uaccess.h:196:3: note: expanded from macro '__get_user_nocheck'
196 | __get_user_8((x), __gu_ptr, label); \
| ^
arch/riscv/include/asm/uaccess.h:130:2: note: expanded from macro '__get_user_8'
130 | u32 __user *__ptr = (u32 __user *)(ptr); \
| ^
>> drivers/cpuidle/cpuidle-riscv-sbi.c:410:25: error: use of undeclared identifier 'pm_domain_cpu_gov'
410 | pd_gov = pd->states ? &pm_domain_cpu_gov : NULL;
| ^
1 warning and 1 error generated.
Kconfig warnings: (for reference only)
WARNING: unmet direct dependencies detected for PM_GENERIC_DOMAINS_OF
Depends on [n]: PM_GENERIC_DOMAINS [=n] && OF [=y]
Selected by [y]:
- SIFIVE_DMC_PD_CPUIDLE [=y] && CPU_IDLE [=y] && RISCV [=y] && ARCH_SIFIVE [=y]
vim +/pm_domain_cpu_gov +42 drivers/cpuidle/cpuidle-sifive-dmc-pd.c
26
27 static int sifive_dmc_probe(struct platform_device *pdev)
28 {
29 struct device *dev = &pdev->dev;
30 struct device_node *np = dev->of_node;
31 struct generic_pm_domain *pd;
32 struct of_phandle_args child, parent;
33 int ret = -ENOMEM;
34
35 pd = dt_idle_pd_alloc(np, sbi_dt_parse_state_node);
36 if (!pd)
37 goto fail;
38
39 pd->flags |= GENPD_FLAG_IRQ_SAFE | GENPD_FLAG_CPU_DOMAIN;
40 pd->power_off = sbi_cpuidle_pd_power_off;
41
> 42 ret = pm_genpd_init(pd, &pm_domain_cpu_gov, false);
43 if (ret)
44 goto free_pd;
45
46 ret = of_genpd_add_provider_simple(np, pd);
47 if (ret)
48 goto remove_pd;
49
50 if (of_parse_phandle_with_args(np, "power-domains",
51 "#power-domain-cells", 0,
52 &parent) == 0) {
53 child.np = np;
54 child.args_count = 0;
55
56 if (of_genpd_add_subdomain(&parent, &child))
57 pr_warn("%pOF failed to add subdomain: %pOF\n",
58 parent.np, child.np);
59 else
60 pr_debug("%pOF has a child subdomain: %pOF.\n",
61 parent.np, child.np);
62 }
63
64 platform_set_drvdata(pdev, pd);
65 pm_runtime_enable(dev);
66 pr_info("%s create success\n", pd->name);
67 return 0;
68
69 remove_pd:
70 pm_genpd_remove(pd);
71 free_pd:
72 dt_idle_pd_free(pd);
73 fail:
74 pr_info("%s create fail\n", pd->name);
75
76 return ret;
77 }
78
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 1/3] dt-bindings: power: Add SiFive Domain Management controllers
2025-06-11 7:20 ` Krzysztof Kozlowski
@ 2025-06-16 1:48 ` Nick Hu
0 siblings, 0 replies; 11+ messages in thread
From: Nick Hu @ 2025-06-16 1:48 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: conor+dt, krzk+dt, Cyan Yang, Samuel Holland, devicetree,
linux-riscv, linux-kernel, Rob Herring, Paul Walmsley
On Wed, Jun 11, 2025 at 3:20 PM Krzysztof Kozlowski <krzk@kernel.org> wrote:
>
> On 11/06/2025 09:15, Nick Hu wrote:
> > On Wed, Jun 11, 2025 at 2:57 PM Krzysztof Kozlowski <krzk@kernel.org> wrote:
> >>
> >> On 11/06/2025 05:10, Nick Hu wrote:
> >>> SiFive Domain Management controller includes the following components
> >>> - SiFive Tile Management Controller
> >>> - SiFive Cluster Management Controller
> >>> - SiFive Core Complex Management Controller
> >>>
> >>> These controllers control the clock and power domain of the
> >>> corresponding domain.
> >>>
> >>> However, Since we don't have a SoC specific compatible string yet, so
> >>> add '- {}' for the first entry [1][2].
> >>
> >>
> >> But you must have Soc specific compatible strings. See previous discussion.
> >>
> > Maybe I'm missing something, but since we don't have a SoC-specific compatible
> > string yet, I thought we agreed to include a `- {}` as the first
> > entry, along with an
> > explanation in both the commit message and comments [1].
> But your commit msg does not explain. You need to explain why you do not
> have SoC specific compatibles. Saying "I do not have a SoC specific
> compatible" is not an argument explaining why you do not have SoC
> specific compatible.
>
You're right. How about updating the commit msg to "When the SoCs are
ready, we will add the SoC compatible string at that time" ?
Best regards,
Nick
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2025-06-16 3:00 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-11 3:10 [PATCH v2 0/3] Add SiFive power provider driver Nick Hu
2025-06-11 3:10 ` [PATCH v2 1/3] dt-bindings: power: Add SiFive Domain Management controllers Nick Hu
2025-06-11 6:57 ` Krzysztof Kozlowski
2025-06-11 7:15 ` Nick Hu
2025-06-11 7:20 ` Krzysztof Kozlowski
2025-06-16 1:48 ` Nick Hu
2025-06-11 3:10 ` [PATCH v2 2/3] cpuidle: riscv-sbi: Work with the external pmdomain driver Nick Hu
2025-06-11 3:10 ` [PATCH v2 3/3] cpuidle: Add SiFive power provider Nick Hu
2025-06-11 22:09 ` kernel test robot
2025-06-11 23:11 ` kernel test robot
2025-06-12 1:16 ` kernel test robot
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).