From patchwork Thu Sep 3 19:58:32 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lina Iyer X-Patchwork-Id: 53057 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f72.google.com (mail-la0-f72.google.com [209.85.215.72]) by patches.linaro.org (Postfix) with ESMTPS id 372DF22E23 for ; Thu, 3 Sep 2015 19:59:01 +0000 (UTC) Received: by laeb10 with SMTP id b10sf107262lae.1 for ; Thu, 03 Sep 2015 12:59:00 -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=KNJXTuby5kHSQRpDTj1+iQGBi6YdJioEzJ839BZ0cus=; b=YNRbSfyODDTN7cf+XloRyfU5H8VGKnknJMVkfPwNNTLE6lBbLEh+BdAQ9eBcXjx6Y9 AV+Ign2YgES9xAJfDNoHZfvWivHbaLc8lf1Sru4vAnI3ql7mRevY0eKCKYEE1bqhxWFk zA/znuh5EGHkjTNWie/s1+aRxWIpuHSW6ftNoPm4l9kgItAiKaSGy2fIG7ozr33GDNys nvW7blxmJn5XxAMMTvQsKmtJ9Wcw8CIbIQNdzKP5vep1WesAKGucny7jVbno0CoFjC3v f8IlMbTA5GR5Zn4qhZ/U1BHyc60qYH1A5PTUe2c8WsJSb+paDrYiXbOE0U6lHCFWEyhR uwPg== X-Gm-Message-State: ALoCoQlSFTvGIhckR1mtlwj9FG6oK5ZGr1lOJl+dOUVWshZIx3/CmpH01OjZlypkG43ROfg0TAeW X-Received: by 10.194.76.6 with SMTP id g6mr5236046wjw.1.1441310340083; Thu, 03 Sep 2015 12:59:00 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.153.8.171 with SMTP id dl11ls209661lad.28.gmail; Thu, 03 Sep 2015 12:58:59 -0700 (PDT) X-Received: by 10.112.204.162 with SMTP id kz2mr23477311lbc.115.1441310339919; Thu, 03 Sep 2015 12:58:59 -0700 (PDT) Received: from mail-la0-f42.google.com (mail-la0-f42.google.com. [209.85.215.42]) by mx.google.com with ESMTPS id tn10si24128723lbb.38.2015.09.03.12.58.59 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 03 Sep 2015 12:58:59 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.42 as permitted sender) client-ip=209.85.215.42; Received: by lagj9 with SMTP id j9so204700lag.2 for ; Thu, 03 Sep 2015 12:58:59 -0700 (PDT) X-Received: by 10.112.131.98 with SMTP id ol2mr23731071lbb.56.1441310339785; Thu, 03 Sep 2015 12:58:59 -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.164.42 with SMTP id yn10csp1491277lbb; Thu, 3 Sep 2015 12:58:58 -0700 (PDT) X-Received: by 10.60.41.66 with SMTP id d2mr21052268oel.65.1441310336259; Thu, 03 Sep 2015 12:58:56 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id hn3si43263170pdb.66.2015.09.03.12.58.55; Thu, 03 Sep 2015 12:58:56 -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 S1757448AbbICT6y (ORCPT + 13 others); Thu, 3 Sep 2015 15:58:54 -0400 Received: from mail-pa0-f47.google.com ([209.85.220.47]:36741 "EHLO mail-pa0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754905AbbICT6y (ORCPT ); Thu, 3 Sep 2015 15:58:54 -0400 Received: by pacwi10 with SMTP id wi10so210446pac.3 for ; Thu, 03 Sep 2015 12:58:53 -0700 (PDT) X-Received: by 10.68.231.5 with SMTP id tc5mr72690992pbc.54.1441310333746; Thu, 03 Sep 2015 12:58:53 -0700 (PDT) Received: from ubuntu.localdomain (i-global254.qualcomm.com. [199.106.103.254]) by smtp.gmail.com with ESMTPSA id a17sm13396430pbu.55.2015.09.03.12.58.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 03 Sep 2015 12:58:52 -0700 (PDT) From: Lina Iyer To: ulf.hansson@linaro.org, khilman@linaro.org, linux-pm@vger.kernel.org Cc: rjw@rjwysocki.net, geert@linux-m68k.org, k.kozlowski@samsung.com, linux-arm-kernel@lists.infradead.org, msivasub@codeaurora.org, agross@codeaurora.org, sboyd@codeaurora.org, Lina Iyer , Daniel Lezcano , Lorenzo Pieralisi Subject: [PATCH v2 5/7] ARM: cpuidle: Add runtime PM support for CPU idle Date: Thu, 3 Sep 2015 13:58:32 -0600 Message-Id: <1441310314-8857-6-git-send-email-lina.iyer@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1441310314-8857-1-git-send-email-lina.iyer@linaro.org> References: <1441310314-8857-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.215.42 as permitted sender) smtp.mailfrom=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 | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/cpuidle/cpuidle-arm.c b/drivers/cpuidle/cpuidle-arm.c index 545069d..7c791f9 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 @@ -37,6 +40,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 +50,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. + */ + RCU_NONIDLE(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); + RCU_NONIDLE(pm_runtime_get_sync(cpu_dev)); cpu_pm_exit(); }