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: 7642851 X-Patchwork-Delegate: agross@codeaurora.org Return-Path: X-Original-To: patchwork-linux-arm-msm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 1EE609F392 for ; Tue, 17 Nov 2015 22:38:57 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 43EBA2051A for ; Tue, 17 Nov 2015 22:38:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 95AA02051F for ; Tue, 17 Nov 2015 22:38:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932568AbbKQWin (ORCPT ); Tue, 17 Nov 2015 17:38:43 -0500 Received: from mail-pa0-f44.google.com ([209.85.220.44]:34985 "EHLO mail-pa0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932545AbbKQWin (ORCPT ); Tue, 17 Nov 2015 17:38:43 -0500 Received: by pacej9 with SMTP id ej9so22073509pac.2 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=YdPtNKn6zRObZfKV+UxPLcdwc/V3+TWBftD6yD1rpAvyWBJoYk5qZdxKcyNhbH0Pjt IEQLAw0UIMgOm6OnivETlHGuslxeva5fvrif1cqzFVhHRLxIeSJhdbyobwTgUAgmPR0q YwJY/mDumROp41qE8aVJjSjMGdiQRQMtHfL9gfML7TNmeykn5yAPG6gN1+fP+5cGVKlK o/twGJ+CImttGHoIuAY9DnYNHWqYjDk0BiTPFlE7CD/kRCYcdLCBf5z7abyfesN5ALZr 6VQ2bmC7xYRDq+VUK0nAH2+9BeEV4fg6EEqOkaVJld7JAcMxhvv5TAXK5yX5CLW1iaHB p75Q== X-Gm-Message-State: ALoCoQnxbqSlcEvoD7O8nkcwT2FG60vHhj/voF0MXksiYQFeExpjjbR4U9/XXxZgnr91peyiNy0h 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 Cc: geert@linux-m68k.org, k.kozlowski@samsung.com, msivasub@codeaurora.org, agross@codeaurora.org, sboyd@codeaurora.org, linux-arm-msm@vger.kernel.org, lorenzo.pieralisi@arm.com, ahaslam@baylibre.com, mtitinger@baylibre.com, Lina Iyer , Daniel Lezcano 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> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@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=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(); }