Skip to contentSkip to conversation

cpu_pm: add syscore_suspend error handling

PATCH In review Derek Basehore 2 participants 3 messages Mar 1, 2018 – Mar 3, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cpu_pm: add syscore_suspend error handling

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.

---
 kernel/cpu_pm.c | 3 +++
 1 file changed, 3 insertions(+)
kernel/cpu_pm.c +3 -0
index 67b02e138a47..03bcc0751a51 100644
@@ -186,6 +186,9 @@ static int cpu_pm_suspend(void)
 		return ret;
 
 	ret = cpu_cluster_pm_enter();
+	if (ret)
+		cpu_pm_exit();
+
 	return ret;
 }
 
Signature · 1 line
2.16.2.395.g2e18187dfd-goog
#1 lore raw
Quoted 2 lines · 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.

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.

Quoted 1 line

Sebastian

#2 lore raw
Quoted 7 lines · Sebastian Andrzej Siewior
Quoted 2 lines · 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.

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.

Quoted 4 lines
Quoted 2 lines

Sebastian