ARM: OMAP2+: Handle errors from cpu_pm_enter()
Subsystems (3)
Tony Lindgren
maintainerPATCH 1/1 ARM: OMAP2+: Handle errors from cpu_pm_enter()
Let's add error handling since we actually might get some.
--- arch/arm/mach-omap2/cpuidle44xx.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-)
arch/arm/mach-omap2/cpuidle44xx.c +10 -7
@@ -125,6 +125,7 @@ static int omap_enter_idle_coupled(struct cpuidle_device *dev, {struct idle_statedata *cx = state_ptr + index;u32 mpuss_can_lose_context =0 ; +int error;/* * CPU0 has to wait and stay ON until CPU1 is OFF state.
@@ -158,7 +159,9 @@ static int omap_enter_idle_coupled(struct cpuidle_device *dev,* Call idle CPU PM enter notifier chain so that * VFP and per CPU interrupt context is saved. */ -cpu_pm_enter (); + error =cpu_pm_enter (); +if (error) + goto cpu_pm_out;if (dev->cpu ==0 ) {pwrdm_set_logic_retst (mpu_pd, cx->mpu_logic_state);
@@ -196,18 +199,18 @@ static int omap_enter_idle_coupled(struct cpuidle_device *dev, } } -/* -* Call idle CPU PM exit notifier chain to restore -* VFP and per CPU IRQ context. -*/ -cpu_pm_exit (); -/* * Call idle CPU cluster PM exit notifier chain * to restore GIC and wakeupgen context. */ if (dev->cpu ==0 && mpuss_can_lose_context)cpu_cluster_pm_exit (); +cpu_pm_out: +/* +* Call idle CPU PM exit notifier chain to restore +* VFP and per CPU IRQ context. +*/ +cpu_pm_exit ();tick_broadcast_exit ();
Signature · 1 line
2.16.1
PATCH 1/1 ARM: OMAP2+: Handle errors from cpu_pm_enter()
Quoted 43 lines · Tony Lindgren
Let's add error handling since we actually might get some.
Cc Dave Gerlach <[email protected]>Cc Tero Kristo <[email protected]>Signed-off-by Tony Lindgren <[email protected]>--- arch/arm/mach-omap2/cpuidle44xx.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-)arch/arm/mach-omap2/cpuidle44xx.c +4
-7@@ -125,6 +125,7 @@ static int omap_enter_idle_coupled(struct cpuidle_device *dev, {struct idle_statedata *cx = state_ptr + index;u32 mpuss_can_lose_context =0 ; +int error;/* * CPU0 has to wait and stay ON until CPU1 is OFF state. @@ -158,7 +159,9 @@ static int omap_enter_idle_coupled(struct cpuidle_device *dev,* Call idle CPU PM enter notifier chain so that * VFP and per CPU interrupt context is saved. */ -cpu_pm_enter (); + error =cpu_pm_enter (); +if (error) + goto cpu_pm_out;if (dev->cpu ==0 ) {pwrdm_set_logic_retst (mpu_pd, cx->mpu_logic_state);@@ -196,18 +199,18 @@ static int omap_enter_idle_coupled(struct cpuidle_device *dev, } } -/* -* Call idle CPU PM exit notifier chain to restore -* VFP and per CPU IRQ context. -*/ -cpu_pm_exit (); -/* * Call idle CPU cluster PM exit notifier chain
arch/arm/mach-omap2/cpuidle44xx.c static int omap_enter_idle_coupled(struct cpuidle_device *dev, · line 213
Quoted 10 lines
arch/arm/mach-omap2/cpuidle44xx.c +6
-0* to restore GIC and wakeupgen context. */ if (dev->cpu ==0 && mpuss_can_lose_context)cpu_cluster_pm_exit (); +cpu_pm_out: +/* +* Call idle CPU PM exit notifier chain to restore +* VFP and per CPU IRQ context. +*/ +cpu_pm_exit ();
It looks ok, in general, but you've changed order of calls here, so may be commit message need to be updated
Quoted 4 lines
arch/arm/mach-omap2/cpuidle44xx.c +0
-0tick_broadcast_exit ();
Signature · 2 lines
regards, -grygorii
Tony Lindgren
maintainerPATCH 1/1 ARM: OMAP2+: Handle errors from cpu_pm_enter()
Quoted 17 lines · Grygorii Strashko
Quoted 16 lines · Tony Lindgren
arch/arm/mach-omap2/cpuidle44xx.c +1
-6@@ -196,18 +199,18 @@ static int omap_enter_idle_coupled(struct cpuidle_device *dev, } } -/* -* Call idle CPU PM exit notifier chain to restore -* VFP and per CPU IRQ context. -*/ -cpu_pm_exit (); -/* * Call idle CPU cluster PM exit notifier chain * to restore GIC and wakeupgen context. */ if (dev->cpu ==0 && mpuss_can_lose_context)cpu_cluster_pm_exit (); +cpu_pm_out:
Quoted 8 lines
arch/arm/mach-omap2/cpuidle44xx.c static int omap_enter_idle_coupled(struct cpuidle_device *dev, · line 213
Quoted 5 lines
arch/arm/mach-omap2/cpuidle44xx.c +5
-0+/* +* Call idle CPU PM exit notifier chain to restore +* VFP and per CPU IRQ context. +*/ +cpu_pm_exit ();It looks ok, in general, but you've changed order of calls here, so may be commit message need to be updated
Hmm yeah good point, that's how it's usually done. I'll check and update the description like you suggested.
Regards,
Tony