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

From: Peter Zijlstra <[email-masked]>
Date: Thu, 9 Jun 2022 11:47:57 +0200

[email-masked]>, Linux-sh list <[email-masked]>, Will Deacon <[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 <joel@
 joelfernandes.org>, Fabio Estevam <[email-masked]>, Boris Ostrovsky <[email-masked]>, Kevin Hilman <[email-masked]>, [email-masked], "open list:SYNOPSYS ARC ARCHITECTURE" <[email-masked]>, Mel Gorman <[email-masked]>, [email-masked], Arnd Bergmann <[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]>, Pv-drivers <[email-masked]>, [email-masked], Bjorn Andersson <[email-masked]>, "H. Peter Anvin" <[email-masked]>, sparclinux <[email-masked]
 ernel.org>, "open list:QUALCOMM HEXAGON..." <linux-he
[email-masked]>, linux-riscv <[email-masked]>, Anton Ivanov <[email-masked]>, Jonas Bonn <[email-masked]>, Yury Norov <[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 Kokshaysky
  <[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]>

On Thu, Jun 09, 2022 at 10:39:22AM +0300, Tony Lindgren wrote:
> * 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 :)

The arch_cpu_idle() interface doesn't allow one to express a desire for
deeper states. I'm not sure how anyone could even attempt this.

But given what OMAP needs to go deeper, this would involve things that
require RCU, combine that with the follow up patches that rip out all
the trace_.*_rcuidle() hackery from the power and clock domain code,
PROVE_RCU should scream if anybody were to attempt it.