lkml.org 
[lkml]   [2015]   [Nov]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v2] mmc: sdhci at91: add PM support
From
On 26 November 2015 at 17:07, Ludovic Desroches
<ludovic.desroches@atmel.com> wrote:
> On Tue, Nov 10, 2015 at 12:12:30PM +0100, Ulf Hansson wrote:
>> On 10 November 2015 at 11:36, Ludovic Desroches
>> <ludovic.desroches@atmel.com> wrote:
>> > Add runtime PM support and use runtime_force_suspend|resume() for system
>> > PM.
>> >
>
> [...]
>
>> > static int sdhci_at91_probe(struct platform_device *pdev)
>> > {
>> > const struct of_device_id *match;
>> > @@ -148,6 +206,11 @@ static int sdhci_at91_probe(struct platform_device *pdev)
>> > if (ret)
>> > goto clocks_disable_unprepare;
>> >
>> > + pm_runtime_set_active(&pdev->dev);
>> > + pm_runtime_enable(&pdev->dev);
>> > + pm_runtime_set_autosuspend_delay(&pdev->dev, 50);
>> > + pm_runtime_use_autosuspend(&pdev->dev);
>>
>> Move these four runtime PM calls above sdhci_add_host(), as after that
>> point the host is used and thus runtime PM operations starts.
>
> Sadly I have discovered a bit late it is not working when doing this
> because the controller has been suspended before doing the
> sdhci_add_host().
>
> What is the right way to fix it? Calling pm_runtime_get_noresume()

I would do that before pm_runtime_enable().

> before sdhci_add_host() and calling pm_runtime_put_autosuspend() after?

Yes. Sorry for not spotting this before.

[...]

Kind regards
Uffe


\
 
 \ /
  Last update: 2015-11-26 17:41    [W:0.082 / U:0.212 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site