From patchwork Tue Nov 17 22:37:37 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lina Iyer X-Patchwork-Id: 7643391 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 984CDBF90C for ; Tue, 17 Nov 2015 22:53:22 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A024C205C4 for ; Tue, 17 Nov 2015 22:53:21 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D11692058A for ; Tue, 17 Nov 2015 22:53:20 +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 1Zyp61-0003j7-Hv; Tue, 17 Nov 2015 22:51:29 +0000 Received: from mail-pa0-x229.google.com ([2607:f8b0:400e:c03::229]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Zyotz-0005Yy-Em for linux-arm-kernel@lists.infradead.org; Tue, 17 Nov 2015 22:39:05 +0000 Received: by padhx2 with SMTP id hx2so22136690pad.1 for ; Tue, 17 Nov 2015 14:38:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro_org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Y2f2jQFIyIVmz0BTlMm3ydiBBgdePjLFc4lqqyNBkdM=; b=XBGTSLh88b63ANvwojDc1a4Hq3UyrlMmXQhR3H/V9WJSfAk5vyGoRGEBoOL99RtXsi bjrIMgiJQFxhDCju9ZWI+dc9dK0Jd3GtHQ4T9Q73JNANtV9OZ/DYpeg8hv5+LRKYNvyx clUPYrGNZHRvRGmadb7jlzQEwaJN/RXhy9Ig+ubA3Dozzb0L9ZFyJe38T+Y7Q1MiFvz/ yxrjjrQ1KJ+Bhii5plcjglL+mo6t+QC8n2yMB5n29cfPJnMujOdRHOGZTg+8bNsXplEZ i40qCzQATVcUZYAsa5U3AheMYtHXPG9NJawHp1Nga3MXjXV8NkOSelxHbH7HZGub+s+J 324Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Y2f2jQFIyIVmz0BTlMm3ydiBBgdePjLFc4lqqyNBkdM=; b=fiJJ2VjuTS1LgQ9eKDwknFEpvIOYvPMyhKVhvFL6uyzlk2PIbQKxARnq5iniJMJMMs QfyT8VIqHfU6Ve2rCtPjDf+QYvykQI+9Hj665a2Ljp/O5WUK8zuSZLQcfMcjCjtXJukF 43VaFrklDq9hv9muvUPLdk1M9medn+/n8vZmVQCuCOAaQfhRh/y+iFPlpjyreAqEmxT+ BpZdf0niwYK2xVcOGOaNIcodAA5MyYAD4r5pxk6COFRcYGPY3xh8XIiRdBXaDtBQJSFy H65+5pCHeFYLTi3+lHFtNXx5stCJVm6iSzYDwhjUJaCiPkCr0SC1ewMvvakpTgj7fLXm DBnw== X-Gm-Message-State: ALoCoQkqLGFITkDx0CPm6B0OvefN8FadhO5o88RuVYYMm8pk+9yC1p98zmkBY6Bvnoel8BQjrnJ4 X-Received: by 10.68.102.33 with SMTP id fl1mr66913073pbb.40.1447799922604; Tue, 17 Nov 2015 14:38:42 -0800 (PST) Received: from ubuntu.localdomain ([8.42.77.226]) by smtp.gmail.com with ESMTPSA id hy1sm14875199pbb.63.2015.11.17.14.38.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 17 Nov 2015 14:38:41 -0800 (PST) From: Lina Iyer To: ulf.hansson@linaro.org, khilman@linaro.org, linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH RFC 13/27] ARM: cpuidle: Add runtime PM support for CPU idle Date: Tue, 17 Nov 2015 15:37:37 -0700 Message-Id: <1447799871-56374-14-git-send-email-lina.iyer@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1447799871-56374-1-git-send-email-lina.iyer@linaro.org> References: <1447799871-56374-1-git-send-email-lina.iyer@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151117_143903_761545_42B3021F X-CRM114-Status: GOOD ( 13.86 ) X-Spam-Score: -2.6 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: k.kozlowski@samsung.com, lorenzo.pieralisi@arm.com, ahaslam@baylibre.com, linux-arm-msm@vger.kernel.org, Daniel Lezcano , sboyd@codeaurora.org, msivasub@codeaurora.org, geert@linux-m68k.org, Lina Iyer , agross@codeaurora.org, mtitinger@baylibre.com 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=-4.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,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 Notify runtime PM when the CPU is going to be powered off in the idle state. This allows for runtime PM suspend/resume of the CPU as well as its PM domain. Cc: Daniel Lezcano Cc: Lorenzo Pieralisi Signed-off-by: Lina Iyer --- drivers/cpuidle/cpuidle-arm.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/cpuidle/cpuidle-arm.c b/drivers/cpuidle/cpuidle-arm.c index 545069d..8e72a23 100644 --- a/drivers/cpuidle/cpuidle-arm.c +++ b/drivers/cpuidle/cpuidle-arm.c @@ -11,13 +11,16 @@ #define pr_fmt(fmt) "CPUidle arm: " fmt +#include #include #include #include #include #include #include +#include #include +#include #include @@ -45,6 +48,10 @@ static int arm_enter_idle_state(struct cpuidle_device *dev, ret = cpu_pm_enter(); if (!ret) { + struct device *cpu_dev = get_cpu_device(dev->cpu); + + RCU_NONIDLE(pm_runtime_put_sync_suspend(cpu_dev)); + /* * Pass idle state index to cpu_suspend which in turn will * call the CPU ops suspend protocol with idle index as a @@ -52,6 +59,7 @@ static int arm_enter_idle_state(struct cpuidle_device *dev, */ arm_cpuidle_suspend(idx); + RCU_NONIDLE(pm_runtime_get_sync(cpu_dev)); cpu_pm_exit(); }