* [PATCH 0/2] ARM: omap: cpuidle34xx: Fix unbalanced cpu_pm_enter()/exit() and cleanup
@ 2026-10-28 19:15 Andreas Kemnade
2026-10-28 19:15 ` [PATCH 1/2] ARM: omap: cpuidle34xx: balance cpu_pm_enter/exit() Andreas Kemnade
2026-10-28 19:15 ` [PATCH 2/2] ARM: omap: cpuidle34xx: Constify state info Andreas Kemnade
0 siblings, 2 replies; 4+ messages in thread
From: Andreas Kemnade @ 2026-10-28 19:15 UTC (permalink / raw)
To: Aaro Koskinen, Kevin Hilman, Roger Quadros, Tony Lindgren, Russell King
Cc: linux-omap, linux-arm-kernel, linux-kernel, Andreas Kemnade
Fix unbalanced CPU pm calls and delegate the question whether the
cx pointer contents could change to the compiler.
During research for some spurios FPU issues, this oddity come to
light.
Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
---
Andreas Kemnade (2):
ARM: omap: cpuidle34xx: balance cpu_pm_enter/exit()
ARM: omap: cpuidle34xx: Constify state info
arch/arm/mach-omap2/cpuidle34xx.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
---
base-commit: 5fd8fdf561e0e6093305b6c993ee9b7c25bc8b51
change-id: 20261028-susp2-e2a9a2c9e71f
Best regards,
--
Andreas Kemnade <andreas@kemnade.info>
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/2] ARM: omap: cpuidle34xx: balance cpu_pm_enter/exit()
2026-10-28 19:15 [PATCH 0/2] ARM: omap: cpuidle34xx: Fix unbalanced cpu_pm_enter()/exit() and cleanup Andreas Kemnade
@ 2026-10-28 19:15 ` Andreas Kemnade
2026-10-28 20:27 ` Andreas Kemnade
2026-10-28 19:15 ` [PATCH 2/2] ARM: omap: cpuidle34xx: Constify state info Andreas Kemnade
1 sibling, 1 reply; 4+ messages in thread
From: Andreas Kemnade @ 2026-10-28 19:15 UTC (permalink / raw)
To: Aaro Koskinen, Kevin Hilman, Roger Quadros, Tony Lindgren, Russell King
Cc: linux-omap, linux-arm-kernel, linux-kernel, Andreas Kemnade
These calls are usually done in a balanced way, so allow notifiers to
assume that these calls are balanced under all circumstances.
Seen some spurios vfp issues probably connected to this.
Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
---
arch/arm/mach-omap2/cpuidle34xx.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/arch/arm/mach-omap2/cpuidle34xx.c b/arch/arm/mach-omap2/cpuidle34xx.c
index 2ab5dcbfb7f6..e42dcf8c03a3 100644
--- a/arch/arm/mach-omap2/cpuidle34xx.c
+++ b/arch/arm/mach-omap2/cpuidle34xx.c
@@ -139,8 +139,7 @@ static int omap3_enter_idle(struct cpuidle_device *dev,
* Call idle CPU PM enter notifier chain to restore
* VFP context.
*/
- if (cx->mpu_state == PWRDM_POWER_OFF &&
- pwrdm_read_prev_pwrst(mpu_pd) == PWRDM_POWER_OFF)
+ if (cx->mpu_state == PWRDM_POWER_OFF)
cpu_pm_exit();
out_clkdm_set:
--
2.47.3
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 2/2] ARM: omap: cpuidle34xx: Constify state info
2026-10-28 19:15 [PATCH 0/2] ARM: omap: cpuidle34xx: Fix unbalanced cpu_pm_enter()/exit() and cleanup Andreas Kemnade
2026-10-28 19:15 ` [PATCH 1/2] ARM: omap: cpuidle34xx: balance cpu_pm_enter/exit() Andreas Kemnade
@ 2026-10-28 19:15 ` Andreas Kemnade
1 sibling, 0 replies; 4+ messages in thread
From: Andreas Kemnade @ 2026-10-28 19:15 UTC (permalink / raw)
To: Aaro Koskinen, Kevin Hilman, Roger Quadros, Tony Lindgren, Russell King
Cc: linux-omap, linux-arm-kernel, linux-kernel, Andreas Kemnade
omap3_idle_statedata is only static read only data,
so have that fact cleary visible.
Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
---
arch/arm/mach-omap2/cpuidle34xx.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/arch/arm/mach-omap2/cpuidle34xx.c b/arch/arm/mach-omap2/cpuidle34xx.c
index e42dcf8c03a3..16d2e1f08b48 100644
--- a/arch/arm/mach-omap2/cpuidle34xx.c
+++ b/arch/arm/mach-omap2/cpuidle34xx.c
@@ -58,7 +58,7 @@ static struct powerdomain *mpu_pd, *core_pd, *per_pd, *cam_pd;
* Prevent PER OFF if CORE is not in RETention or OFF as this would
* disable PER wakeups completely.
*/
-static struct omap3_idle_statedata omap3_idle_data[] = {
+static const struct omap3_idle_statedata omap3_idle_data[] = {
{
.mpu_state = PWRDM_POWER_ON,
.core_state = PWRDM_POWER_ON,
@@ -108,7 +108,7 @@ static int omap3_enter_idle(struct cpuidle_device *dev,
struct cpuidle_driver *drv,
int index)
{
- struct omap3_idle_statedata *cx = &omap3_idle_data[index];
+ const struct omap3_idle_statedata *cx = &omap3_idle_data[index];
int error;
if (omap_irq_pending() || need_resched())
@@ -168,7 +168,7 @@ static int omap3_enter_idle(struct cpuidle_device *dev,
static int next_valid_state(struct cpuidle_device *dev,
struct cpuidle_driver *drv, int index)
{
- struct omap3_idle_statedata *cx = &omap3_idle_data[index];
+ const struct omap3_idle_statedata *cx = &omap3_idle_data[index];
u32 mpu_deepest_state = PWRDM_POWER_RET;
u32 core_deepest_state = PWRDM_POWER_RET;
int idx;
@@ -221,7 +221,7 @@ static int omap3_enter_idle_bm(struct cpuidle_device *dev,
{
int new_state_idx, ret;
u8 per_next_state, per_saved_state;
- struct omap3_idle_statedata *cx;
+ const struct omap3_idle_statedata *cx;
/*
* Use only C1 if CAM is active.
--
2.47.3
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] ARM: omap: cpuidle34xx: balance cpu_pm_enter/exit()
2026-10-28 19:15 ` [PATCH 1/2] ARM: omap: cpuidle34xx: balance cpu_pm_enter/exit() Andreas Kemnade
@ 2026-10-28 20:27 ` Andreas Kemnade
0 siblings, 0 replies; 4+ messages in thread
From: Andreas Kemnade @ 2026-10-28 20:27 UTC (permalink / raw)
To: Aaro Koskinen, Kevin Hilman, Roger Quadros, Tony Lindgren, Russell King
Cc: linux-omap, linux-arm-kernel, linux-kernel, absicsz
On Wed, 28 Oct 2026 20:15:11 +0100
Andreas Kemnade <andreas@kemnade.info> wrote:
> These calls are usually done in a balanced way, so allow notifiers to
> assume that these calls are balanced under all circumstances.
> Seen some spurios vfp issues probably connected to this.
>
> Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
Looked again at some discussions with Sicelo testing such things:
He had observed a NEON off count 1 but MPU 0 in /sys/kernel/debug/pm_debug/count.
Probably more involved, but lets not freak out things here.
So that is definitively a real problem fixed by this. vfp_pm_resume()
would not be called to restore the state without a patch like this.
So this is
Fixes: 1cd96478cf150 ("ARM: OMAP3xxx: CPUIdle: optimize __omap3_enter_idle()")
> ---
> arch/arm/mach-omap2/cpuidle34xx.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/cpuidle34xx.c b/arch/arm/mach-omap2/cpuidle34xx.c
> index 2ab5dcbfb7f6..e42dcf8c03a3 100644
> --- a/arch/arm/mach-omap2/cpuidle34xx.c
> +++ b/arch/arm/mach-omap2/cpuidle34xx.c
> @@ -139,8 +139,7 @@ static int omap3_enter_idle(struct cpuidle_device *dev,
> * Call idle CPU PM enter notifier chain to restore
> * VFP context.
> */
> - if (cx->mpu_state == PWRDM_POWER_OFF &&
> - pwrdm_read_prev_pwrst(mpu_pd) == PWRDM_POWER_OFF)
> + if (cx->mpu_state == PWRDM_POWER_OFF)
> cpu_pm_exit();
>
> out_clkdm_set:
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-10-28 20:27 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-28 19:15 [PATCH 0/2] ARM: omap: cpuidle34xx: Fix unbalanced cpu_pm_enter()/exit() and cleanup Andreas Kemnade
2026-10-28 19:15 ` [PATCH 1/2] ARM: omap: cpuidle34xx: balance cpu_pm_enter/exit() Andreas Kemnade
2026-10-28 20:27 ` Andreas Kemnade
2026-10-28 19:15 ` [PATCH 2/2] ARM: omap: cpuidle34xx: Constify state info Andreas Kemnade
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®