[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220608144518.073801916@infradead.org>
Date: Wed, 08 Jun 2022 16:27:57 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: peterz@...radead.org
Cc: rth@...ddle.net, ink@...assic.park.msu.ru, mattst88@...il.com,
vgupta@...nel.org, linux@...linux.org.uk,
ulli.kroll@...glemail.com, linus.walleij@...aro.org,
shawnguo@...nel.org, Sascha Hauer <s.hauer@...gutronix.de>,
kernel@...gutronix.de, festevam@...il.com, linux-imx@....com,
tony@...mide.com, khilman@...nel.org, catalin.marinas@....com,
will@...nel.org, guoren@...nel.org, bcain@...cinc.com,
chenhuacai@...nel.org, kernel@...0n.name, geert@...ux-m68k.org,
sammy@...my.net, monstr@...str.eu, tsbogend@...ha.franken.de,
dinguyen@...nel.org, jonas@...thpole.se,
stefan.kristiansson@...nalahti.fi, shorne@...il.com,
James.Bottomley@...senPartnership.com, deller@....de,
mpe@...erman.id.au, benh@...nel.crashing.org, paulus@...ba.org,
paul.walmsley@...ive.com, palmer@...belt.com,
aou@...s.berkeley.edu, hca@...ux.ibm.com, gor@...ux.ibm.com,
agordeev@...ux.ibm.com, borntraeger@...ux.ibm.com,
svens@...ux.ibm.com, ysato@...rs.sourceforge.jp, dalias@...c.org,
davem@...emloft.net, richard@....at,
anton.ivanov@...bridgegreys.com, johannes@...solutions.net,
tglx@...utronix.de, mingo@...hat.com, bp@...en8.de,
dave.hansen@...ux.intel.com, x86@...nel.org, hpa@...or.com,
acme@...nel.org, mark.rutland@....com,
alexander.shishkin@...ux.intel.com, jolsa@...nel.org,
namhyung@...nel.org, jgross@...e.com, srivatsa@...il.mit.edu,
amakhalov@...are.com, pv-drivers@...are.com,
boris.ostrovsky@...cle.com, chris@...kel.net, jcmvbkbc@...il.com,
rafael@...nel.org, lenb@...nel.org, pavel@....cz,
gregkh@...uxfoundation.org, mturquette@...libre.com,
sboyd@...nel.org, daniel.lezcano@...aro.org, lpieralisi@...nel.org,
sudeep.holla@....com, agross@...nel.org,
bjorn.andersson@...aro.org, anup@...infault.org,
thierry.reding@...il.com, jonathanh@...dia.com,
jacob.jun.pan@...ux.intel.com, Arnd Bergmann <arnd@...db.de>,
yury.norov@...il.com, andriy.shevchenko@...ux.intel.com,
linux@...musvillemoes.dk, rostedt@...dmis.org, pmladek@...e.com,
senozhatsky@...omium.org, john.ogness@...utronix.de,
paulmck@...nel.org, frederic@...nel.org, quic_neeraju@...cinc.com,
josh@...htriplett.org, mathieu.desnoyers@...icios.com,
jiangshanlai@...il.com, joel@...lfernandes.org,
juri.lelli@...hat.com, vincent.guittot@...aro.org,
dietmar.eggemann@....com, bsegall@...gle.com, mgorman@...e.de,
bristot@...hat.com, vschneid@...hat.com, jpoimboe@...nel.org,
linux-alpha@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-snps-arc@...ts.infradead.org,
linux-arm-kernel@...ts.infradead.org, linux-omap@...r.kernel.org,
linux-csky@...r.kernel.org, linux-hexagon@...r.kernel.org,
linux-ia64@...r.kernel.org, linux-m68k@...ts.linux-m68k.org,
linux-mips@...r.kernel.org, openrisc@...ts.librecores.org,
linux-parisc@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org,
linux-riscv@...ts.infradead.org, linux-s390@...r.kernel.org,
linux-sh@...r.kernel.org, sparclinux@...r.kernel.org,
linux-um@...ts.infradead.org, linux-perf-users@...r.kernel.org,
virtualization@...ts.linux-foundation.org,
xen-devel@...ts.xenproject.org, linux-xtensa@...ux-xtensa.org,
linux-acpi@...r.kernel.org, linux-pm@...r.kernel.org,
linux-clk@...r.kernel.org, linux-arm-msm@...r.kernel.org,
linux-tegra@...r.kernel.org, linux-arch@...r.kernel.org,
rcu@...r.kernel.org
Subject: [PATCH 34/36] cpuidle,omap3: Push RCU-idle into omap_sram_idle()
OMAP3 uses full SoC suspend modes as idle states, as such it needs the
whole power-domain and clock-domain code from the idle path.
All that code is not suitable to run with RCU disabled, as such push
RCU-idle deeper still.
Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
---
arch/arm/mach-omap2/cpuidle34xx.c | 4 +---
arch/arm/mach-omap2/pm.h | 2 +-
arch/arm/mach-omap2/pm34xx.c | 12 ++++++++++--
3 files changed, 12 insertions(+), 6 deletions(-)
--- a/arch/arm/mach-omap2/cpuidle34xx.c
+++ b/arch/arm/mach-omap2/cpuidle34xx.c
@@ -133,9 +133,7 @@ static int omap3_enter_idle(struct cpuid
}
/* Execute ARM wfi */
- cpuidle_rcu_enter();
- omap_sram_idle();
- cpuidle_rcu_exit();
+ omap_sram_idle(true);
/*
* Call idle CPU PM enter notifier chain to restore
--- a/arch/arm/mach-omap2/pm.h
+++ b/arch/arm/mach-omap2/pm.h
@@ -29,7 +29,7 @@ static inline int omap4_idle_init(void)
extern void *omap3_secure_ram_storage;
extern void omap3_pm_off_mode_enable(int);
-extern void omap_sram_idle(void);
+extern void omap_sram_idle(bool rcuidle);
extern int omap_pm_clkdms_setup(struct clockdomain *clkdm, void *unused);
#if defined(CONFIG_PM_OPP)
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -26,6 +26,7 @@
#include <linux/delay.h>
#include <linux/slab.h>
#include <linux/of.h>
+#include <linux/cpuidle.h>
#include <trace/events/power.h>
@@ -174,7 +175,7 @@ static int omap34xx_do_sram_idle(unsigne
return 0;
}
-void omap_sram_idle(void)
+void omap_sram_idle(bool rcuidle)
{
/* Variable to tell what needs to be saved and restored
* in omap_sram_idle*/
@@ -254,11 +255,18 @@ void omap_sram_idle(void)
*/
if (save_state)
omap34xx_save_context(omap3_arm_context);
+
+ if (rcuidle)
+ cpuidle_rcu_enter();
+
if (save_state == 1 || save_state == 3)
cpu_suspend(save_state, omap34xx_do_sram_idle);
else
omap34xx_do_sram_idle(save_state);
+ if (rcuidle)
+ rcuidle_rcu_exit();
+
/* Restore normal SDRC POWER settings */
if (cpu_is_omap3430() && omap_rev() >= OMAP3430_REV_ES3_0 &&
(omap_type() == OMAP2_DEVICE_TYPE_EMU ||
@@ -316,7 +324,7 @@ static int omap3_pm_suspend(void)
omap3_intc_suspend();
- omap_sram_idle();
+ omap_sram_idle(false);
restore:
/* Restore next_pwrsts */
Powered by blists - more mailing lists