From patchwork Tue Aug 4 23:35: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: 51936 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f197.google.com (mail-lb0-f197.google.com [209.85.217.197]) by patches.linaro.org (Postfix) with ESMTPS id 8888A229FD for ; Tue, 4 Aug 2015 23:36:30 +0000 (UTC) Received: by lbcjj5 with SMTP id jj5sf7881954lbc.1 for ; Tue, 04 Aug 2015 16:36:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=TvktVPor2o8AFkMJ6BLkEyH/xxYkjXHvHXACx+mes+0=; b=LGGAq0xa/6eMMfOmYTmALRAgso4JsX1//va58uwc3TyRcgqrQJDkFliMG6iwixxkYE YMMay3Xw4Mq9xpIDlHFFxF7Aobx32yq4lxNr4nSLuOX6f/yEFX5S4aSurRM/Rbs/+sWz a00QliZVedYiFxsxSUrx9yI2kzW+46UYI2PG+nNv/T0m0EcKYbWM5SnUwZKChXUGzm8F BpWQClkTs7qMkLqYkHbL356Isu82f+lhqN5+WVBREPgq0xbj1LB0E3FqV6sFBc2mM04B +p6/Uzrg/3vGWq6hRUWNI4V7fqvv/B//TvTwPXPoM1Vj9B8CLmeJTH13MFTB/OE/inCB sjCQ== X-Gm-Message-State: ALoCoQkDWrnwUv4bgGVHH2NADUXq40gzwRQOpaWsDBPWJiscelOvRoMAdDPqZiqrvl6ue9lNnMA9 X-Received: by 10.152.6.103 with SMTP id z7mr1838218laz.8.1438731389508; Tue, 04 Aug 2015 16:36:29 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.29.7 with SMTP id f7ls112086lah.48.gmail; Tue, 04 Aug 2015 16:36:29 -0700 (PDT) X-Received: by 10.112.161.40 with SMTP id xp8mr6733158lbb.71.1438731389363; Tue, 04 Aug 2015 16:36:29 -0700 (PDT) Received: from mail-lb0-f172.google.com (mail-lb0-f172.google.com. [209.85.217.172]) by mx.google.com with ESMTPS id xd3si883713lbb.166.2015.08.04.16.36.29 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Aug 2015 16:36:29 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.172 as permitted sender) client-ip=209.85.217.172; Received: by lbbud7 with SMTP id ud7so14992641lbb.3 for ; Tue, 04 Aug 2015 16:36:29 -0700 (PDT) X-Received: by 10.112.166.106 with SMTP id zf10mr6813019lbb.36.1438731389277; Tue, 04 Aug 2015 16:36:29 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.7.198 with SMTP id l6csp50474lba; Tue, 4 Aug 2015 16:36:28 -0700 (PDT) X-Received: by 10.70.38.136 with SMTP id g8mr12822721pdk.156.1438731379329; Tue, 04 Aug 2015 16:36:19 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id mi8si1794926pdb.134.2015.08.04.16.36.18; Tue, 04 Aug 2015 16:36:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754678AbbHDXgR (ORCPT + 12 others); Tue, 4 Aug 2015 19:36:17 -0400 Received: from mail-pa0-f46.google.com ([209.85.220.46]:35794 "EHLO mail-pa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754663AbbHDXgR (ORCPT ); Tue, 4 Aug 2015 19:36:17 -0400 Received: by pabxd6 with SMTP id xd6so2468698pab.2 for ; Tue, 04 Aug 2015 16:36:16 -0700 (PDT) X-Received: by 10.67.5.231 with SMTP id cp7mr13166452pad.36.1438731376736; Tue, 04 Aug 2015 16:36:16 -0700 (PDT) Received: from ubuntu.localdomain (i-global254.qualcomm.com. [199.106.103.254]) by smtp.gmail.com with ESMTPSA id to5sm527525pac.33.2015.08.04.16.36.15 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 04 Aug 2015 16:36:16 -0700 (PDT) From: Lina Iyer To: rjw@rjwysocki.net, ulf.hansson@linaro.org, khilman@linaro.org Cc: geert@linux-m68k.org, k.kozlowski@samsung.com, linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, msivasub@codeaurora.org, agross@codeaurora.org, sboyd@codeaurora.org, Lina Iyer , Daniel Lezcano , Lorenzo Pieralisi Subject: [PATCH 7/9] ARM: cpuidle: Add runtime PM support for CPU idle Date: Tue, 4 Aug 2015 17:35:37 -0600 Message-Id: <1438731339-58317-8-git-send-email-lina.iyer@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1438731339-58317-1-git-send-email-lina.iyer@linaro.org> References: <1438731339-58317-1-git-send-email-lina.iyer@linaro.org> Sender: linux-pm-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: lina.iyer@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.172 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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 | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/cpuidle/cpuidle-arm.c b/drivers/cpuidle/cpuidle-arm.c index 545069d..ca118ed 100644 --- a/drivers/cpuidle/cpuidle-arm.c +++ b/drivers/cpuidle/cpuidle-arm.c @@ -11,12 +11,14 @@ #define pr_fmt(fmt) "CPUidle arm: " fmt +#include #include #include #include #include #include #include +#include #include #include @@ -37,6 +39,7 @@ static int arm_enter_idle_state(struct cpuidle_device *dev, struct cpuidle_driver *drv, int idx) { int ret; + struct device *cpu_dev = get_cpu_device(dev->cpu); if (!idx) { cpu_do_idle(); @@ -46,12 +49,19 @@ static int arm_enter_idle_state(struct cpuidle_device *dev, ret = cpu_pm_enter(); if (!ret) { /* + * Notify runtime PM as well of this cpu powering down + * TODO: Merge CPU_PM and runtime PM. + */ + pm_runtime_put_sync(cpu_dev); + + /* * Pass idle state index to cpu_suspend which in turn will * call the CPU ops suspend protocol with idle index as a * parameter. */ arm_cpuidle_suspend(idx); + pm_runtime_get_sync(cpu_dev); cpu_pm_exit(); }