public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH V2] mmc: mmci: Use pm_runtime_put_noidle() during ->probe()
@ 2014-12-19 10:54 Ulf Hansson
  2014-12-19 10:59 ` Russell King - ARM Linux
  0 siblings, 1 reply; 3+ messages in thread
From: Ulf Hansson @ 2014-12-19 10:54 UTC (permalink / raw)
  To: linux-mmc, Ulf Hansson, Chris Ball; +Cc: Russell King

Previously the pm_runtime_put() caused the device to be runtime PM
suspended, but then immediately being resumed when we add the host.

Prevent this unnecessary runtime PM suspend/resume cycle during
->probe() by using the pm_runtime_put_noidle() variant instead.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---

Changes in v2:
	Move pm_runtime_put_noidle() after mmc_add_host().

---
 drivers/mmc/host/mmci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
index 8232e9a..d2bbd25 100644
--- a/drivers/mmc/host/mmci.c
+++ b/drivers/mmc/host/mmci.c
@@ -1739,10 +1739,10 @@ static int mmci_probe(struct amba_device *dev,
 
 	pm_runtime_set_autosuspend_delay(&dev->dev, 50);
 	pm_runtime_use_autosuspend(&dev->dev);
-	pm_runtime_put(&dev->dev);
 
 	mmc_add_host(mmc);
 
+	pm_runtime_put_noidle(&dev->dev);
 	return 0;
 
  clk_disable:
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH V2] mmc: mmci: Use pm_runtime_put_noidle() during ->probe()
  2014-12-19 10:54 [PATCH V2] mmc: mmci: Use pm_runtime_put_noidle() during ->probe() Ulf Hansson
@ 2014-12-19 10:59 ` Russell King - ARM Linux
  2014-12-19 11:29   ` Ulf Hansson
  0 siblings, 1 reply; 3+ messages in thread
From: Russell King - ARM Linux @ 2014-12-19 10:59 UTC (permalink / raw)
  To: Ulf Hansson; +Cc: linux-mmc, Chris Ball

On Fri, Dec 19, 2014 at 11:54:19AM +0100, Ulf Hansson wrote:
> Previously the pm_runtime_put() caused the device to be runtime PM
> suspended, but then immediately being resumed when we add the host.
> 
> Prevent this unnecessary runtime PM suspend/resume cycle during
> ->probe() by using the pm_runtime_put_noidle() variant instead.
> 
> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
> ---
> 
> Changes in v2:
> 	Move pm_runtime_put_noidle() after mmc_add_host().
> 
> ---
>  drivers/mmc/host/mmci.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
> index 8232e9a..d2bbd25 100644
> --- a/drivers/mmc/host/mmci.c
> +++ b/drivers/mmc/host/mmci.c
> @@ -1739,10 +1739,10 @@ static int mmci_probe(struct amba_device *dev,
>  
>  	pm_runtime_set_autosuspend_delay(&dev->dev, 50);
>  	pm_runtime_use_autosuspend(&dev->dev);
> -	pm_runtime_put(&dev->dev);
>  
>  	mmc_add_host(mmc);
>  
> +	pm_runtime_put_noidle(&dev->dev);

I think you'd want this to be _put() in this case.

-- 
FTTC broadband for 0.8mile line: currently at 9.5Mbps down 400kbps up
according to speedtest.net.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH V2] mmc: mmci: Use pm_runtime_put_noidle() during ->probe()
  2014-12-19 10:59 ` Russell King - ARM Linux
@ 2014-12-19 11:29   ` Ulf Hansson
  0 siblings, 0 replies; 3+ messages in thread
From: Ulf Hansson @ 2014-12-19 11:29 UTC (permalink / raw)
  To: Russell King - ARM Linux; +Cc: linux-mmc, Chris Ball

On 19 December 2014 at 11:59, Russell King - ARM Linux
<linux@arm.linux.org.uk> wrote:
> On Fri, Dec 19, 2014 at 11:54:19AM +0100, Ulf Hansson wrote:
>> Previously the pm_runtime_put() caused the device to be runtime PM
>> suspended, but then immediately being resumed when we add the host.
>>
>> Prevent this unnecessary runtime PM suspend/resume cycle during
>> ->probe() by using the pm_runtime_put_noidle() variant instead.
>>
>> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
>> ---
>>
>> Changes in v2:
>>       Move pm_runtime_put_noidle() after mmc_add_host().
>>
>> ---
>>  drivers/mmc/host/mmci.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
>> index 8232e9a..d2bbd25 100644
>> --- a/drivers/mmc/host/mmci.c
>> +++ b/drivers/mmc/host/mmci.c
>> @@ -1739,10 +1739,10 @@ static int mmci_probe(struct amba_device *dev,
>>
>>       pm_runtime_set_autosuspend_delay(&dev->dev, 50);
>>       pm_runtime_use_autosuspend(&dev->dev);
>> -     pm_runtime_put(&dev->dev);
>>
>>       mmc_add_host(mmc);
>>
>> +     pm_runtime_put_noidle(&dev->dev);
>
> I think you'd want this to be _put() in this case.

It doesn't matter which variant of _put*(). The driver core will
invoke pm_request_idle() after really_probe() is done.

Kind regards
Uffe

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-12-19 11:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-19 10:54 [PATCH V2] mmc: mmci: Use pm_runtime_put_noidle() during ->probe() Ulf Hansson
2014-12-19 10:59 ` Russell King - ARM Linux
2014-12-19 11:29   ` Ulf Hansson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox