Skip to contentSkip to conversation

dt-bindings: Add a cpu-capacity property for RISC-V

PATCH Applied Conor Dooley 6 participants 10 messages Jan 4, 2023 – Feb 15, 2023

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

cover dt-bindings: Add a cpu-capacity property for RISC-V

From: Conor Dooley <[email protected]>

Hey,

Ever since RISC-V starting using generic arch topology code, the code paths for cpu-capacity have been there but there's no binding defined to actually convey the information. Defining the same property as used on arm seems to be the only logical thing to do, so do it.

It's worth noting that right now, actually putting this property in a DT will cause allocation failures on RISC-V - but there's already a patch for that thanks to Ley Foon Tan:
https://patchwork.kernel.org/project/linux-riscv/patch/[email protected]/

Thanks,
Conor.

CC Ley Foon Tan <[email protected]>
CC Sudeep Holla <[email protected]>
CC Palmer Dabbelt <[email protected]>
CC Conor Dooley <[email protected]>
CC Rob Herring <[email protected]>
CC Krzysztof Kozlowski <[email protected]>
CC Jonathan Corbet <[email protected]>
CC Alex Shi <[email protected]>
CC Yanteng Si <[email protected]>
CC Lorenzo Pieralisi <[email protected]>

Conor Dooley (2):
dt-bindings: arm: move cpu-capacity to a shared loation
dt-bindings: riscv: add a capacity-dmips-mhz cpu property

 Documentation/devicetree/bindings/arm/cpus.yaml             | 2 +-
 .../devicetree/bindings/{arm => cpu}/cpu-capacity.txt       | 4 ++--
 Documentation/devicetree/bindings/riscv/cpus.yaml           | 6 ++++++
 Documentation/scheduler/sched-capacity.rst                  | 2 +-
 .../translations/zh_CN/scheduler/sched-capacity.rst         | 2 +-
 5 files changed, 11 insertions(+), 5 deletions(-)
 rename Documentation/devicetree/bindings/{arm => cpu}/cpu-capacity.txt (98%)
Signature · 1 line
2.39.0
#1 lore raw

PATCH 1/2 dt-bindings: arm: move cpu-capacity to a shared loation

From: Conor Dooley <[email protected]>

RISC-V uses the same generic topology code as arm64 & while there currently exists no binding for cpu-capacity on RISC-V, the code paths can be hit if the property is present.

Move the documentation of cpu-capacity to a shared location, ahead of defining a binding for capacity-dmips-mhz on RISC-V. Update some references to this document in the process.

---
I wasn't sure what to do with reference [1], but since the property will be the same on RISC-V, I left it as is.

---
 Documentation/devicetree/bindings/arm/cpus.yaml               | 2 +-
 .../devicetree/bindings/{arm => cpu}/cpu-capacity.txt         | 4 ++--
 Documentation/scheduler/sched-capacity.rst                    | 2 +-
 Documentation/translations/zh_CN/scheduler/sched-capacity.rst | 2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)
 rename Documentation/devicetree/bindings/{arm => cpu}/cpu-capacity.txt (98%)
Documentation/devicetree/bindings/arm/cpus.yaml +1 -1
index 01b5a9c689a2..a7586295a6f5 100644
@@ -257,7 +257,7 @@ properties:
 
   capacity-dmips-mhz:
     description:
-      u32 value representing CPU capacity (see ./cpu-capacity.txt) in
+      u32 value representing CPU capacity (see ../cpu/cpu-capacity.txt) in
       DMIPS/MHz, relative to highest capacity-dmips-mhz
       in the system.
 
Documentation/devicetree/bindings/cpu/cpu-capacity.txt renamed from Documentation/devicetree/bindings/arm/cpu-capacity.txt +2 -2
similarity index 98%
rename from Documentation/devicetree/bindings/arm/cpu-capacity.txt
rename to Documentation/devicetree/bindings/cpu/cpu-capacity.txt
index cc5e190390b7..f28e1adad428 100644
@@ -1,12 +1,12 @@
 ==========================================
-ARM CPUs capacity bindings
+CPU capacity bindings
 ==========================================
 
 ==========================================
 1 - Introduction
 ==========================================
 
-ARM systems may be configured to have cpus with different power/performance
+Some systems may be configured to have cpus with different power/performance
 characteristics within the same chip. In this case, additional information has
 to be made available to the kernel for it to be aware of such differences and
 take decisions accordingly.
Documentation/scheduler/sched-capacity.rst +1 -1
index 805f85f330b5..8e2b8538bc2b 100644
@@ -260,7 +260,7 @@ for that purpose.
 
 The arm and arm64 architectures directly map this to the arch_topology driver
 CPU scaling data, which is derived from the capacity-dmips-mhz CPU binding; see
-Documentation/devicetree/bindings/arm/cpu-capacity.txt.
+Documentation/devicetree/bindings/cpu/cpu-capacity.txt.
 
 3.2 Frequency invariance
 ------------------------
Documentation/translations/zh_CN/scheduler/sched-capacity.rst +1 -1
index 3a52053c29dc..e07ffdd391d3 100644
@@ -233,7 +233,7 @@ CFS调度类基于实体负载跟踪机制(Per-Entity Load Tracking, PELT)
 
 arm和arm64架构直接把这个信息映射到arch_topology驱动的CPU scaling数据中(译注:参考
 arch_topology.h的percpu变量cpu_scale),它是从capacity-dmips-mhz CPU binding中衍生计算
-出来的。参见Documentation/devicetree/bindings/arm/cpu-capacity.txt。
+出来的。参见Documentation/devicetree/bindings/cpu/cpu-capacity.txt。
 
 3.2 频率不变性
 --------------
Signature · 1 line
2.39.0
Reviewed-by on v1 1/2
#2 lore raw

RE: [PATCH v1 1/2] dt-bindings: arm: move cpu-capacity to a shared loation

Quoted 9 lines

From: Conor Dooley <[email protected]>

RISC-V uses the same generic topology code as arm64 & while there currently exists no binding for cpu-capacity on RISC-V, the code paths can be hit if the property is present.

Quoted 5 lines

Move the documentation of cpu-capacity to a shared location, ahead of defining a binding for capacity-dmips-mhz on RISC-V. Update some references to this document in the process.

Hi Conor

I plan to move cpu-capacity.txt binding to generic directory as well after [1]. Thanks for your patch series helping this.

[1] https://patchwork.kernel.org/project/linux-riscv/patch/[email protected]/

Regards
Ley Foon

maintainer Acked-by on v1 1/2
#3 lore raw

Re: [PATCH v1 1/2] dt-bindings: arm: move cpu-capacity to a shared loation

In reply to Conor Dooley
Quoted 14 lines · Conor Dooley

From: Conor Dooley <[email protected]>

RISC-V uses the same generic topology code as arm64 & while there currently exists no binding for cpu-capacity on RISC-V, the code paths can be hit if the property is present.

Move the documentation of cpu-capacity to a shared location, ahead of defining a binding for capacity-dmips-mhz on RISC-V. Update some references to this document in the process.

---
I wasn't sure what to do with reference [1], but since the property will be the same on RISC-V, I left it as is.

Quoted 8 lines
---
 Documentation/devicetree/bindings/arm/cpus.yaml               | 2 +-
 .../devicetree/bindings/{arm => cpu}/cpu-capacity.txt         | 4 ++--
 Documentation/scheduler/sched-capacity.rst                    | 2 +-
 Documentation/translations/zh_CN/scheduler/sched-capacity.rst | 2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)
 rename Documentation/devicetree/bindings/{arm => cpu}/cpu-capacity.txt (98%)
Reviewed-by on v1 1/2
#4 lore raw

Re: [PATCH v1 1/2] dt-bindings: arm: move cpu-capacity to a shared loation

In reply to Conor Dooley
Quoted 11 lines · Conor Dooley

From: Conor Dooley <[email protected]>

RISC-V uses the same generic topology code as arm64 & while there currently exists no binding for cpu-capacity on RISC-V, the code paths can be hit if the property is present.

Move the documentation of cpu-capacity to a shared location, ahead of defining a binding for capacity-dmips-mhz on RISC-V. Update some references to this document in the process.

Quoted 64 lines

---
I wasn't sure what to do with reference [1], but since the property will be the same on RISC-V, I left it as is.

---
  Documentation/devicetree/bindings/arm/cpus.yaml               | 2 +-
  .../devicetree/bindings/{arm => cpu}/cpu-capacity.txt         | 4 ++--
  Documentation/scheduler/sched-capacity.rst                    | 2 +-
  Documentation/translations/zh_CN/scheduler/sched-capacity.rst | 2 +-
  4 files changed, 5 insertions(+), 5 deletions(-)

rename Documentation/devicetree/bindings/{arm => cpu}/cpu-capacity.txt (98%)

Documentation/devicetree/bindings/arm/cpus.yaml +1 -1
index 01b5a9c689a2..a7586295a6f5 100644
@@ -257,7 +257,7 @@ properties:
 
    capacity-dmips-mhz:
      description:
-      u32 value representing CPU capacity (see ./cpu-capacity.txt) in
+      u32 value representing CPU capacity (see ../cpu/cpu-capacity.txt) in
        DMIPS/MHz, relative to highest capacity-dmips-mhz
        in the system.
 
Documentation/devicetree/bindings/cpu/cpu-capacity.txt renamed from Documentation/devicetree/bindings/arm/cpu-capacity.txt +2 -2
similarity index 98%
rename from Documentation/devicetree/bindings/arm/cpu-capacity.txt
rename to Documentation/devicetree/bindings/cpu/cpu-capacity.txt
index cc5e190390b7..f28e1adad428 100644
@@ -1,12 +1,12 @@
  ==========================================
-ARM CPUs capacity bindings
+CPU capacity bindings
  ==========================================
 
  ==========================================
  1 - Introduction
  ==========================================
 
-ARM systems may be configured to have cpus with different power/performance
+Some systems may be configured to have cpus with different power/performance
  characteristics within the same chip. In this case, additional information has
  to be made available to the kernel for it to be aware of such differences and
  take decisions accordingly.
Documentation/scheduler/sched-capacity.rst +1 -1
index 805f85f330b5..8e2b8538bc2b 100644
@@ -260,7 +260,7 @@ for that purpose.
 
  The arm and arm64 architectures directly map this to the arch_topology driver
  CPU scaling data, which is derived from the capacity-dmips-mhz CPU binding; see
-Documentation/devicetree/bindings/arm/cpu-capacity.txt.
+Documentation/devicetree/bindings/cpu/cpu-capacity.txt.
 
  3.2 Frequency invariance
  ------------------------
Documentation/translations/zh_CN/scheduler/sched-capacity.rst +0 -0
index 3a52053c29dc..e07ffdd391d3 100644

Documentation/translations/zh_CN/scheduler/sched-capacity.rst CFS调度类基于实体负载跟踪机制(Per-Entity Load Tracking, PELT) · line 239

Quoted 8 lines
Documentation/translations/zh_CN/scheduler/sched-capacity.rst +1 -1
@@ -233,7 +233,7 @@ CFS调度类基于实体负载跟踪机制(Per-Entity Load Tracking, PELT)
 
  arm和arm64架构直接把这个信息映射到arch_topology驱动的CPU scaling数据中(译注:参考
  arch_topology.h的percpu变量cpu_scale),它是从capacity-dmips-mhz CPU binding中衍生计算
-出来的。参见Documentation/devicetree/bindings/arm/cpu-capacity.txt。
+出来的。参见Documentation/devicetree/bindings/cpu/cpu-capacity.txt。
 
  3.2 频率不变性
  --------------

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

#5 lore raw

PATCH 2/2 dt-bindings: riscv: add a capacity-dmips-mhz cpu property

In reply to Conor Dooley

From: Conor Dooley <[email protected]>

Since commit 03f11f03dbfe ("RISC-V: Parse cpu topology during boot.") RISC-V has used the generic arch topology code, which provides for disparate CPU capacities. We never defined a binding to acquire this information from the DT though, so document the one already used by the generic arch topology code: "capacity-dmips-mhz".

---
 Documentation/devicetree/bindings/riscv/cpus.yaml | 6 ++++++
 1 file changed, 6 insertions(+)
Documentation/devicetree/bindings/riscv/cpus.yaml +6 -0
index c6720764e765..2480c2460759 100644
@@ -114,6 +114,12 @@ properties:
       List of phandles to idle state nodes supported
       by this hart (see ./idle-states.yaml).
 
+  capacity-dmips-mhz:
+    description:
+      u32 value representing CPU capacity (see ../cpu/cpu-capacity.txt) in
+      DMIPS/MHz, relative to highest capacity-dmips-mhz
+      in the system.
+
 required:
   - riscv,isa
   - interrupt-controller
Signature · 1 line
2.39.0
Reviewed-by on v1 2/2
#6 lore raw

RE: [PATCH v1 2/2] dt-bindings: riscv: add a capacity-dmips-mhz cpu property

Quoted 36 lines

-----Original Message-----

From: Conor Dooley <[email protected]>

Since commit 03f11f03dbfe ("RISC-V: Parse cpu topology during boot.") RISC- V has used the generic arch topology code, which provides for disparate CPU capacities. We never defined a binding to acquire this information from the DT though, so document the one already used by the generic arch topology
code: "capacity-dmips-mhz".

---
 Documentation/devicetree/bindings/riscv/cpus.yaml | 6 ++++++
 1 file changed, 6 insertions(+)
Documentation/devicetree/bindings/riscv/cpus.yaml +6 -1
index c6720764e765..2480c2460759 100644
@@ -114,6 +114,12 @@ properties:
       List of phandles to idle state nodes supported
       by this hart (see ./idle-states.yaml).
 
+  capacity-dmips-mhz:
+    description:
+      u32 value representing CPU capacity (see ../cpu/cpu-capacity.txt) in
+      DMIPS/MHz, relative to highest capacity-dmips-mhz
+      in the system.
+
 required:
   - riscv,isa
   - interrupt-controller
--
Quoted 1 line

2.39.0

Thanks Conor.

Regards
Ley Foon

maintainer Acked-by on v1 2/2
#7 lore raw

Re: [PATCH v1 2/2] dt-bindings: riscv: add a capacity-dmips-mhz cpu property

In reply to Conor Dooley
Quoted 8 lines · Conor Dooley

From: Conor Dooley <[email protected]>

Since commit 03f11f03dbfe ("RISC-V: Parse cpu topology during boot.") RISC-V has used the generic arch topology code, which provides for disparate CPU capacities. We never defined a binding to acquire this information from the DT though, so document the one already used by the generic arch topology code: "capacity-dmips-mhz".

Quoted 5 lines
---
 Documentation/devicetree/bindings/riscv/cpus.yaml | 6 ++++++
 1 file changed, 6 insertions(+)
#8 lore raw
In reply to Conor Dooley
Quoted 10 lines · Conor Dooley

From: Conor Dooley <[email protected]>

Hey,

Ever since RISC-V starting using generic arch topology code, the code paths for cpu-capacity have been there but there's no binding defined to actually convey the information. Defining the same property as used on arm seems to be the only logical thing to do, so do it.

[...]

Applied, thanks!

[1/2] dt-bindings: arm: move cpu-capacity to a shared loation

      https://git.kernel.org/palmer/c/7d2078310cbf
[2/2] dt-bindings: riscv: add a capacity-dmips-mhz cpu property
      https://git.kernel.org/palmer/c/991994509ee9

Best regards,

Signature · 6 lines
Palmer Dabbelt <[email protected]>

_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
#9 lore raw
In reply to Conor Dooley
This series was applied to riscv/linux.git (for-next) by Palmer Dabbelt <[email protected]>:

Hello:

This series was applied to riscv/linux.git (for-next) by Palmer Dabbelt <[email protected]>:

Quoted 10 lines · On Wed, 4 Jan 2023 18:05:12 +0000 you wrote:

From: Conor Dooley <[email protected]>

Hey,

Ever since RISC-V starting using generic arch topology code, the code paths for cpu-capacity have been there but there's no binding defined to actually convey the information. Defining the same property as used on arm seems to be the only logical thing to do, so do it.

[...]

Here is the summary with links:
- [v1,1/2] dt-bindings: arm: move cpu-capacity to a shared loation

    https://git.kernel.org/riscv/c/7d2078310cbf
  - [v1,2/2] dt-bindings: riscv: add a capacity-dmips-mhz cpu property
    https://git.kernel.org/riscv/c/991994509ee9

You are awesome, thank you!

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