* [PATCH] ARM: OMAP2+: Handle errors from cpu_pm_enter()
@ 2018-02-09 17:47 Tony Lindgren
2018-02-09 20:08 ` Grygorii Strashko
0 siblings, 1 reply; 3+ messages in thread
From: Tony Lindgren @ 2018-02-09 17:47 UTC (permalink / raw)
To: linux-arm-kernel
Let's add error handling since we actually might get some.
Cc: Dave Gerlach <d-gerlach@ti.com>
Cc: Tero Kristo <t-kristo@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
arch/arm/mach-omap2/cpuidle44xx.c | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/arch/arm/mach-omap2/cpuidle44xx.c b/arch/arm/mach-omap2/cpuidle44xx.c
--- a/arch/arm/mach-omap2/cpuidle44xx.c
+++ b/arch/arm/mach-omap2/cpuidle44xx.c
@@ -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();
--
2.16.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] ARM: OMAP2+: Handle errors from cpu_pm_enter()
2018-02-09 17:47 [PATCH] ARM: OMAP2+: Handle errors from cpu_pm_enter() Tony Lindgren
@ 2018-02-09 20:08 ` Grygorii Strashko
2018-02-09 20:54 ` Tony Lindgren
0 siblings, 1 reply; 3+ messages in thread
From: Grygorii Strashko @ 2018-02-09 20:08 UTC (permalink / raw)
To: linux-arm-kernel
On 02/09/2018 11:47 AM, Tony Lindgren wrote:
> Let's add error handling since we actually might get some.
>
> Cc: Dave Gerlach <d-gerlach@ti.com>
> Cc: Tero Kristo <t-kristo@ti.com>
> Signed-off-by: Tony Lindgren <tony@atomide.com>
> ---
> arch/arm/mach-omap2/cpuidle44xx.c | 17 ++++++++++-------
> 1 file changed, 10 insertions(+), 7 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/cpuidle44xx.c b/arch/arm/mach-omap2/cpuidle44xx.c
> --- a/arch/arm/mach-omap2/cpuidle44xx.c
> +++ b/arch/arm/mach-omap2/cpuidle44xx.c
> @@ -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();
It looks ok, in general, but you've changed order of calls here,
so may be commit message need to be updated
>
> tick_broadcast_exit();
>
>
--
regards,
-grygorii
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] ARM: OMAP2+: Handle errors from cpu_pm_enter()
2018-02-09 20:08 ` Grygorii Strashko
@ 2018-02-09 20:54 ` Tony Lindgren
0 siblings, 0 replies; 3+ messages in thread
From: Tony Lindgren @ 2018-02-09 20:54 UTC (permalink / raw)
To: linux-arm-kernel
* Grygorii Strashko <grygorii.strashko@ti.com> [180209 20:09]:
> On 02/09/2018 11:47 AM, Tony Lindgren wrote:
> > @@ -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();
>
> 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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-02-09 20:54 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-09 17:47 [PATCH] ARM: OMAP2+: Handle errors from cpu_pm_enter() Tony Lindgren
2018-02-09 20:08 ` Grygorii Strashko
2018-02-09 20:54 ` Tony Lindgren
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).