linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] arm64: psci: warn if psci_power_state variable is not initialised
@ 2014-10-30  3:55 Amit Daniel Kachhap
  2014-10-30  3:55 ` [PATCH 2/3] arm64: psci: fix cpu_suspend to check idle state type for index Amit Daniel Kachhap
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Amit Daniel Kachhap @ 2014-10-30  3:55 UTC (permalink / raw)
  To: linux-arm-kernel, linux-pm
  Cc: Catalin Marinas, Mark Rutland, Lorenzo Pieralisi, Ashwin Chaugule,
	Vladimir Murzin

Without this cpu_suspend may cause crash dump when psci cpuidle
is not initialised and cpu_suspend is called.

Signed-off-by: Amit Daniel Kachhap <amit.daniel@samsung.com>
---
 arch/arm64/kernel/psci.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/kernel/psci.c b/arch/arm64/kernel/psci.c
index 866c1c8..2178d6e 100644
--- a/arch/arm64/kernel/psci.c
+++ b/arch/arm64/kernel/psci.c
@@ -523,9 +523,11 @@ static int __maybe_unused cpu_psci_cpu_suspend(unsigned long index)
 	struct psci_power_state *state = __get_cpu_var(psci_power_state);
 	/*
 	 * idle state index 0 corresponds to wfi, should never be called
-	 * from the cpu_suspend operations
+	 * from the cpu_suspend operations.
+	 * Also psci_power_state variable should have been populated by
+	 * above init idle routine.
 	 */
-	if (WARN_ON_ONCE(!index))
+	if (WARN_ON_ONCE(!index || !state))
 		return -EINVAL;
 
 	if (state->type == PSCI_POWER_STATE_TYPE_STANDBY)
-- 
1.9.1


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

end of thread, other threads:[~2014-12-15 18:34 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-30  3:55 [PATCH 1/3] arm64: psci: warn if psci_power_state variable is not initialised Amit Daniel Kachhap
2014-10-30  3:55 ` [PATCH 2/3] arm64: psci: fix cpu_suspend to check idle state type for index Amit Daniel Kachhap
2014-10-30 10:19   ` Lorenzo Pieralisi
2014-10-30 11:31     ` amit daniel kachhap
2014-10-30  3:55 ` [PATCH 3/3] arm64: psci: Add support to call cpu_suspend with deepest C state Amit Daniel Kachhap
2014-10-30 10:46   ` Lorenzo Pieralisi
2014-10-30 11:22     ` amit daniel kachhap
2014-12-01  8:08     ` amit daniel kachhap
2014-12-15 18:34       ` Lorenzo Pieralisi
2014-10-30 10:29 ` [PATCH 1/3] arm64: psci: warn if psci_power_state variable is not initialised Lorenzo Pieralisi
2014-10-30 11:35   ` Amit Kachhap

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