Re: [PATCH v9 05/17] ARM: tegra: Propagate error from tegra_idle_lp2_last()

From: Daniel Lezcano
Date: Fri Feb 21 2020 - 12:40:42 EST


On Fri, Feb 21, 2020 at 08:21:41PM +0300, Dmitry Osipenko wrote:
> 21.02.2020 18:16, Daniel Lezcano ÐÐÑÐÑ:
> > On Thu, Feb 13, 2020 at 02:51:22AM +0300, Dmitry Osipenko wrote:
> >> Technically cpu_suspend() may fail and it's never good to lose information
> >> about failure. For example things like cpuidle core could correctly sample
> >> idling time in the case of failure.
> >>
> >> Acked-by: Peter De Schrijver <pdeschrijver@xxxxxxxxxx>
> >> Tested-by: Peter Geis <pgwipeout@xxxxxxxxx>
> >> Tested-by: Jasper Korten <jja2000@xxxxxxxxx>
> >> Tested-by: David Heidelberg <david@xxxxxxx>
> >> Signed-off-by: Dmitry Osipenko <digetx@xxxxxxxxx>
> >> ---
> >
> > [ ... ]
> >
> >> cpu_cluster_pm_enter();
> >> suspend_cpu_complex();
> >>
> >> - cpu_suspend(PHYS_OFFSET - PAGE_OFFSET, &tegra_sleep_cpu);
> >> + err = cpu_suspend(PHYS_OFFSET - PAGE_OFFSET, &tegra_sleep_cpu);
> >>
> >> /*
> >> * Resume L2 cache if it wasn't re-enabled early during resume,
> >> @@ -208,6 +210,8 @@ void tegra_idle_lp2_last(void)
> >>
> >> restore_cpu_complex();
> >
> > If the cpu_suspend fails, does restore_cpu_complex() need to be called ?
>
> Yes, because suspend_cpu_complex() didn't fail. I don't see any reason
> why restore_cpu_complex() shouldn't be called, please clarify yours thought.

If the suspend fails, the power down does not happen, thus the logic is not
lost and then it not necessary to restore something which has not been lost.

I don't know the hardware details, so that may be partially correct.

--

<http://www.linaro.org/> Linaro.org â Open source software for ARM SoCs

Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog