From patchwork Mon Sep 15 10:13:50 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 4904031 Return-Path: X-Original-To: patchwork-dmaengine@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 35E9B9F350 for ; Mon, 15 Sep 2014 10:11:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 359C22017D for ; Mon, 15 Sep 2014 10:14:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 88B3E2016C for ; Mon, 15 Sep 2014 10:14:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753769AbaIOKOk (ORCPT ); Mon, 15 Sep 2014 06:14:40 -0400 Received: from mailout4.w1.samsung.com ([210.118.77.14]:62688 "EHLO mailout4.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753737AbaIOKOi (ORCPT ); Mon, 15 Sep 2014 06:14:38 -0400 Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout4.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NBX00BYGTX0AQ90@mailout4.w1.samsung.com>; Mon, 15 Sep 2014 11:17:24 +0100 (BST) X-AuditID: cbfec7f4-b7f156d0000063c7-d0-5416bc0c7b62 Received: from eusync2.samsung.com ( [203.254.199.212]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id 1A.F3.25543.C0CB6145; Mon, 15 Sep 2014 11:14:36 +0100 (BST) Received: from AMDC1943.digital.local ([106.116.151.171]) by eusync2.samsung.com (Oracle Communications Messaging Server 7u4-23.01(7.0.4.23.0) 64bit (built Aug 10 2011)) with ESMTPA id <0NBX000N9TS7T610@eusync2.samsung.com>; Mon, 15 Sep 2014 11:14:36 +0100 (BST) From: Krzysztof Kozlowski To: Russell King , Dan Williams , Vinod Koul , linux-kernel@vger.kernel.org, dmaengine@vger.kernel.org, Ulf Hansson , Grant Likely , Lars-Peter Clausen , Michal Simek , linux-pm@vger.kernel.org Cc: Kyungmin Park , Marek Szyprowski , Bartlomiej Zolnierkiewicz , Krzysztof Kozlowski Subject: [PATCH v3 1/4] PM / Runtime: Add getter for quering the IRQ safe option Date: Mon, 15 Sep 2014 12:13:50 +0200 Message-id: <1410776033-22156-2-git-send-email-k.kozlowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1410776033-22156-1-git-send-email-k.kozlowski@samsung.com> References: <1410776033-22156-1-git-send-email-k.kozlowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrALMWRmVeSWpSXmKPExsVy+t/xK7o8e8RCDF7+k7LYOGM9q8X0qRcY LVZP/ctqceDPDkaL1y8MLc42vWG3WDJ5PqvF5V1z2Cw+9x5htLh9mddi7ZG77BbvXkZYHF8b bvGybz+LA59HS3MPm8fiPS+ZPO5c28PmseTNIVaPvi2rGD0+b5Lz2Pv5N0sAexSXTUpqTmZZ apG+XQJXxrOG62wF27gr3h29x9TAeJ6zi5GTQ0LARGLn1y52CFtM4sK99WxdjFwcQgJLGSW+ 733NDOH0MUk8vvOIGaSKTcBYYvPyJWBVIgLvmCRubT/FAuIwCxxllJje+5api5GDQ1ggQGLH EROQBhYBVYlNaw6BNfMKuEtc+XoOap2cxMljk1lBbE4BD4ltbxvA4kJANZ+evGScwMi7gJFh FaNoamlyQXFSeq6hXnFibnFpXrpecn7uJkZIqH7Zwbj4mNUhRgEORiUeXoYrwiFCrIllxZW5 hxglOJiVRHinbhULEeJNSaysSi3Kjy8qzUktPsTIxMEp1cAYz/Uzjs90F5Ozst8Gn2gTr3k3 Z74scdupc0bI2vPOduWtEjwKnSXLj5VKra99YJ2+zzw9SXKdVmP2oTb/6evnellmT9zGIReV H7NJ+NTcuH8Hwh9W3QkWYKjgTuy3+czNwbZj9VXfgwfmW19IzpJZphWa/Ji/ZUKeTWR1cz5n +GK1qxxv7iuxFGckGmoxFxUnAgBZLhr9MwIAAA== Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 Add a simple getter pm_runtime_is_irq_safe() for quering whether runtime PM IRQ safe was set or not. Various bus drivers implementing runtime PM may use choose to suspend differently based on IRQ safeness status of child driver (e.g. do not unprepare the clock if IRQ safe is not set). Signed-off-by: Krzysztof Kozlowski --- include/linux/pm_runtime.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h index 367f49b9a1c9..44d74f0f182e 100644 --- a/include/linux/pm_runtime.h +++ b/include/linux/pm_runtime.h @@ -128,6 +128,11 @@ static inline void pm_runtime_mark_last_busy(struct device *dev) ACCESS_ONCE(dev->power.last_busy) = jiffies; } +static inline bool pm_runtime_is_irq_safe(struct device *dev) +{ + return dev->power.irq_safe; +} + #else /* !CONFIG_PM_RUNTIME */ static inline int __pm_runtime_idle(struct device *dev, int rpmflags) @@ -167,6 +172,7 @@ static inline bool pm_runtime_enabled(struct device *dev) { return false; } static inline void pm_runtime_no_callbacks(struct device *dev) {} static inline void pm_runtime_irq_safe(struct device *dev) {} +static inline bool pm_runtime_is_irq_safe(struct device *dev) { return false; } static inline bool pm_runtime_callbacks_present(struct device *dev) { return false; } static inline void pm_runtime_mark_last_busy(struct device *dev) {}