From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Ulf Hansson <ulf.hansson@linaro.org>
Cc: linux-mmc@vger.kernel.org, Russell King <linux@arm.linux.org.uk>,
Kevin Hilman <khilman@kernel.org>,
"Rafael J. Wysocki" <rjw@rjwysocki.net>,
Aaron Lu <aaron.lu@intel.com>
Subject: Re: [PATCH] mmc: core: Attach PM domain prior probing of SDIO func driver
Date: Mon, 1 Jun 2015 12:42:09 -0700 [thread overview]
Message-ID: <20150601194209.GB30024@dtor-ws> (raw)
In-Reply-To: <1433153905-25204-1-git-send-email-ulf.hansson@linaro.org>
Hi Ulf,
On Mon, Jun 01, 2015 at 12:18:25PM +0200, Ulf Hansson wrote:
> Other subsystem buses attach PM domains during probe, but prior calling
> the driver's ->probe() method. During the removal phase, detaching the PM
> domain will be done after invoking the driver's ->remove() callback.
>
> Convert the SDIO bus to follow this behavior and add error handling.
>
> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
> ---
>
> A similar patch as $subject patch has been posted and discussed earlier.
>
> According to Aaron Lu, who added the initial support for the ACPI PM domain to
> the SDIO bus, this change is safe.
> http://www.spinics.net/lists/linux-mmc/msg28946.html
>
> ---
> drivers/mmc/core/sdio_bus.c | 12 ++++++++----
> 1 file changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/mmc/core/sdio_bus.c b/drivers/mmc/core/sdio_bus.c
> index bee02e6..7e327a6 100644
> --- a/drivers/mmc/core/sdio_bus.c
> +++ b/drivers/mmc/core/sdio_bus.c
> @@ -137,6 +137,10 @@ static int sdio_bus_probe(struct device *dev)
> if (!id)
> return -ENODEV;
>
> + ret = dev_pm_domain_attach(dev, false);
> + if (ret == -EPROBE_DEFER)
> + return ret;
Why do we handle only -EPROBE_DEFER? What about other errors? Maybe
dev_pm_domain_attach() is too chatty?
> +
> /* Unbound SDIO functions are always suspended.
> * During probe, the function is set active and the usage count
> * is incremented. If the driver supports runtime PM,
> @@ -166,6 +170,7 @@ static int sdio_bus_probe(struct device *dev)
> disable_runtimepm:
> if (func->card->host->caps & MMC_CAP_POWER_OFF_CARD)
> pm_runtime_put_noidle(dev);
> + dev_pm_domain_detach(dev, false);
If dev_pm_domain_attach() returned -EEXIST (which means that someone
else attached the device to the domain) should we be detaching it?
I realize that the other buses do the same thing, so these questions are
general.
Thanks.
--
Dmitry
next prev parent reply other threads:[~2015-06-01 19:42 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-01 10:18 [PATCH] mmc: core: Attach PM domain prior probing of SDIO func driver Ulf Hansson
2015-06-01 19:42 ` Dmitry Torokhov [this message]
2015-06-02 7:54 ` Ulf Hansson
2015-06-02 8:51 ` Russell King - ARM Linux
2015-06-02 11:07 ` Russell King - ARM Linux
2015-06-02 13:18 ` Ulf Hansson
2015-06-02 15:06 ` Russell King - ARM Linux
2015-06-03 8:45 ` Ulf Hansson
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=20150601194209.GB30024@dtor-ws \
--to=dmitry.torokhov@gmail.com \
--cc=aaron.lu@intel.com \
--cc=khilman@kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=rjw@rjwysocki.net \
--cc=ulf.hansson@linaro.org \
/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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox