From patchwork Fri Sep 12 11:01:32 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: preeti X-Patchwork-Id: 4893791 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id DF85ABEEA5 for ; Fri, 12 Sep 2014 11:02:00 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0A03F202A1 for ; Fri, 12 Sep 2014 11:01:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 69BB020270 for ; Fri, 12 Sep 2014 11:01:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753579AbaILLBu (ORCPT ); Fri, 12 Sep 2014 07:01:50 -0400 Received: from e32.co.us.ibm.com ([32.97.110.150]:46939 "EHLO e32.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753419AbaILLBt (ORCPT ); Fri, 12 Sep 2014 07:01:49 -0400 Received: from /spool/local by e32.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 12 Sep 2014 05:01:48 -0600 Received: from d03dlp02.boulder.ibm.com (9.17.202.178) by e32.co.us.ibm.com (192.168.1.132) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 12 Sep 2014 05:01:47 -0600 Received: from b03cxnp08025.gho.boulder.ibm.com (b03cxnp08025.gho.boulder.ibm.com [9.17.130.17]) by d03dlp02.boulder.ibm.com (Postfix) with ESMTP id A18063E40030; Fri, 12 Sep 2014 05:01:46 -0600 (MDT) Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by b03cxnp08025.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id s8CB1kWj50331692; Fri, 12 Sep 2014 13:01:46 +0200 Received: from d03av02.boulder.ibm.com (localhost [127.0.0.1]) by d03av02.boulder.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s8CB1jvm002960; Fri, 12 Sep 2014 05:01:46 -0600 Received: from preeti.in.ibm.com ([9.79.184.45]) by d03av02.boulder.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id s8CB1Xat002011; Fri, 12 Sep 2014 05:01:36 -0600 Subject: [PATCH] cpuidle/powernv: Enter fastsleep on checking if deep idle states are allowed From: Preeti U Murthy To: mikey@neuling.org, mpe@ellerman.id.au, rjw@rjwysocki.net, linux-kernel@vger.kernel.org, benh@kernel.crashing.org, linuxppc-dev@lists.ozlabs.org Cc: linux-pm@vger.kernel.org Date: Fri, 12 Sep 2014 16:31:32 +0530 Message-ID: <20140912110131.7311.86417.stgit@preeti.in.ibm.com> User-Agent: StGit/0.17-dirty MIME-Version: 1.0 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 14091211-0928-0000-0000-000004D48242 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-9.1 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, 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 Today the procfs interface /proc/sys/kernel/powersave-nap is used to control entry into deep idle states beyond snooze. Check for the value of this parameter before entering fastsleep. We already do this check for nap in power7_idle(). Signed-off-by: Preeti U Murthy --- drivers/cpuidle/cpuidle-powernv.c | 6 ++++++ 1 file changed, 6 insertions(+) -- To unsubscribe from this list: send the line "unsubscribe linux-pm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/cpuidle/cpuidle-powernv.c b/drivers/cpuidle/cpuidle-powernv.c index a64be57..b8ba52e 100644 --- a/drivers/cpuidle/cpuidle-powernv.c +++ b/drivers/cpuidle/cpuidle-powernv.c @@ -69,6 +69,12 @@ static int fastsleep_loop(struct cpuidle_device *dev, unsigned long old_lpcr = mfspr(SPRN_LPCR); unsigned long new_lpcr; + /* + * Verify if snooze is the only valid cpuidle state + */ + if (!(powersave_nap > 0)) + return index; + if (unlikely(system_state < SYSTEM_RUNNING)) return index;