Subject: Re: [PATCH 33/36] cpuidle,omap3: Use WFI for omap3_pm_idle()

From: Tony Lindgren <[email-masked]>
Date: Thu, 9 Jun 2022 10:39:22 +0300

[email-masked]>, Linux-sh list <[email-masked]>, Fabio Estevam <[email-masked]>, Helge Deller <[email-masked]>, Daniel Lezcano <[email-masked]>, Jonathan Hunter <[email-masked]>, Mathieu Desnoyers <[email-masked]>, Frederic Weisbecker <[email-masked]>, Len Brown <[email-masked]>, "open list:TENSILICA XTENSA PORT \(xtensa\)" <[email-masked]>, Sascha Hauer <[email-masked]>, Vasily Gorbik <[email-masked]>, linux-arm-msm <[email-masked]>, alpha <[email-masked]>, linux-m68k <[email-masked]>, Stafford Horne <[email-masked]>, Linux ARM <[email-masked]>, Chris Zankel <[email-masked]>, Stephen Boyd <[email-masked]>, Dinh Nguyen <[email-masked]>, Daniel Bristot de Oliveira <[email-masked]>, Alexander Shishkin <[email-masked]>, [email-masked], Rasmus Villemoes <[email-masked]>, Joel Fernandes <
 [email-masked]>, Will Deacon <[email-masked]>, Boris Ostrovsky <[email-masked]>, Kevin Hilman <[email-masked]>, [email-masked], Pv-drivers <[email-masked]>, "open list:SYNOPSYS ARC ARCHITECTURE" <[email-masked]>, Mel Gorman <[email-masked]>, [email-masked], Yury Norov <[email-masked]>, Hans Ulli Kroll <[email-masked]>, Vineet Gupta <[email-masked]>, linux-clk <[email-masked]>, Josh Triplett <[email-masked]>, Steven Rostedt <[email-masked]>, [email-masked], Borislav Petkov <[email-masked]>, [email-masked], Thomas Bogendoerfer <[email-masked]>, Parisc List <[email-masked]>, Sudeep Holla <[email-masked]>, Shawn Guo <[email-masked]>, David Miller <[email-masked]>, Rich Felker <[email-masked]>, Peter Zijlstra <[email-masked]>, [email-masked], Bjorn Andersson <[email-masked]>, "H. Peter Anvin" <hp
 [email-masked]>, sparclinux <[email-masked]>
, "open list:QUALCOMM HEXAGON..." <[email-masked]>, linux-riscv <[email-masked]>, Anton Ivanov <[email-masked]>, Jonas Bonn <[email-masked]>, Richard Weinberger <[email-masked]>, the arch/x86 maintainers <[email-masked]>, Russell King - ARM Linux <[email-masked]>, Ingo Molnar <[email-masked]>, Albert Ou <[email-masked]>, "Paul E. McKenney" <[email-masked]>, Heiko Carstens <[email-masked]>, Stefan Kristiansson <[email-masked]>, Openrisc <[email-masked]>, Paul Walmsley <[email-masked]>, "open list:TEGRA ARCHITECTURE SUPPORT" <[email-masked]>, Namhyung Kim <[email-masked]>, Andy Shevchenko <[email-masked]>, [email-masked], Juergen Gross <[email-masked]>, Michal Simek <[email-masked]>, "open list:BROADCOM NVRAM DRIVER" <[email-masked]>, Palmer Dabbelt <[email-masked]>, Anup Patel <[email-masked]>, Ivan Ko
 kshaysky <[email-masked]>, Johannes Berg <[email-masked]>, linuxppc-dev <[email-masked]>
Errors-To: linuxppc-dev-bounces+linuxppc-dev=[email-masked]
Sender: "Linuxppc-dev" <linuxppc-dev-bounces+linuxppc-dev=[email-masked]>

* Arnd Bergmann <[email-masked]> [220608 18:18]:
> On Wed, Jun 8, 2022 at 4:27 PM Peter Zijlstra <[email-masked]> wrote:
> >
> > arch_cpu_idle() is a very simple idle interface and exposes only a
> > single idle state and is expected to not require RCU and not do any
> > tracing/instrumentation.
> >
> > As such, omap_sram_idle() is not a valid implementation. Replace it
> > with the simple (shallow) omap3_do_wfi() call. Leaving the more
> > complicated idle states for the cpuidle driver.

Agreed it makes sense to limit deeper idle states to cpuidle. Hopefully
there is some informative splat for attempting to use arch_cpu_ide()
for deeper idle states :)

> I see similar code in omap2:
> 
> omap2_pm_idle()
>  -> omap2_enter_full_retention()
>      -> omap2_sram_suspend()
> 
> Is that code path safe to use without RCU or does it need a similar change?

Seems like a similar change should be done for omap2. Then anybody who
cares to implement a minimal cpuidle support can do so.

Regards,

Tony