LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Ulf Hansson <ulf.hansson@linaro.org>
To: "Rafael J . Wysocki" <rjw@rjwysocki.net>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-pm@vger.kernel.org
Cc: Ulf Hansson <ulf.hansson@linaro.org>,
	Kevin Hilman <khilman@kernel.org>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	Viresh Kumar <viresh.kumar@linaro.org>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	Mark Brown <broonie@kernel.org>,
	Vinod Koul <vinod.koul@intel.com>,
	Sanyog Kale <sanyog.r.kale@intel.com>,
	Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>,
	Wolfram Sang <wsa@the-dreams.de>,
	Russell King <linux@armlinux.org.uk>,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: [PATCH 03/11] PM / Domains: Drop redundant code in genpd while attaching devices
Date: Thu, 26 Apr 2018 10:53:02 +0200	[thread overview]
Message-ID: <1524732790-2234-4-git-send-email-ulf.hansson@linaro.org> (raw)
In-Reply-To: <1524732790-2234-1-git-send-email-ulf.hansson@linaro.org>

The driver core together with the PM core, nowadays deals with deferring
all probes during the device system sleep phases. Therefore genpd no longer
need to care about this situation, so let's drop the corresponding code.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---
 drivers/base/power/domain.c | 17 ++---------------
 1 file changed, 2 insertions(+), 15 deletions(-)

diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
index d3703a1..d4b96ed 100644
--- a/drivers/base/power/domain.c
+++ b/drivers/base/power/domain.c
@@ -1377,7 +1377,7 @@ static int genpd_add_device(struct generic_pm_domain *genpd, struct device *dev,
 			    struct gpd_timing_data *td)
 {
 	struct generic_pm_domain_data *gpd_data;
-	int ret = 0;
+	int ret;
 
 	dev_dbg(dev, "%s()\n", __func__);
 
@@ -1390,11 +1390,6 @@ static int genpd_add_device(struct generic_pm_domain *genpd, struct device *dev,
 
 	genpd_lock(genpd);
 
-	if (genpd->prepared_count > 0) {
-		ret = -EAGAIN;
-		goto out;
-	}
-
 	ret = genpd->attach_dev ? genpd->attach_dev(genpd, dev) : 0;
 	if (ret)
 		goto out;
@@ -2194,7 +2189,6 @@ int genpd_dev_pm_attach(struct device *dev)
 {
 	struct of_phandle_args pd_args;
 	struct generic_pm_domain *pd;
-	unsigned int i;
 	int ret;
 
 	if (!dev->of_node)
@@ -2220,14 +2214,7 @@ int genpd_dev_pm_attach(struct device *dev)
 
 	dev_dbg(dev, "adding to PM domain %s\n", pd->name);
 
-	for (i = 1; i < GENPD_RETRY_MAX_MS; i <<= 1) {
-		ret = genpd_add_device(pd, dev, NULL);
-		if (ret != -EAGAIN)
-			break;
-
-		mdelay(i);
-		cond_resched();
-	}
+	ret = genpd_add_device(pd, dev, NULL);
 	mutex_unlock(&gpd_list_lock);
 
 	if (ret < 0) {
-- 
2.7.4

  parent reply	other threads:[~2018-04-26  8:53 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-26  8:52 [PATCH 00/11] PM / Domains: Fixup error paths with dev_pm_domain_attach() Ulf Hansson
2018-04-26  8:53 ` [PATCH 01/11] PM / Domains: Fix error path during attach in genpd Ulf Hansson
2018-04-26  8:53 ` [PATCH 02/11] PM / Domains: Drop comment in genpd about legacy Samsung DT binding Ulf Hansson
2018-04-26  8:53 ` Ulf Hansson [this message]
2018-04-26  8:53 ` [PATCH 04/11] PM / Domains: Check for existing PM domain in dev_pm_domain_attach() Ulf Hansson
2018-04-26  8:53 ` [PATCH 05/11] PM / Domains: Allow a better error handling of dev_pm_domain_attach() Ulf Hansson
2018-04-26  8:53 ` [PATCH 06/11] amba: Respect all error codes from dev_pm_domain_attach() Ulf Hansson
2018-04-26  8:53 ` [PATCH 07/11] driver core: " Ulf Hansson
2018-04-29 13:35   ` Greg Kroah-Hartman
2018-05-14 15:19   ` Tony Lindgren
2018-05-14 18:57     ` Ulf Hansson
2018-05-15  0:54       ` Tony Lindgren
2018-04-26  8:53 ` [PATCH 08/11] i2c: " Ulf Hansson
2018-04-26  9:03   ` Wolfram Sang
2018-04-26  8:53 ` [PATCH 09/11] mmc: sdio: " Ulf Hansson
2018-04-26  8:53 ` [PATCH 10/11] soundwire: " Ulf Hansson
2018-04-26  9:26   ` Vinod Koul
2018-04-26  8:53 ` [PATCH 11/11] spi: " Ulf Hansson
2018-04-26 11:39   ` Mark Brown
2018-05-02 12:31 ` [PATCH 00/11] PM / Domains: Fixup error paths with dev_pm_domain_attach() Ulf Hansson
2018-05-03  8:31   ` Rafael J. Wysocki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1524732790-2234-4-git-send-email-ulf.hansson@linaro.org \
    --to=ulf.hansson@linaro.org \
    --cc=broonie@kernel.org \
    --cc=geert+renesas@glider.be \
    --cc=gregkh@linuxfoundation.org \
    --cc=khilman@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=rjw@rjwysocki.net \
    --cc=sanyog.r.kale@intel.com \
    --cc=vincent.guittot@linaro.org \
    --cc=vinod.koul@intel.com \
    --cc=viresh.kumar@linaro.org \
    --cc=wsa@the-dreams.de \
    --subject='Re: [PATCH 03/11] PM / Domains: Drop redundant code in genpd while attaching devices' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).