From patchwork Mon Feb 9 11:02:05 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Kachhap X-Patchwork-Id: 5800861 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 33544BF440 for ; Mon, 9 Feb 2015 11:06:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AE94820121 for ; Mon, 9 Feb 2015 11:06:30 +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 E77C220120 for ; Mon, 9 Feb 2015 11:06:29 +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 1YKm7z-0001Df-6x; Mon, 09 Feb 2015 11:03:43 +0000 Received: from mailout3.samsung.com ([203.254.224.33]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YKm4K-00069W-3I for linux-arm-kernel@lists.infradead.org; Mon, 09 Feb 2015 10:59:57 +0000 Received: from epcpsbgr4.samsung.com (u144.gpu120.samsung.co.kr [203.254.230.144]) by mailout3.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NJI002993V983E0@mailout3.samsung.com> for linux-arm-kernel@lists.infradead.org; Mon, 09 Feb 2015 19:59:33 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [172.20.52.122]) by epcpsbgr4.samsung.com (EPCPMTA) with SMTP id 4F.B5.18167.51398D45; Mon, 09 Feb 2015 19:59:33 +0900 (KST) X-AuditID: cbfee690-f79ab6d0000046f7-c5-54d89315e6e2 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 21.FF.20081.51398D45; Mon, 09 Feb 2015 19:59:33 +0900 (KST) Received: from chromebld-server.sisodomain.com ([107.108.73.106]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0NJI00CJM3R5TO30@mmp1.samsung.com>; Mon, 09 Feb 2015 19:59:33 +0900 (KST) From: Amit Daniel Kachhap To: linux-pm@vger.kernel.org Subject: [PATCH RFC v4 2/3] PM / Domains: Save restore slave pm runtime devices Date: Mon, 09 Feb 2015 16:32:05 +0530 Message-id: <1423479726-23140-3-git-send-email-amit.daniel@samsung.com> X-Mailer: git-send-email 2.2.0 In-reply-to: <1423479726-23140-1-git-send-email-amit.daniel@samsung.com> References: <1423479726-23140-1-git-send-email-amit.daniel@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprCIsWRmVeSWpSXmKPExsWyRsSkSld08o0Qg95uZYuGqyEWc2dPYrTo XXCVzeLr4RWMFrOm7GWy2PT4GqvF5V1z2Cw+9x5htJhxfh+Txdojd9ktFm39wm5x5vQlVovD b9pZLTqWMVqs2vWH0eL42nAHAY+JZ3U9ds66y+6xeM9LJo871/aweWxeUu+x5Wo7i0ffllWM Hp83yQVwRHHZpKTmZJalFunbJXBlrD38iq1gr0DFoz+n2RsY9/F2MXJySAiYSPzsucIGYYtJ XLi3Hsjm4hASWMooMfHkSlaYor0t85khEosYJa6tXMAK4Uxgkjjb+YgFpIpNwFji58797CC2 iICMxNQr+8GKmAUWMEscnbQYrEhYwF/i8bQXYEUsAqoSN3qPgdm8Au4S30//YoRYJyex5dYj sDingIfEjNNtYLYQUE3HqQWMIEMlBN6yS0zdv5kVYpCAxLfJh4AWcAAlZCU2HWCGmCMpcXDF DZYJjMILGBlWMYqmFiQXFCelF5no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8yrZt4UICaQnlqRmp6YW pBbB9DFxcEo1ME5VVJ/xT1FgxtppJzZNL6iwXXjsvVpR88Ev1V+mGx3n+Ox7s2mNp871nsPG L64uLH6ivyOs20zl68c53Pffvjbe6yr2fEH3irKVh/0ftjXqbFz6K0qgn0X5U43TvLfzr0iv nvjF7o2OlMSjpm9Pc8rPmq2cLXNChtW6z+aHll/1pIj4+bwn5uopsRRnJBpqMRcVJwIAedP+ ZPECAAA= DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150209_025956_402011_6F33C71D X-CRM114-Status: GOOD ( 11.07 ) X-Spam-Score: -5.0 (-----) Cc: len.brown@intel.com, ulf.hansson@linaro.org, khilman@linaro.org, geert+renesas@glider.be, pankaj.dubey@samsung.com, rjw@rjwysocki.net, linux-kernel@vger.kernel.org, tomasz.figa@gmail.com, Amit Daniel Kachhap , linux-samsung-soc@vger.kernel.org, thomas.ab@samsung.com, s.nawrocki@samsung.com, kgene.kim@samsung.com, linux-arm-kernel@lists.infradead.org, m.szyprowski@samsung.com 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=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_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 Based on the runtime request of the active device, the callbacks of the passive pm runtime devices will be invoked. Signed-off-by: Amit Daniel Kachhap --- drivers/base/power/domain.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c index c5280f2..160e74a 100644 --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c @@ -49,6 +49,7 @@ static LIST_HEAD(gpd_list); static DEFINE_MUTEX(gpd_list_lock); +static void __pm_genpd_restore_devices(struct generic_pm_domain *genpd); static struct generic_pm_domain *pm_genpd_lookup_name(const char *domain_name) { @@ -176,6 +177,8 @@ static int genpd_power_on(struct generic_pm_domain *genpd) pr_warn("%s: Power-%s latency exceeded, new value %lld ns\n", genpd->name, "on", elapsed_ns); + __pm_genpd_restore_devices(genpd); + return ret; } @@ -397,6 +400,9 @@ static int __pm_genpd_save_device(struct pm_domain_data *pdd, struct device *dev = pdd->dev; int ret = 0; + if (dev->power.slave == true) + gpd_data->need_restore = 0; + if (gpd_data->need_restore > 0) return 0; @@ -453,6 +459,28 @@ static void __pm_genpd_restore_device(struct pm_domain_data *pdd, } /** + * __pm_genpd_restore_devices- Restore the pre-suspend state of all device + * according to the restore flag. + * @genpd: PM domain the device belongs to. + */ +static void __pm_genpd_restore_devices(struct generic_pm_domain *genpd) +{ + struct pm_domain_data *pdd; + struct generic_pm_domain_data *gpd_data; + struct device *dev; + + /* Force restore the devices according to the restore flag */ + list_for_each_entry(pdd, &genpd->dev_list, list_node) { + dev = pdd->dev; + gpd_data = to_gpd_data(pdd); + if (dev->power.slave == true) { + gpd_data->need_restore = 1; + __pm_genpd_restore_device(pdd, genpd); + } + } +} + +/** * genpd_abort_poweroff - Check if a PM domain power off should be aborted. * @genpd: PM domain to check. *