From patchwork Thu Apr 23 08:45:39 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rajendra Nayak X-Patchwork-Id: 6260751 Return-Path: X-Original-To: patchwork-linux-arm-msm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B39759F1BE for ; Thu, 23 Apr 2015 08:46:04 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CB1B3203AB for ; Thu, 23 Apr 2015 08:46:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D325520383 for ; Thu, 23 Apr 2015 08:46:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752483AbbDWIqA (ORCPT ); Thu, 23 Apr 2015 04:46:00 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:46788 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752412AbbDWIp7 (ORCPT ); Thu, 23 Apr 2015 04:45:59 -0400 Received: from smtp.codeaurora.org (localhost [127.0.0.1]) by smtp.codeaurora.org (Postfix) with ESMTP id E48EE1403BE; Thu, 23 Apr 2015 08:45:58 +0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 486) id D3B021406FB; Thu, 23 Apr 2015 08:45:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from blr-ubuntu-34.ap.qualcomm.com (unknown [202.46.23.61]) (using TLSv1.1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: rnayak@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 8BDC51403BE; Thu, 23 Apr 2015 08:45:56 +0000 (UTC) From: Rajendra Nayak To: linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org Cc: Rajendra Nayak Subject: [RFC/RFT 1/6] PM / clock_ops: Make pm_clk_notify() do nothing in case DT passes power-domains Date: Thu, 23 Apr 2015 14:15:39 +0530 Message-Id: <1429778744-13352-2-git-send-email-rnayak@codeaurora.org> X-Mailer: git-send-email 1.8.2.1 In-Reply-To: <1429778744-13352-1-git-send-email-rnayak@codeaurora.org> References: <1429778744-13352-1-git-send-email-rnayak@codeaurora.org> X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP pm_clk_notify() intends to do nothing if the device is associated with a pm_domain other than whats stored in pm_clk_notifier_block. In case of DT though, just checking for an existing dev->pm_domain is not very useful as dev->pm_domain actually gets populated much later. Add a check for a 'power-domains' DT property to identify if the device would be assocaiated with a different power domain at a later point in time. Signed-off-by: Rajendra Nayak --- drivers/base/power/clock_ops.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/base/power/clock_ops.c b/drivers/base/power/clock_ops.c index 8abea66..6618818 100644 --- a/drivers/base/power/clock_ops.c +++ b/drivers/base/power/clock_ops.c @@ -16,6 +16,7 @@ #include #include #include +#include #ifdef CONFIG_PM @@ -323,6 +324,7 @@ int pm_clk_resume(struct device *dev) * of PM clocks, depending on @action. * * If the device's pm_domain field is already populated with a value different + * or is expected to be populated with a different value later (in case of DT) * from the one stored in the struct pm_clk_notifier_block object, the function * does nothing. */ @@ -332,7 +334,7 @@ static int pm_clk_notify(struct notifier_block *nb, struct pm_clk_notifier_block *clknb; struct device *dev = data; char **con_id; - int error; + int error, sz; dev_dbg(dev, "%s() %ld\n", __func__, action); @@ -343,6 +345,10 @@ static int pm_clk_notify(struct notifier_block *nb, if (dev->pm_domain) break; + /* With DT dev->pm_domain hookup happens later */ + if (of_find_property(dev->of_node, "power-domains", &sz)) + break; + error = pm_clk_create(dev); if (error) break;