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: 6684601 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id A83C0C05AC for ; Sat, 27 Jun 2015 03:08:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6A899204E4 for ; Sat, 27 Jun 2015 03:08:12 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7D660204E0 for ; Sat, 27 Jun 2015 03:08:11 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Z8gQv-0000Y1-HL; Sat, 27 Jun 2015 03:05:33 +0000 Received: from mail-pd0-f182.google.com ([209.85.192.182]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Z8gOk-0006vw-4d for linux-arm-kernel@lists.infradead.org; Sat, 27 Jun 2015 03:03:19 +0000 Received: by pdbci14 with SMTP id ci14so84810815pdb.2 for ; Fri, 26 Jun 2015 20:02:59 -0700 (PDT) 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=R5qk6XjDpUPsp3bewa9SMP3ELWDMlD2pEtDOjwZhs1A=; b=c1h1CJOHMcqOCtEVTBD+XfAwkC7OeMCbzqsaS2k0K5zJEfuWPRbiKgWu6DGZWFPwIv YwrZ/O5QMCrPku6CdvnqjB8d41mcya52JmncA/35XUk/XwpiQnx2Zy3j3PSOBGHjRTpB TEvTPhgaEukXaanA4MiK9rTZcDX1Yyci2JNk7OAYUtZ50ufks32YL1U00PwLAe+eoM5q 7i9gbIBrbg6RMfWQY4oF5Y4wN/7CA3w8vGwBl/AnWlIsTgMQBV0aLGSQmxOjVEz432Fw xV/zPef5DyOL9/umgCWUbshN86AiRJLZhqcbbUY+ZQQarZnaijJ0M3a0FPmkwL44JAZ1 E7qQ== X-Gm-Message-State: ALoCoQlgWnOFB47HaXnInivfcCKeyQPzmqd6T/Mn51qUPqKtxIx2MTlnpg90GxjN6x3u7id9M4fK 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150626_200318_243646_F7B428CF X-CRM114-Status: GOOD ( 13.22 ) X-Spam-Score: -2.6 (--) Cc: k.kozlowski@samsung.com, linux-pm@vger.kernel.org, msivasub@codeaurora.org, geert@linux-m68k.org, Lina Iyer , agross@codeaurora.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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'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;