From patchwork Thu Oct 30 03:55:36 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Kachhap X-Patchwork-Id: 5193331 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id CFF039F30B for ; Thu, 30 Oct 2014 03:58:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 11C36201FE for ; Thu, 30 Oct 2014 03:58:44 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 76DA5201C7 for ; Thu, 30 Oct 2014 03:58:39 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XjgqE-00018K-J8; Thu, 30 Oct 2014 03:56:06 +0000 Received: from mail-pa0-x230.google.com ([2607:f8b0:400e:c03::230]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Xjgq9-0000xU-0W for linux-arm-kernel@lists.infradead.org; Thu, 30 Oct 2014 03:56:04 +0000 Received: by mail-pa0-f48.google.com with SMTP id ey11so4565910pad.21 for ; Wed, 29 Oct 2014 20:55:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id; bh=1ZSTCTWgeBc/wOV3/pFYC4WqxRaGKUU0I875+g4QVSQ=; b=aYWLv8idXc5XBQdmbU7w7IQBKYT/+dHPwqFRCtZ24VB4DmJCyjTiuz/QP86YSimfyA SpIvIU4Zf09UsUMG1RY/ZphxhlHQOf5u0oGi7x8gfNThmAqfvVlDfPLnupm0CNCqw8BX Y7dYkcgviD0z9dqTWI9zq08MSWGJC7wMiBk3ZCD/Turxa5X6G/adyVnIdbJMHS6AY+Jk kKIa4FLeAfvCQu0L37+O6K+k375qNkYXHMJqpFNm2zYhL+pwbMgbs/KeDrV5AEQ03Zw5 w7jx+0dcPyi05yEvJ/P9IWqhdsGdqP9OwjPrl6//1oIJYDpdWjppTLCIFmybrO6QPpcY Of4A== X-Received: by 10.66.184.47 with SMTP id er15mr14344592pac.5.1414641339174; Wed, 29 Oct 2014 20:55:39 -0700 (PDT) Received: from localhost.localdomain ([14.140.216.146]) by mx.google.com with ESMTPSA id p10sm5669272pds.37.2014.10.29.20.55.35 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 29 Oct 2014 20:55:38 -0700 (PDT) From: Amit Daniel Kachhap To: linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org Subject: [PATCH 1/3] arm64: psci: warn if psci_power_state variable is not initialised Date: Thu, 30 Oct 2014 09:25:36 +0530 Message-Id: <1414641338-25279-1-git-send-email-amit.daniel@samsung.com> X-Mailer: git-send-email 1.9.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141029_205601_072280_DF16F39D X-CRM114-Status: GOOD ( 11.49 ) X-Spam-Score: -0.7 (/) Cc: Mark Rutland , Catalin Marinas , Vladimir Murzin , Lorenzo Pieralisi , Ashwin Chaugule X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_NONE,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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)