From patchwork Sat Jun 27 03:02:30 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lina Iyer X-Patchwork-Id: 50393 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 565B6228FD for ; Sat, 27 Jun 2015 03:03:20 +0000 (UTC) Received: by wicnd19 with SMTP id nd19sf9719041wic.0 for ; Fri, 26 Jun 2015 20:03:19 -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=VsgZw6EdJWWBZIlfKXgKfm4s/T9r6oU5HVMAp56fAeY=; b=UqOcQtdSpVp5xIz8btM+yh27qfEs+5+n/rJ6urtxwpHKzV8nz1yil0X239mxPL/LZ+ FtMe9pYub9KUO6mMYfl+jIJs9TVQLX0ORuhKhIM0Kpcn0FudydC816RRSIch/oERdrak 5PvsKTak+OtLEV6ov8kECXRwGIDvXfrhs2gaZtQmp7oBUaH8lDf0ZMyMqfMWr0WVW7X0 50KfaiocnVFlBNfYn5Q377lopn1XEM+/H+zo/kVGf6NroAp4fhRUXBO9Y98LJQD/BLr+ tMknvGTPM4G8Tev/XnIAMDEMhCdAZI+paJNr7UE43yyaXPUcS5Cb0UftvMqgYeRs3Cg+ C9Qg== X-Gm-Message-State: ALoCoQn+tgguSX2suc/tUG/RgJV4NkL6zJGru9MudTcHkX2DhNX1bWuSaJAw28Ybbm6a+aB78+6Q X-Received: by 10.194.179.42 with SMTP id dd10mr3182102wjc.7.1435374199678; Fri, 26 Jun 2015 20:03:19 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.36.65 with SMTP id o1ls617917laj.108.gmail; Fri, 26 Jun 2015 20:03:19 -0700 (PDT) X-Received: by 10.112.234.200 with SMTP id ug8mr4259591lbc.117.1435374199384; Fri, 26 Jun 2015 20:03:19 -0700 (PDT) Received: from mail-la0-f52.google.com (mail-la0-f52.google.com. [209.85.215.52]) by mx.google.com with ESMTPS id ro2si28981935lbb.135.2015.06.26.20.03.19 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Jun 2015 20:03:19 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.52 as permitted sender) client-ip=209.85.215.52; Received: by lacny3 with SMTP id ny3so74386965lac.3 for ; Fri, 26 Jun 2015 20:03:18 -0700 (PDT) X-Received: by 10.112.160.165 with SMTP id xl5mr4340386lbb.36.1435374198933; Fri, 26 Jun 2015 20:03:18 -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.108.230 with SMTP id hn6csp295273lbb; Fri, 26 Jun 2015 20:03:17 -0700 (PDT) X-Received: by 10.70.109.136 with SMTP id hs8mr9176667pdb.161.1435374184437; Fri, 26 Jun 2015 20:03:04 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ay3si53186466pbc.54.2015.06.26.20.03.03; Fri, 26 Jun 2015 20:03:04 -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 S1752231AbbF0DDB (ORCPT + 11 others); Fri, 26 Jun 2015 23:03:01 -0400 Received: from mail-pd0-f170.google.com ([209.85.192.170]:34943 "EHLO mail-pd0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752290AbbF0DDA (ORCPT ); Fri, 26 Jun 2015 23:03:00 -0400 Received: by pdbci14 with SMTP id ci14so84810814pdb.2 for ; Fri, 26 Jun 2015 20:02:59 -0700 (PDT) X-Received: by 10.66.197.231 with SMTP id ix7mr9427116pac.9.1435374179841; Fri, 26 Jun 2015 20:02:59 -0700 (PDT) Received: from ubuntu.localdomain (c-24-8-37-141.hsd1.co.comcast.net. [24.8.37.141]) by mx.google.com with ESMTPSA id j7sm34787756pdp.83.2015.06.26.20.02.58 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 26 Jun 2015 20:02:59 -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, Lina Iyer Subject: [PATCH RFC v2 10/16] drivers: cpuidle: Add runtime PM support for CPUIdle Date: Fri, 26 Jun 2015 21:02:30 -0600 Message-Id: <1435374156-19214-11-git-send-email-lina.iyer@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1435374156-19214-1-git-send-email-lina.iyer@linaro.org> References: <1435374156-19214-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.52 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's PM domain. 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..77fd673 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 @@ -45,12 +47,20 @@ 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); + + /* + * 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(); } @@ -146,6 +156,7 @@ static int __init arm_idle_init(void) kfree(dev); goto out_fail; } + } return 0;