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: 56891 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp2218339lbb; Tue, 17 Nov 2015 14:39:13 -0800 (PST) X-Received: by 10.68.218.194 with SMTP id pi2mr67811721pbc.38.1447799926096; Tue, 17 Nov 2015 14:38:46 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ax2si60766904pbd.123.2015.11.17.14.38.44; Tue, 17 Nov 2015 14:38:46 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dkim=neutral (body hash did not verify) header.i=@linaro_org.20150623.gappssmtp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932568AbbKQWin (ORCPT + 6 others); 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 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(+) -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" 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-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(); }