mbox series

[PATCH/RFC,0/2] arm64: dts: renesas: Re-add voltages to OPP tables

Message ID cover.1728377971.git.geert+renesas@glider.be (mailing list archive)
Headers show
Series arm64: dts: renesas: Re-add voltages to OPP tables | expand

Message

Geert Uytterhoeven Oct. 8, 2024, 9:14 a.m. UTC
Hi all,

When CONFIG_ENERGY_MODEL=y, an error is printed on RZ/G2E and R-Car E3:

    cpu cpu0: EM: invalid perf. state: -22

This happens because the Operating Points Parameters tables do not list
voltages, as they are all identical.  Previously, it was assumed they
were optional, and unused, when none of the CPU nodes is tied to a
regulator using the "cpu-supply" property.  This assumption turned out
to be incorrect, causing the reported error message.

This RFC patch series fixes this by adding the missing voltages.

Note that the Energy Model calculates energy efficiency by dividing the
(estimated) CPU power consumption by CPU core clock frequency.  When all
voltages have the same value, the former is proportional to clock
frequency, and energy efficiency becomes a constant.  Hence all
operating points are considered to have the same efficiency, and the
Energy Model always picks the one with the highest clock rate (see also
[1]).

Alternatively, the Energy Model could be changed to silently ignore OPP
tables with missing frequencies.  IMHO this is not an unusual case.

Which approach should be taken?
Thanks for your comments!

[1] "PM: EM: Question Potential Issue with EM and OPP Table in cpufreq
     ondemand Governor"
    https://lore.kernel.org/all/a2ca883e-122e-43a1-b377-c43956b5b3be@arm.com

Geert Uytterhoeven (2):
  arm64: dts: renesas: r8a774c0: Re-add voltages to OPP table
  arm64: dts: renesas: r8a77990: Re-add voltages to OPP table

 arch/arm64/boot/dts/renesas/r8a774c0.dtsi | 3 +++
 arch/arm64/boot/dts/renesas/r8a77990.dtsi | 3 +++
 2 files changed, 6 insertions(+)

Comments

Biju Das Oct. 8, 2024, 9:29 a.m. UTC | #1
Hi Geert,

> -----Original Message-----
> From: Geert Uytterhoeven <geert+renesas@glider.be>
> Subject: [PATCH/RFC 0/2] arm64: dts: renesas: Re-add voltages to OPP tables
> 
> 	Hi all,
> 
> When CONFIG_ENERGY_MODEL=y, an error is printed on RZ/G2E and R-Car E3:
> 
>     cpu cpu0: EM: invalid perf. state: -22
> 
> This happens because the Operating Points Parameters tables do not list voltages, as they are all
> identical.  Previously, it was assumed they were optional, and unused, when none of the CPU nodes is
> tied to a regulator using the "cpu-supply" property.  This assumption turned out to be incorrect,
> causing the reported error message.
> 
> This RFC patch series fixes this by adding the missing voltages.
> 
> Note that the Energy Model calculates energy efficiency by dividing the
> (estimated) CPU power consumption by CPU core clock frequency.  When all voltages have the same value,
> the former is proportional to clock frequency, and energy efficiency becomes a constant.  Hence all
> operating points are considered to have the same efficiency, and the Energy Model always picks the one
> with the highest clock rate (see also [1]).
> 
> Alternatively, the Energy Model could be changed to silently ignore OPP tables with missing
> frequencies.  IMHO this is not an unusual case.

I guess cooling uses OPP table for frequency down scaling at higher temp. So, we need
OPP tables for thermal governors??

Cheers,
Biju

> 
> Which approach should be taken?
> Thanks for your comments!
> 
> [1] "PM: EM: Question Potential Issue with EM and OPP Table in cpufreq
>      ondemand Governor"
>     https://lore.kernel.org/all/a2ca883e-122e-43a1-b377-c43956b5b3be@arm.com
> 
> Geert Uytterhoeven (2):
>   arm64: dts: renesas: r8a774c0: Re-add voltages to OPP table
>   arm64: dts: renesas: r8a77990: Re-add voltages to OPP table
> 
>  arch/arm64/boot/dts/renesas/r8a774c0.dtsi | 3 +++  arch/arm64/boot/dts/renesas/r8a77990.dtsi | 3 +++
>  2 files changed, 6 insertions(+)
> 
> --
> 2.34.1
> 
> Gr{oetje,eeting}s,
> 
> 						Geert
> 
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
> 
> In personal conversations with technical people, I call myself a hacker. But when I'm talking to
> journalists I just say "programmer" or something like that.
> 							    -- Linus Torvalds
Geert Uytterhoeven Oct. 8, 2024, 9:37 a.m. UTC | #2
Hi Biju,

On Tue, Oct 8, 2024 at 11:30 AM Biju Das <biju.das.jz@bp.renesas.com> wrote:
> > -----Original Message-----
> > From: Geert Uytterhoeven <geert+renesas@glider.be>
> > Subject: [PATCH/RFC 0/2] arm64: dts: renesas: Re-add voltages to OPP tables
> >
> > When CONFIG_ENERGY_MODEL=y, an error is printed on RZ/G2E and R-Car E3:
> >
> >     cpu cpu0: EM: invalid perf. state: -22
> >
> > This happens because the Operating Points Parameters tables do not list voltages, as they are all
> > identical.  Previously, it was assumed they were optional, and unused, when none of the CPU nodes is
> > tied to a regulator using the "cpu-supply" property.  This assumption turned out to be incorrect,
> > causing the reported error message.
> >
> > This RFC patch series fixes this by adding the missing voltages.
> >
> > Note that the Energy Model calculates energy efficiency by dividing the
> > (estimated) CPU power consumption by CPU core clock frequency.  When all voltages have the same value,
> > the former is proportional to clock frequency, and energy efficiency becomes a constant.  Hence all
> > operating points are considered to have the same efficiency, and the Energy Model always picks the one
> > with the highest clock rate (see also [1]).
> >
> > Alternatively, the Energy Model could be changed to silently ignore OPP tables with missing
> > frequencies.  IMHO this is not an unusual case.
>
> I guess cooling uses OPP table for frequency down scaling at higher temp. So, we need
> OPP tables for thermal governors??

Yes, you still need OPP tables for thermal governance.
But the Energy Model cannot really use it when the voltages are identical.

Gr{oetje,eeting}s,

                        Geert