linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] cpu_pm: add syscore_suspend error handling
@ 2018-03-01  3:27 Derek Basehore
  2018-03-01  8:39 ` Sebastian Andrzej Siewior
  0 siblings, 1 reply; 3+ messages in thread
From: Derek Basehore @ 2018-03-01  3:27 UTC (permalink / raw)
  To: linux-kernel
  Cc: bigeasy, rafael.j.wysocki, alex.shi, briannorris, marc.zyngier,
	Derek Basehore

If cpu_cluster_pm_enter() fails, cpu_pm_exit() should be called. This
will put the CPU in the correct state to resume from the failure.

Signed-off-by: Derek Basehore <dbasehore@chromium.org>
---
 kernel/cpu_pm.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/kernel/cpu_pm.c b/kernel/cpu_pm.c
index 67b02e138a47..03bcc0751a51 100644
--- a/kernel/cpu_pm.c
+++ b/kernel/cpu_pm.c
@@ -186,6 +186,9 @@ static int cpu_pm_suspend(void)
 		return ret;
 
 	ret = cpu_cluster_pm_enter();
+	if (ret)
+		cpu_pm_exit();
+
 	return ret;
 }
 
-- 
2.16.2.395.g2e18187dfd-goog

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] cpu_pm: add syscore_suspend error handling
  2018-03-01  3:27 [PATCH] cpu_pm: add syscore_suspend error handling Derek Basehore
@ 2018-03-01  8:39 ` Sebastian Andrzej Siewior
  2018-03-03  1:23   ` dbasehore .
  0 siblings, 1 reply; 3+ messages in thread
From: Sebastian Andrzej Siewior @ 2018-03-01  8:39 UTC (permalink / raw)
  To: Derek Basehore
  Cc: linux-kernel, rafael.j.wysocki, alex.shi, briannorris, marc.zyngier

On 2018-02-28 19:27:54 [-0800], Derek Basehore wrote:
> If cpu_cluster_pm_enter() fails, cpu_pm_exit() should be called. This
> will put the CPU in the correct state to resume from the failure.

Was this triggered or found on review? Either way it was introduced in 
  6f3eaec87b6b ("cpu_pm: call notifiers during suspend")
and I might need a stable tag.

> Signed-off-by: Derek Basehore <dbasehore@chromium.org>

Sebastian

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] cpu_pm: add syscore_suspend error handling
  2018-03-01  8:39 ` Sebastian Andrzej Siewior
@ 2018-03-03  1:23   ` dbasehore .
  0 siblings, 0 replies; 3+ messages in thread
From: dbasehore . @ 2018-03-03  1:23 UTC (permalink / raw)
  To: Sebastian Andrzej Siewior
  Cc: linux-kernel, Wysocki, Rafael J, alex.shi, Brian Norris, Marc Zyngier

On Thu, Mar 1, 2018 at 12:39 AM, Sebastian Andrzej Siewior
<bigeasy@linutronix.de> wrote:
> On 2018-02-28 19:27:54 [-0800], Derek Basehore wrote:
>> If cpu_cluster_pm_enter() fails, cpu_pm_exit() should be called. This
>> will put the CPU in the correct state to resume from the failure.
>
> Was this triggered or found on review? Either way it was introduced in
>   6f3eaec87b6b ("cpu_pm: call notifiers during suspend")
> and I might need a stable tag.

It was found during review. I was able to verify that this is a bug,
though. The Rockchip RK3399 doesn't use cluster idle except during
suspend. If I just return an error for cpu_cluster_pm_enter, the
machine wedges. Including this patch makes it error out of suspend
gracefully.

>
>> Signed-off-by: Derek Basehore <dbasehore@chromium.org>
>
> Sebastian

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-03-03  1:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-01  3:27 [PATCH] cpu_pm: add syscore_suspend error handling Derek Basehore
2018-03-01  8:39 ` Sebastian Andrzej Siewior
2018-03-03  1:23   ` dbasehore .

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).