From patchwork Wed Oct 1 14:41:32 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 5012211 Return-Path: X-Original-To: patchwork-linux-samsung-soc@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 725BA9F327 for ; Wed, 1 Oct 2014 14:42:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8E64120263 for ; Wed, 1 Oct 2014 14:42:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7A74F20279 for ; Wed, 1 Oct 2014 14:42:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751634AbaJAOmC (ORCPT ); Wed, 1 Oct 2014 10:42:02 -0400 Received: from mail-lb0-f179.google.com ([209.85.217.179]:42549 "EHLO mail-lb0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752107AbaJAOmB (ORCPT ); Wed, 1 Oct 2014 10:42:01 -0400 Received: by mail-lb0-f179.google.com with SMTP id l4so450352lbv.24 for ; Wed, 01 Oct 2014 07:41: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=kitSgwIE5UQC83MAOHLw04vv4M9EGCDIjrtTCngudkI=; b=c2YiLMSAQEkI+0mkJiwRwwpvbkxFZI11xEVUoxYlIiiNor3fAEOuDcBkACssp3BFWU +G0z9VDnsv13ZtLey/vNWRIkOnN2phUIFfIozgC2FVwX6aumBYzGbh576DiBJZghv2Sk lvZKfhhfwjmg+HLTX7GCRSpojNp4Rn6+yAGadEbREGq9XispY9I14lDPJCYkOkgVvPpO 8dLKoXtpFGmQCpbAcWIXne8yclkD9rhB7x4s+XpUhgww5KE4Jz5A3hTrAJkYooi2ueJq 3aKyCwnvvH0KNw/p1y/d2IFyyFuAEhiavwiPM1bu2M78EzXTnbtYn6L0fz6ju6AX5ptY qUgw== X-Gm-Message-State: ALoCoQnvz42lq/SdEXL0HCDMp95ewAEH4HCWCghEUaSkSBEKE4hg3+PPNnNX2Yu3BHK+H6+dyKC3 X-Received: by 10.112.171.229 with SMTP id ax5mr45341186lbc.25.1412174519616; Wed, 01 Oct 2014 07:41:59 -0700 (PDT) Received: from uffe-Latitude-E6430s.lan (90-231-160-185-no158.tbcn.telia.com. [90.231.160.185]) by mx.google.com with ESMTPSA id rl6sm485466lac.17.2014.10.01.07.41.56 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 01 Oct 2014 07:41:58 -0700 (PDT) From: Ulf Hansson To: "Rafael J. Wysocki" , Len Brown , Pavel Machek , linux-pm@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, Geert Uytterhoeven , Kevin Hilman , Alan Stern , Greg Kroah-Hartman , Tomasz Figa , Simon Horman , Magnus Damm , Ben Dooks , Kukjin Kim , Philipp Zabel , Mark Brown , Wolfram Sang , Russell King , Dmitry Torokhov , Jack Dai , Jinkun Hong , Ulf Hansson Subject: [PATCH v2 2/4] ARM: exynos: Ensure PM domains are powered at initialization Date: Wed, 1 Oct 2014 16:41:32 +0200 Message-Id: <1412174494-15346-3-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1412174494-15346-1-git-send-email-ulf.hansson@linaro.org> References: <1412174494-15346-1-git-send-email-ulf.hansson@linaro.org> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 At ->probe() it's common practice for drivers/subsystems to bring their devices to full power and without depending on CONFIG_PM_RUNTIME. We could also expect that drivers/subsystems requires their device's corresponding PM domains to be powered, to successfully complete a ->probe() sequence. Align to the behavior above, by ensuring all PM domains are powered prior initialization of a generic PM domain. Do note, since the generic PM domain will try to power off unused PM domains at late_init, there should be no increased power consumption over time, but potentially during boot. Signed-off-by: Ulf Hansson --- arch/arm/mach-exynos/pm_domains.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/arch/arm/mach-exynos/pm_domains.c b/arch/arm/mach-exynos/pm_domains.c index 20f2671..58e18e9 100644 --- a/arch/arm/mach-exynos/pm_domains.c +++ b/arch/arm/mach-exynos/pm_domains.c @@ -112,7 +112,7 @@ static __init int exynos4_pm_init_power_domain(void) for_each_compatible_node(np, NULL, "samsung,exynos4210-pd") { struct exynos_pm_domain *pd; - int on, i; + int i; struct device *dev; pdev = of_find_device_by_node(np); @@ -155,9 +155,10 @@ static __init int exynos4_pm_init_power_domain(void) clk_put(pd->oscclk); no_clk: - on = __raw_readl(pd->base + 0x4) & INT_LOCAL_PWR_EN; + if (!(__raw_readl(pd->base + 0x4) & INT_LOCAL_PWR_EN)) + exynos_pd_power_on(&pd->pd); - pm_genpd_init(&pd->pd, NULL, !on); + pm_genpd_init(&pd->pd, NULL, false); of_genpd_add_provider_simple(np, &pd->pd); }