From patchwork Wed Oct 1 14:41:33 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 38244 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 BA26C202E7 for ; Wed, 1 Oct 2014 14:42:04 +0000 (UTC) Received: by mail-wi0-f200.google.com with SMTP id cc10sf913652wib.11 for ; Wed, 01 Oct 2014 07:42:03 -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=AsIWlxvHLQwjUJt+GZhXoEYYfIok+GJqX9XX0Y+2/nw=; b=iWFZbhQjvDZhR86jr3FiqnKkipwr939tOsjjIDw1m7dCN/QXsOgtfvtn/9tLFY028A WkVi2tlwh8VkNpc07kcVXmqwue0KiOZRFIHCfIIK/SYOPCUXE3589p2oQB64Jn9jGCy3 47lVTqUsezDmujm+nznbkR2tqVAuZqUty8hAk6AzZoZFkTJSSIJjUQHgb4X96LKe24/t 6gIeZRX1ujmhiFKR4vbKul1W4my9ySHtiZY0Udf6l4qQyklBc99AaR7RLyC48sluyflD SOo3T0n978ajO+nOxDjvHBSnxW5ye0idSzZVH/iLkCEaWos+fRT3AQGg+6Svu8xpxYsn 0WoA== X-Gm-Message-State: ALoCoQnmGShmlrjDUa5UsLHRkNBD66sOHmLZBvxRTT6RDMObNK/qfSqH3ojwPICWtOG69Be/I8ZK X-Received: by 10.112.162.138 with SMTP id ya10mr347643lbb.21.1412174523577; Wed, 01 Oct 2014 07:42:03 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.120.200 with SMTP id le8ls180435lab.101.gmail; Wed, 01 Oct 2014 07:42:03 -0700 (PDT) X-Received: by 10.152.45.1 with SMTP id i1mr5997817lam.56.1412174523440; Wed, 01 Oct 2014 07:42:03 -0700 (PDT) Received: from mail-la0-f48.google.com (mail-la0-f48.google.com [209.85.215.48]) by mx.google.com with ESMTPS id p12si2083864lal.32.2014.10.01.07.42.03 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 01 Oct 2014 07:42:03 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.48 as permitted sender) client-ip=209.85.215.48; Received: by mail-la0-f48.google.com with SMTP id gi9so490969lab.7 for ; Wed, 01 Oct 2014 07:42:03 -0700 (PDT) X-Received: by 10.152.45.1 with SMTP id i1mr5997803lam.56.1412174523326; Wed, 01 Oct 2014 07:42:03 -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 of9csp543888lbb; Wed, 1 Oct 2014 07:42:02 -0700 (PDT) X-Received: by 10.112.159.169 with SMTP id xd9mr52897435lbb.71.1412174522886; Wed, 01 Oct 2014 07:42:02 -0700 (PDT) Received: from mail-lb0-f174.google.com (mail-lb0-f174.google.com [209.85.217.174]) by mx.google.com with ESMTPS id vr4si1946872lbb.110.2014.10.01.07.42.02 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 01 Oct 2014 07:42:02 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.217.174 as permitted sender) client-ip=209.85.217.174; Received: by mail-lb0-f174.google.com with SMTP id p9so463376lbv.19 for ; Wed, 01 Oct 2014 07:42:02 -0700 (PDT) X-Received: by 10.112.134.101 with SMTP id pj5mr52360918lbb.47.1412174522781; Wed, 01 Oct 2014 07:42:02 -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.59 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 01 Oct 2014 07:42:01 -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 3/4] PM / Domains: Expect PM domains being powered at initialization Date: Wed, 1 Oct 2014 16:41:33 +0200 Message-Id: <1412174494-15346-4-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.48 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 the generic PM domain to the behavior above, by enforcing a PM domain to be powered at initialization. Previous patch changed the only call of pm_genpd_init() with "true" for the "is_off" parameter into "false". Thus all calls of pm_genpd_init() now uses "false" as the value for "is_off". To make it clear that genpd currently only supports powered PM domains at init, let's also remove the "is_off" parameter from the API. Signed-off-by: Ulf Hansson Acked-by: Geert Uytterhoeven Acked-by: Simon Horman --- arch/arm/mach-exynos/pm_domains.c | 2 +- arch/arm/mach-s3c64xx/pm.c | 4 ++-- arch/arm/mach-shmobile/pm-r8a7779.c | 2 +- arch/arm/mach-shmobile/pm-rmobile.c | 2 +- drivers/base/power/domain.c | 5 ++--- include/linux/pm_domain.h | 4 ++-- 6 files changed, 9 insertions(+), 10 deletions(-) diff --git a/arch/arm/mach-exynos/pm_domains.c b/arch/arm/mach-exynos/pm_domains.c index 58e18e9..f2e5096 100644 --- a/arch/arm/mach-exynos/pm_domains.c +++ b/arch/arm/mach-exynos/pm_domains.c @@ -158,7 +158,7 @@ no_clk: if (!(__raw_readl(pd->base + 0x4) & INT_LOCAL_PWR_EN)) exynos_pd_power_on(&pd->pd); - pm_genpd_init(&pd->pd, NULL, false); + pm_genpd_init(&pd->pd, NULL); of_genpd_add_provider_simple(np, &pd->pd); } diff --git a/arch/arm/mach-s3c64xx/pm.c b/arch/arm/mach-s3c64xx/pm.c index aaf7bea..42dead0 100644 --- a/arch/arm/mach-s3c64xx/pm.c +++ b/arch/arm/mach-s3c64xx/pm.c @@ -315,10 +315,10 @@ int __init s3c64xx_pm_init(void) for (i = 0; i < ARRAY_SIZE(s3c64xx_always_on_pm_domains); i++) pm_genpd_init(&s3c64xx_always_on_pm_domains[i]->pd, - &pm_domain_always_on_gov, false); + &pm_domain_always_on_gov); for (i = 0; i < ARRAY_SIZE(s3c64xx_pm_domains); i++) - pm_genpd_init(&s3c64xx_pm_domains[i]->pd, NULL, false); + pm_genpd_init(&s3c64xx_pm_domains[i]->pd, NULL); #ifdef CONFIG_S3C_DEV_FB if (dev_get_platdata(&s3c_device_fb.dev)) diff --git a/arch/arm/mach-shmobile/pm-r8a7779.c b/arch/arm/mach-shmobile/pm-r8a7779.c index 82fe3d7..c20ef44 100644 --- a/arch/arm/mach-shmobile/pm-r8a7779.c +++ b/arch/arm/mach-shmobile/pm-r8a7779.c @@ -83,7 +83,7 @@ static void r8a7779_init_pm_domain(struct r8a7779_pm_domain *r8a7779_pd) { struct generic_pm_domain *genpd = &r8a7779_pd->genpd; - pm_genpd_init(genpd, NULL, false); + pm_genpd_init(genpd, NULL); genpd->dev_ops.stop = pm_clk_suspend; genpd->dev_ops.start = pm_clk_resume; genpd->dev_ops.active_wakeup = pd_active_wakeup; diff --git a/arch/arm/mach-shmobile/pm-rmobile.c b/arch/arm/mach-shmobile/pm-rmobile.c index 818de2f..e6a0490 100644 --- a/arch/arm/mach-shmobile/pm-rmobile.c +++ b/arch/arm/mach-shmobile/pm-rmobile.c @@ -107,7 +107,7 @@ static void rmobile_init_pm_domain(struct rmobile_pm_domain *rmobile_pd) struct generic_pm_domain *genpd = &rmobile_pd->genpd; struct dev_power_governor *gov = rmobile_pd->gov; - pm_genpd_init(genpd, gov ? : &simple_qos_governor, false); + pm_genpd_init(genpd, gov ? : &simple_qos_governor); genpd->dev_ops.stop = pm_clk_suspend; genpd->dev_ops.start = pm_clk_resume; genpd->dev_ops.active_wakeup = rmobile_pd_active_wakeup; diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c index 36871b3..cfb76e8 100644 --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c @@ -1836,10 +1836,9 @@ static int pm_genpd_default_restore_state(struct device *dev) * pm_genpd_init - Initialize a generic I/O PM domain object. * @genpd: PM domain object to initialize. * @gov: PM domain governor to associate with the domain (may be NULL). - * @is_off: Initial value of the domain's power_is_off field. */ void pm_genpd_init(struct generic_pm_domain *genpd, - struct dev_power_governor *gov, bool is_off) + struct dev_power_governor *gov) { if (IS_ERR_OR_NULL(genpd)) return; @@ -1852,7 +1851,7 @@ void pm_genpd_init(struct generic_pm_domain *genpd, INIT_WORK(&genpd->power_off_work, genpd_power_off_work_fn); genpd->in_progress = 0; atomic_set(&genpd->sd_count, 0); - genpd->status = is_off ? GPD_STATE_POWER_OFF : GPD_STATE_ACTIVE; + genpd->status = GPD_STATE_ACTIVE; init_waitqueue_head(&genpd->status_wait_queue); genpd->poweroff_task = NULL; genpd->resume_count = 0; diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h index a21dfa9..ad4aa87 100644 --- a/include/linux/pm_domain.h +++ b/include/linux/pm_domain.h @@ -140,7 +140,7 @@ extern int pm_genpd_name_attach_cpuidle(const char *name, int state); extern int pm_genpd_detach_cpuidle(struct generic_pm_domain *genpd); extern int pm_genpd_name_detach_cpuidle(const char *name); extern void pm_genpd_init(struct generic_pm_domain *genpd, - struct dev_power_governor *gov, bool is_off); + struct dev_power_governor *gov); extern int pm_genpd_poweron(struct generic_pm_domain *genpd); extern int pm_genpd_name_poweron(const char *domain_name); @@ -206,7 +206,7 @@ static inline int pm_genpd_name_detach_cpuidle(const char *name) return -ENOSYS; } static inline void pm_genpd_init(struct generic_pm_domain *genpd, - struct dev_power_governor *gov, bool is_off) + struct dev_power_governor *gov) { } static inline int pm_genpd_poweron(struct generic_pm_domain *genpd)