* [PATCH 0/6] arm64: dts: Add missing cooling device properties for CPUs
@ 2018-05-25 5:40 Viresh Kumar
2018-05-25 5:40 ` [PATCH 1/6] arm64: dts: amlogic: " Viresh Kumar
0 siblings, 1 reply; 8+ messages in thread
From: Viresh Kumar @ 2018-05-25 5:40 UTC (permalink / raw)
To: linus-amlogic
Hello,
This fixes missing cooling device properties for CPUs for the ARM64
platforms. This is build tested by the zero day testing infrastructure
as well.
Individual maintainers can pick the patches to their SoC trees or I will
ask ARM SoC maintainers to pick them up later.
--
viresh
Viresh Kumar (6):
arm64: dts: amlogic: Add missing cooling device properties for CPUs
arm64: dts: freescale: Add missing cooling device properties for CPUs
arm64: dts: hisilicon: Add missing cooling device properties for CPUs
arm64: dts: mediatek: Add missing cooling device properties for CPUs
arm64: dts: rockchip: Add missing cooling device properties for CPUs
arm64: dts: socionext: Add missing cooling device properties for CPUs
.../boot/dts/amlogic/meson-gxm-khadas-vim2.dts | 24 ++++++++++++++++++++++
arch/arm64/boot/dts/freescale/fsl-ls1043a.dtsi | 5 ++++-
arch/arm64/boot/dts/freescale/fsl-ls1046a.dtsi | 3 +++
arch/arm64/boot/dts/freescale/fsl-ls1088a.dtsi | 6 ++++++
arch/arm64/boot/dts/freescale/fsl-ls2080a.dtsi | 4 ++++
arch/arm64/boot/dts/freescale/fsl-ls2088a.dtsi | 4 ++++
arch/arm64/boot/dts/hisilicon/hi6220.dtsi | 16 ++++++++++++++-
arch/arm64/boot/dts/mediatek/mt7622.dtsi | 1 +
arch/arm64/boot/dts/mediatek/mt8173.dtsi | 2 ++
arch/arm64/boot/dts/rockchip/rk3328.dtsi | 3 +++
arch/arm64/boot/dts/rockchip/rk3368.dtsi | 12 +++++++++++
arch/arm64/boot/dts/rockchip/rk3399.dtsi | 8 ++++++--
arch/arm64/boot/dts/socionext/uniphier-ld20.dtsi | 2 ++
13 files changed, 86 insertions(+), 4 deletions(-)
--
2.15.0.194.g9af6a3dea062
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 1/6] arm64: dts: amlogic: Add missing cooling device properties for CPUs
2018-05-25 5:40 [PATCH 0/6] arm64: dts: Add missing cooling device properties for CPUs Viresh Kumar
@ 2018-05-25 5:40 ` Viresh Kumar
2018-05-25 21:10 ` Olof Johansson
0 siblings, 1 reply; 8+ messages in thread
From: Viresh Kumar @ 2018-05-25 5:40 UTC (permalink / raw)
To: linus-amlogic
The cooling device properties, like "#cooling-cells" and
"dynamic-power-coefficient", should either be present for all the CPUs
of a cluster or none. If these are present only for a subset of CPUs of
a cluster then things will start falling apart as soon as the CPUs are
brought online in a different order. For example, this will happen
because the operating system looks for such properties in the CPU node
it is trying to bring up, so that it can register a cooling device.
Add such missing properties.
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
.../boot/dts/amlogic/meson-gxm-khadas-vim2.dts | 24 ++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts b/arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts
index 0868da476e41..313f88f8759e 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts
@@ -209,10 +209,34 @@
#cooling-cells = <2>;
};
+&cpu1 {
+ #cooling-cells = <2>;
+};
+
+&cpu2 {
+ #cooling-cells = <2>;
+};
+
+&cpu3 {
+ #cooling-cells = <2>;
+};
+
&cpu4 {
#cooling-cells = <2>;
};
+&cpu5 {
+ #cooling-cells = <2>;
+};
+
+&cpu6 {
+ #cooling-cells = <2>;
+};
+
+&cpu7 {
+ #cooling-cells = <2>;
+};
+
ðmac {
pinctrl-0 = <ð_pins>;
pinctrl-names = "default";
--
2.15.0.194.g9af6a3dea062
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 1/6] arm64: dts: amlogic: Add missing cooling device properties for CPUs
2018-05-25 5:40 ` [PATCH 1/6] arm64: dts: amlogic: " Viresh Kumar
@ 2018-05-25 21:10 ` Olof Johansson
2018-05-26 8:37 ` Neil Armstrong
2018-05-28 11:13 ` Viresh Kumar
0 siblings, 2 replies; 8+ messages in thread
From: Olof Johansson @ 2018-05-25 21:10 UTC (permalink / raw)
To: linus-amlogic
On Fri, May 25, 2018 at 11:10:01AM +0530, Viresh Kumar wrote:
> The cooling device properties, like "#cooling-cells" and
> "dynamic-power-coefficient", should either be present for all the CPUs
> of a cluster or none. If these are present only for a subset of CPUs of
> a cluster then things will start falling apart as soon as the CPUs are
> brought online in a different order. For example, this will happen
> because the operating system looks for such properties in the CPU node
> it is trying to bring up, so that it can register a cooling device.
>
> Add such missing properties.
This seems awkward compared to just having one cooling-cells in the /cpus node
instead.
What's it used for? I don't see any properties in the device nodes on meson-gxm
that have any cooling-foo cells in them? So why should #cooling-cells be
needed?
-Olof
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 1/6] arm64: dts: amlogic: Add missing cooling device properties for CPUs
2018-05-25 21:10 ` Olof Johansson
@ 2018-05-26 8:37 ` Neil Armstrong
2018-05-28 11:16 ` Viresh Kumar
2018-05-28 11:13 ` Viresh Kumar
1 sibling, 1 reply; 8+ messages in thread
From: Neil Armstrong @ 2018-05-26 8:37 UTC (permalink / raw)
To: linus-amlogic
Hi,
On 25/05/2018 23:10, Olof Johansson wrote:
> On Fri, May 25, 2018 at 11:10:01AM +0530, Viresh Kumar wrote:
>> The cooling device properties, like "#cooling-cells" and
>> "dynamic-power-coefficient", should either be present for all the CPUs
>> of a cluster or none. If these are present only for a subset of CPUs of
>> a cluster then things will start falling apart as soon as the CPUs are
>> brought online in a different order. For example, this will happen
>> because the operating system looks for such properties in the CPU node
>> it is trying to bring up, so that it can register a cooling device.
>>
>> Add such missing properties.
>
> This seems awkward compared to just having one cooling-cells in the /cpus node
> instead.
>
> What's it used for? I don't see any properties in the device nodes on meson-gxm
> that have any cooling-foo cells in them? So why should #cooling-cells be
> needed?
There is no reason to have the cooling-cells on these other CPUs, the DVFS is
controlled on the first CPU of each cluster, here cpu0 and cpu4 and only
cpu0 and cpu4 are used as cooling-cells.
Neil
>
>
> -Olof
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 1/6] arm64: dts: amlogic: Add missing cooling device properties for CPUs
2018-05-25 21:10 ` Olof Johansson
2018-05-26 8:37 ` Neil Armstrong
@ 2018-05-28 11:13 ` Viresh Kumar
2018-06-02 8:14 ` Olof Johansson
1 sibling, 1 reply; 8+ messages in thread
From: Viresh Kumar @ 2018-05-28 11:13 UTC (permalink / raw)
To: linus-amlogic
On 25-05-18, 14:10, Olof Johansson wrote:
> On Fri, May 25, 2018 at 11:10:01AM +0530, Viresh Kumar wrote:
> > The cooling device properties, like "#cooling-cells" and
> > "dynamic-power-coefficient", should either be present for all the CPUs
> > of a cluster or none. If these are present only for a subset of CPUs of
> > a cluster then things will start falling apart as soon as the CPUs are
> > brought online in a different order. For example, this will happen
> > because the operating system looks for such properties in the CPU node
> > it is trying to bring up, so that it can register a cooling device.
> >
> > Add such missing properties.
>
> This seems awkward compared to just having one cooling-cells in the /cpus node
> instead.
Well, we don't allow that property to be present in /cpus node right
now and it is per device. And then we may not want all the CPUs to be
cooling devices really.
> What's it used for? I don't see any properties in the device nodes on meson-gxm
> that have any cooling-foo cells in them? So why should #cooling-cells be
> needed?
This property is required to declare a device as a cooling-device and
the device here is CPU. We use it as a cooling device by limiting its
higher range of frequencies, so that it doesn't generate too much
heat.
It is already there for CPU0 and CPU4, but it should really be there
for all the CPUs, like we have clock, supply, caches, etc.
--
viresh
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 1/6] arm64: dts: amlogic: Add missing cooling device properties for CPUs
2018-05-26 8:37 ` Neil Armstrong
@ 2018-05-28 11:16 ` Viresh Kumar
0 siblings, 0 replies; 8+ messages in thread
From: Viresh Kumar @ 2018-05-28 11:16 UTC (permalink / raw)
To: linus-amlogic
On 26-05-18, 10:37, Neil Armstrong wrote:
> Hi,
>
> On 25/05/2018 23:10, Olof Johansson wrote:
> > On Fri, May 25, 2018 at 11:10:01AM +0530, Viresh Kumar wrote:
> >> The cooling device properties, like "#cooling-cells" and
> >> "dynamic-power-coefficient", should either be present for all the CPUs
> >> of a cluster or none. If these are present only for a subset of CPUs of
> >> a cluster then things will start falling apart as soon as the CPUs are
> >> brought online in a different order. For example, this will happen
> >> because the operating system looks for such properties in the CPU node
> >> it is trying to bring up, so that it can register a cooling device.
> >>
> >> Add such missing properties.
> >
> > This seems awkward compared to just having one cooling-cells in the /cpus node
> > instead.
> >
> > What's it used for? I don't see any properties in the device nodes on meson-gxm
> > that have any cooling-foo cells in them? So why should #cooling-cells be
> > needed?
>
>
> There is no reason to have the cooling-cells on these other CPUs, the DVFS is
> controlled on the first CPU of each cluster, here cpu0 and cpu4 and only
> cpu0 and cpu4 are used as cooling-cells.
First, this is an incomplete definition of the hardware as all the
CPUs are cooling-devices here and DT shouldn't be written assuming how
OS will interpret it.
And then it is broken right now. You can offline your second cluster
(4567 CPUs) and bring CPU5 up first. You will see things breaking.
I have explained more in detail here.
https://marc.info/?l=linux-kernel&m=152750569414761
--
viresh
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 1/6] arm64: dts: amlogic: Add missing cooling device properties for CPUs
2018-05-28 11:13 ` Viresh Kumar
@ 2018-06-02 8:14 ` Olof Johansson
2018-06-05 4:37 ` Viresh Kumar
0 siblings, 1 reply; 8+ messages in thread
From: Olof Johansson @ 2018-06-02 8:14 UTC (permalink / raw)
To: linus-amlogic
On Mon, May 28, 2018 at 04:43:58PM +0530, Viresh Kumar wrote:
> On 25-05-18, 14:10, Olof Johansson wrote:
> > On Fri, May 25, 2018 at 11:10:01AM +0530, Viresh Kumar wrote:
> > > The cooling device properties, like "#cooling-cells" and
> > > "dynamic-power-coefficient", should either be present for all the CPUs
> > > of a cluster or none. If these are present only for a subset of CPUs of
> > > a cluster then things will start falling apart as soon as the CPUs are
> > > brought online in a different order. For example, this will happen
> > > because the operating system looks for such properties in the CPU node
> > > it is trying to bring up, so that it can register a cooling device.
> > >
> > > Add such missing properties.
> >
> > This seems awkward compared to just having one cooling-cells in the /cpus node
> > instead.
>
> Well, we don't allow that property to be present in /cpus node right
> now and it is per device. And then we may not want all the CPUs to be
> cooling devices really.
And what I am saying is that it sounds like a broken binding if you don't allow
that, especially since it'll be a super common case that all CPUs will specify
the same cooling-device specifier.
> > What's it used for? I don't see any properties in the device nodes on meson-gxm
> > that have any cooling-foo cells in them? So why should #cooling-cells be
> > needed?
>
> This property is required to declare a device as a cooling-device and
> the device here is CPU. We use it as a cooling device by limiting its
> higher range of frequencies, so that it doesn't generate too much
> heat.
>
> It is already there for CPU0 and CPU4, but it should really be there
> for all the CPUs, like we have clock, supply, caches, etc.
You have #cooling-cells in the cpu node, but the actual data is in the
thermal-zones nodes. Why isn't #cooling-cells under thermal-zones, next to
cooling-maps?
-Olof
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 1/6] arm64: dts: amlogic: Add missing cooling device properties for CPUs
2018-06-02 8:14 ` Olof Johansson
@ 2018-06-05 4:37 ` Viresh Kumar
0 siblings, 0 replies; 8+ messages in thread
From: Viresh Kumar @ 2018-06-05 4:37 UTC (permalink / raw)
To: linus-amlogic
On 02-06-18, 01:14, Olof Johansson wrote:
> And what I am saying is that it sounds like a broken binding if you don't allow
> that, especially since it'll be a super common case that all CPUs will specify
> the same cooling-device specifier.
I am fine with allowing the #cooling-cells property in the cpus node if the DT
maintainers are fine with it.
@Rob: comments ?
@Olof: What about other properties which are still going to be duplicated for
the most common cases today, like: clocks, supply information, cache
information, cpu-idle-states and others. When we can duplicate these properties,
why not keep following the same for #cpu-cooling property ?
Note that the OPP table doesn't really need to get duplicated (for new
platforms) as the platforms use the v2 bindings now which just duplicates a
phandle assignment for all CPUs. Its a mess with older platforms which use the
earlier version of OPP table.
> > This property is required to declare a device as a cooling-device and
> > the device here is CPU. We use it as a cooling device by limiting its
> > higher range of frequencies, so that it doesn't generate too much
> > heat.
> >
> > It is already there for CPU0 and CPU4, but it should really be there
> > for all the CPUs, like we have clock, supply, caches, etc.
>
> You have #cooling-cells in the cpu node, but the actual data is in the
> thermal-zones nodes. Why isn't #cooling-cells under thermal-zones, next to
> cooling-maps?
Actually I thought about that when I worked on these patches initially and this
is why I felt convinced that the CPU nodes are the right place for this.
We add #interrupt-cells to an Interrupt controller's DT node, #gpio-cells to a
GPIO controller's DT node, #clock-cells to a clock controller's DT node and
that's exactly why we should (and we do) add #cooling-cells property to a
cooling device's DT node. This information is used in two ways, first it enables
the OS to know that the device is capable of being a cooling device and second
it tells us how many arguments will be required with a phandle of this device.
And so the cooling-maps always contain two arguments with the cooling device's
phandle (which is mostly a CPU or a gpio fan) as the #cooling-cells currently
is fixed to 2.
And so I am not really sure if thermal-zones is the right place to define this
thing. Is my understanding correct ?
--
viresh
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2018-06-05 4:37 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-25 5:40 [PATCH 0/6] arm64: dts: Add missing cooling device properties for CPUs Viresh Kumar
2018-05-25 5:40 ` [PATCH 1/6] arm64: dts: amlogic: " Viresh Kumar
2018-05-25 21:10 ` Olof Johansson
2018-05-26 8:37 ` Neil Armstrong
2018-05-28 11:16 ` Viresh Kumar
2018-05-28 11:13 ` Viresh Kumar
2018-06-02 8:14 ` Olof Johansson
2018-06-05 4:37 ` Viresh Kumar
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox