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: 38243 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 273A6202E7 for ; Wed, 1 Oct 2014 14:42:03 +0000 (UTC) Received: by mail-wi0-f200.google.com with SMTP id cc10sf900805wib.3 for ; Wed, 01 Oct 2014 07:42:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=kitSgwIE5UQC83MAOHLw04vv4M9EGCDIjrtTCngudkI=; b=lTk+8fqY0/9uvQjU3um6SmNaKXEKKlSJBJ44lws8tx58qy5odSTEET4JREQlYi1g4v Z5PtfmiS/xGAGbqveVAR3WwIMAKU5kwcd65ys+u0PHriiVKebhz31xlfYTd/nc6jp3aS /OqzTScrG5OssId76uX2qR1tuD7X/U+J5+VLChJejzDGfX5K1OnO7BOzNdmY4p/Iwsz2 0HZom5kiAExloZvMPONlr/8HipN40IsYa1UovmINRqVLegvnls0w2j4yHjLZd2MBk0Hd el7rfp16xi2wNUEGHsyC/nckS04tziaZacEQHI2RkzGL7793BnDSrY90FXLerkbaEbAI 4FXw== X-Gm-Message-State: ALoCoQlDsttiMkBAiiUSJaBzad10si8ha4Dzr7CEm64CWcQE7CV1ufwrRPE4RMdJxHolG4DcDOGu X-Received: by 10.152.26.225 with SMTP id o1mr3736399lag.4.1412174520564; Wed, 01 Oct 2014 07:42:00 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.170.225 with SMTP id ap1ls149554lac.57.gmail; Wed, 01 Oct 2014 07:42:00 -0700 (PDT) X-Received: by 10.152.7.145 with SMTP id j17mr55318143laa.77.1412174520430; Wed, 01 Oct 2014 07:42:00 -0700 (PDT) Received: from mail-la0-f51.google.com (mail-la0-f51.google.com [209.85.215.51]) by mx.google.com with ESMTPS id is3si2120351lac.11.2014.10.01.07.42.00 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 01 Oct 2014 07:42:00 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.51 as permitted sender) client-ip=209.85.215.51; Received: by mail-la0-f51.google.com with SMTP id ge10so470337lab.24 for ; Wed, 01 Oct 2014 07:42:00 -0700 (PDT) X-Received: by 10.153.6.36 with SMTP id cr4mr21475654lad.40.1412174520327; Wed, 01 Oct 2014 07:42:00 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.112.130.169 with SMTP id of9csp543881lbb; Wed, 1 Oct 2014 07:42:00 -0700 (PDT) X-Received: by 10.112.185.103 with SMTP id fb7mr12085581lbc.32.1412174519948; Wed, 01 Oct 2014 07:41:59 -0700 (PDT) Received: from mail-la0-f50.google.com (mail-la0-f50.google.com [209.85.215.50]) by mx.google.com with ESMTPS id w8si2127338law.7.2014.10.01.07.41.59 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 01 Oct 2014 07:41:59 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.215.50 as permitted sender) client-ip=209.85.215.50; Received: by mail-la0-f50.google.com with SMTP id s18so499073lam.9 for ; Wed, 01 Oct 2014 07:41:59 -0700 (PDT) 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> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ulf.hansson@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.51 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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); }