From patchwork Thu Oct 30 12:24:51 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Kachhap X-Patchwork-Id: 5197191 Return-Path: X-Original-To: patchwork-linux-pm@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 F3EFD9F349 for ; Thu, 30 Oct 2014 12:24:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 550F82013A for ; Thu, 30 Oct 2014 12:24:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 54FB52011D for ; Thu, 30 Oct 2014 12:24:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759275AbaJ3MYk (ORCPT ); Thu, 30 Oct 2014 08:24:40 -0400 Received: from mail-pd0-f172.google.com ([209.85.192.172]:41019 "EHLO mail-pd0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759267AbaJ3MYk (ORCPT ); Thu, 30 Oct 2014 08:24:40 -0400 Received: by mail-pd0-f172.google.com with SMTP id r10so5102878pdi.3 for ; Thu, 30 Oct 2014 05:24: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=pNOYVCrTPO1ydX/hMgvrxLwVJaN1ZW2I33xafN/ddjc=; b=LF3sj1Pv5OuoOLR6bfBkMyYxnolcK4/NG/QakGNtzTO9lrKhrbexEtCH6t63f9by4j /ZoUumX4PrxVawTSgDZiJvbU62ujZl0bNCgdpyASjblrJubxZd3uVmZlRxuwYZXaLOjh YjH36p/U/bGZXe1zYuxtX7Lpq8OzMK1cBEJRhZLkUeEh5+7kZ82J17CJwknmjHlweYp3 7/MzjyXf66oyKDSUNuyQEo0RCHbWea+YfEg7joqx7ox2SO1/148tj6N+WJd3zIW/tVfG K/uO3FDEiBg8X85dJBDjPRCVC9F248WDn0vLRhv0317tgy8PGhUT9d85yRBAP3cf5jSF FlsA== X-Received: by 10.66.253.164 with SMTP id ab4mr16909182pad.59.1414671879649; Thu, 30 Oct 2014 05:24:39 -0700 (PDT) Received: from localhost.localdomain ([14.140.216.146]) by mx.google.com with ESMTPSA id fv6sm7019005pdb.83.2014.10.30.05.24.36 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 30 Oct 2014 05:24:38 -0700 (PDT) From: Amit Daniel Kachhap To: linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org, Catalin Marinas Cc: will.deacon@arm.com, Mark Rutland , Lorenzo Pieralisi , Ashwin Chaugule , Vladimir Murzin Subject: [PATCH v2] arm64: psci: fix cpu_suspend to check idle state type for index Date: Thu, 30 Oct 2014 17:54:51 +0530 Message-Id: <1414671891-29448-1-git-send-email-amit.daniel@samsung.com> X-Mailer: git-send-email 1.9.1 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable 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 This fix rectifies the psci cpu_suspend implementation to check the PSCI power state parameter type field associated with the requested idle state index. Acked-by: Lorenzo Pieralisi Signed-off-by: Amit Daniel Kachhap --- arch/arm64/kernel/psci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/kernel/psci.c b/arch/arm64/kernel/psci.c index 866c1c8..663da77 100644 --- a/arch/arm64/kernel/psci.c +++ b/arch/arm64/kernel/psci.c @@ -528,7 +528,7 @@ static int __maybe_unused cpu_psci_cpu_suspend(unsigned long index) if (WARN_ON_ONCE(!index)) return -EINVAL; - if (state->type == PSCI_POWER_STATE_TYPE_STANDBY) + if (state[index - 1].type == PSCI_POWER_STATE_TYPE_STANDBY) ret = psci_ops.cpu_suspend(state[index - 1], 0); else ret = __cpu_suspend(index, psci_suspend_finisher);