diff mbox series

[v2,2/5] arm64: dts: r8a7795: Add cpuidle support for CA53 cores

Message ID 1547808474-19427-3-git-send-email-uli+renesas@fpond.eu (mailing list archive)
State Accepted
Delegated to: Geert Uytterhoeven
Headers show
Series H3/M3-W cpuidle support | expand

Commit Message

Ulrich Hecht Jan. 18, 2019, 10:47 a.m. UTC
From: Dien Pham <dien.pham.ry@renesas.com>

Enables cpuidle (core shutdown) support for R-Car H3 CA53 cores.

Signed-off-by: Dien Pham <dien.pham.ry@renesas.com>
Signed-off-by: Takeshi Kihara <takeshi.kihara.df@renesas.com>
Signed-off-by: Ulrich Hecht <uli+renesas@fpond.eu>
---
 arch/arm64/boot/dts/renesas/r8a7795.dtsi | 13 +++++++++++++
 1 file changed, 13 insertions(+)

Comments

Eugeniu Rosca July 26, 2019, 9:47 a.m. UTC | #1
On Fri, Jul 26, 2019 at 11:13:29AM +0200, Rosca, Eugeniu (ADITG/ESM1) wrote:
[..]
> The culprit BSP commits are:
> https://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas-bsp.git/commit/?id=3c3b44c752c4ee
> https://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas-bsp.git/commit/?id=902ff7caa32dc71c
> 
> Further narrowing it down, it turns out the CA57 cpuidle support is
> not responsible for generating the issue. It's all about the CA53 idle
> enablement. The reference target is H3-ES2.0-Salvator-X (the problem
> originally emerged on M3-based customer HW).
[..]

Small amendment to the above (based on vanilla testing):

 Version                              Issue reproduced?
                                      (H3-ES2.0-Salvator-X)
 v5.3-rc1-96-g6789f873ed37              No
 v5.3-rc1-96-g6789f873ed37 + [1]        No
 v5.3-rc1-96-g6789f873ed37 + [2]        No
 v5.3-rc1-96-g6789f873ed37 + [1] + [2]  Yes

[1] https://patchwork.kernel.org/patch/10769701/
("[v2,1/5] arm64: dts: r8a7795: Add cpuidle support for CA57 cores")

[2] https://patchwork.kernel.org/patch/10769689/
("[v2,2/5] arm64: dts: r8a7795: Add cpuidle support for CA53 cores")
Geert Uytterhoeven July 29, 2019, 7:44 a.m. UTC | #2
Hi Eugniu,

CC cpuidle people

On Fri, Jul 26, 2019 at 11:47 AM Eugeniu Rosca <erosca@de.adit-jv.com> wrote:
> On Fri, Jul 26, 2019 at 11:13:29AM +0200, Rosca, Eugeniu (ADITG/ESM1) wrote:
> [..]
> > The culprit BSP commits are:
> > https://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas-bsp.git/commit/?id=3c3b44c752c4ee
> > https://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas-bsp.git/commit/?id=902ff7caa32dc71c
> >
> > Further narrowing it down, it turns out the CA57 cpuidle support is
> > not responsible for generating the issue. It's all about the CA53 idle
> > enablement. The reference target is H3-ES2.0-Salvator-X (the problem
> > originally emerged on M3-based customer HW).
> [..]
>
> Small amendment to the above (based on vanilla testing):
>
>  Version                              Issue reproduced?
>                                       (H3-ES2.0-Salvator-X)
>  v5.3-rc1-96-g6789f873ed37              No
>  v5.3-rc1-96-g6789f873ed37 + [1]        No
>  v5.3-rc1-96-g6789f873ed37 + [2]        No
>  v5.3-rc1-96-g6789f873ed37 + [1] + [2]  Yes
>
> [1] https://patchwork.kernel.org/patch/10769701/
> ("[v2,1/5] arm64: dts: r8a7795: Add cpuidle support for CA57 cores")
>
> [2] https://patchwork.kernel.org/patch/10769689/
> ("[v2,2/5] arm64: dts: r8a7795: Add cpuidle support for CA53 cores")

Thanks for your report and investigation!

Unfortunately your original report didn't make it to lore.kernel.org, and
probably also not to the list, due to the large audio attachment.

For the newly CCed people, the issue is about consistent dropouts during
audio playback using an in-house application, introduced by adding cpuidle
support to _both_ the big and LITTLE cores.

Thanks!

Gr{oetje,eeting}s,

                        Geert
Lorenzo Pieralisi July 29, 2019, 11:32 a.m. UTC | #3
On Mon, Jul 29, 2019 at 09:44:52AM +0200, Geert Uytterhoeven wrote:
> Hi Eugniu,
> 
> CC cpuidle people
> 
> On Fri, Jul 26, 2019 at 11:47 AM Eugeniu Rosca <erosca@de.adit-jv.com> wrote:
> > On Fri, Jul 26, 2019 at 11:13:29AM +0200, Rosca, Eugeniu (ADITG/ESM1) wrote:
> > [..]
> > > The culprit BSP commits are:
> > > https://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas-bsp.git/commit/?id=3c3b44c752c4ee
> > > https://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas-bsp.git/commit/?id=902ff7caa32dc71c
> > >
> > > Further narrowing it down, it turns out the CA57 cpuidle support is
> > > not responsible for generating the issue. It's all about the CA53 idle
> > > enablement. The reference target is H3-ES2.0-Salvator-X (the problem
> > > originally emerged on M3-based customer HW).
> > [..]
> >
> > Small amendment to the above (based on vanilla testing):
> >
> >  Version                              Issue reproduced?
> >                                       (H3-ES2.0-Salvator-X)
> >  v5.3-rc1-96-g6789f873ed37              No
> >  v5.3-rc1-96-g6789f873ed37 + [1]        No
> >  v5.3-rc1-96-g6789f873ed37 + [2]        No
> >  v5.3-rc1-96-g6789f873ed37 + [1] + [2]  Yes
> >
> > [1] https://patchwork.kernel.org/patch/10769701/
> > ("[v2,1/5] arm64: dts: r8a7795: Add cpuidle support for CA57 cores")
> >
> > [2] https://patchwork.kernel.org/patch/10769689/
> > ("[v2,2/5] arm64: dts: r8a7795: Add cpuidle support for CA53 cores")
> 
> Thanks for your report and investigation!
> 
> Unfortunately your original report didn't make it to lore.kernel.org, and
> probably also not to the list, due to the large audio attachment.
> 
> For the newly CCed people, the issue is about consistent dropouts
> during audio playback using an in-house application, introduced by
> adding cpuidle support to _both_ the big and LITTLE cores.

CPUidle entry/exit latencies are certainly bringing the issue
about, I am not an audio expert but I suspect buffering should
be tuned to cope with those _increased_ latencies or possibly
idle states disabled for certain specific use cases - there
is no silver bullet, entering deep idle states will increase
latencies, there is no way around it.

I am happy to help you debug the issue further.

Lorenzo
Eugeniu Rosca July 29, 2019, 9:55 p.m. UTC | #4
Hello Geert, hello Lorenzo,

Many thanks for your comments and for the willingness to help.

For your information, we've recently discovered that, with all the
findings already described being absolutely valid for the reference
targets, disabling CPUidle on the customer HW is apparently not enough
to fix the audio dropouts. We will first try to identify those
differences (both HW and SW) which keep the issue reproducible on the
customer boards. Once this is hopefully understood, we'll come back
with feedback.

This investigation also happens to overlap with my vacation. Hence I
plan to update you on this topic in 2-4 weeks from now.

Thanks again.

Best regards,
Eugeniu.
Geert Uytterhoeven Aug. 28, 2019, 11:48 a.m. UTC | #5
On Fri, Jan 18, 2019 at 11:48 AM Ulrich Hecht <uli+renesas@fpond.eu> wrote:
> From: Dien Pham <dien.pham.ry@renesas.com>
>
> Enables cpuidle (core shutdown) support for R-Car H3 CA53 cores.
>
> Signed-off-by: Dien Pham <dien.pham.ry@renesas.com>
> Signed-off-by: Takeshi Kihara <takeshi.kihara.df@renesas.com>
> Signed-off-by: Ulrich Hecht <uli+renesas@fpond.eu>

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

Gr{oetje,eeting}s,

                        Geert
diff mbox series

Patch

diff --git a/arch/arm64/boot/dts/renesas/r8a7795.dtsi b/arch/arm64/boot/dts/renesas/r8a7795.dtsi
index 7ae974d..483ba3b 100644
--- a/arch/arm64/boot/dts/renesas/r8a7795.dtsi
+++ b/arch/arm64/boot/dts/renesas/r8a7795.dtsi
@@ -211,6 +211,7 @@ 
 			power-domains = <&sysc R8A7795_PD_CA53_CPU0>;
 			next-level-cache = <&L2_CA53>;
 			enable-method = "psci";
+			cpu-idle-states = <&CPU_SLEEP_1>;
 			clocks = <&cpg CPG_CORE R8A7795_CLK_Z2>;
 			operating-points-v2 = <&cluster1_opp>;
 			capacity-dmips-mhz = <535>;
@@ -223,6 +224,7 @@ 
 			power-domains = <&sysc R8A7795_PD_CA53_CPU1>;
 			next-level-cache = <&L2_CA53>;
 			enable-method = "psci";
+			cpu-idle-states = <&CPU_SLEEP_1>;
 			clocks = <&cpg CPG_CORE R8A7795_CLK_Z2>;
 			operating-points-v2 = <&cluster1_opp>;
 			capacity-dmips-mhz = <535>;
@@ -235,6 +237,7 @@ 
 			power-domains = <&sysc R8A7795_PD_CA53_CPU2>;
 			next-level-cache = <&L2_CA53>;
 			enable-method = "psci";
+			cpu-idle-states = <&CPU_SLEEP_1>;
 			clocks = <&cpg CPG_CORE R8A7795_CLK_Z2>;
 			operating-points-v2 = <&cluster1_opp>;
 			capacity-dmips-mhz = <535>;
@@ -247,6 +250,7 @@ 
 			power-domains = <&sysc R8A7795_PD_CA53_CPU3>;
 			next-level-cache = <&L2_CA53>;
 			enable-method = "psci";
+			cpu-idle-states = <&CPU_SLEEP_1>;
 			clocks = <&cpg CPG_CORE R8A7795_CLK_Z2>;
 			operating-points-v2 = <&cluster1_opp>;
 			capacity-dmips-mhz = <535>;
@@ -277,6 +281,15 @@ 
 				exit-latency-us = <500>;
 				min-residency-us = <4000>;
 			};
+
+			CPU_SLEEP_1: cpu-sleep-1 {
+				compatible = "arm,idle-state";
+				arm,psci-suspend-param = <0x0010000>;
+				local-timer-stop;
+				entry-latency-us = <700>;
+				exit-latency-us = <700>;
+				min-residency-us = <5000>;
+			};
 		};
 	};