Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1471880 > unrolled thread

Re: [PATCH] mmc: sdhci-msm: Add pm_runtime and system PM support

Started byUlf Hansson <ulf.hansson@linaro.org>
First post2016-08-29 16:30 +0200
Last post2016-08-31 07:30 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH] mmc: sdhci-msm: Add pm_runtime and system PM support Ulf Hansson <ulf.hansson@linaro.org> - 2016-08-29 16:30 +0200
    Re: [PATCH] mmc: sdhci-msm: Add pm_runtime and system PM support Pramod Gurav <pramod.gurav@linaro.org> - 2016-08-31 07:30 +0200

#1471880 — Re: [PATCH] mmc: sdhci-msm: Add pm_runtime and system PM support

FromUlf Hansson <ulf.hansson@linaro.org>
Date2016-08-29 16:30 +0200
SubjectRe: [PATCH] mmc: sdhci-msm: Add pm_runtime and system PM support
Message-ID<sbvJw-8ra-23@gated-at.bofh.it>
On 16 June 2016 at 14:35, Pramod Gurav <pramod.gurav@linaro.org> wrote:
> Provides runtime PM callbacks to enable and disable clock resources
> when idle. Also support system PM callbacks to be called during system
> suspend and resume.
>
> Signed-off-by: Pramod Gurav <pramod.gurav@linaro.org>
> ---
>  drivers/mmc/host/sdhci-msm.c | 57 ++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 57 insertions(+)
>
> diff --git a/drivers/mmc/host/sdhci-msm.c b/drivers/mmc/host/sdhci-msm.c
> index 0653fe7..f4394c8 100644
> --- a/drivers/mmc/host/sdhci-msm.c
> +++ b/drivers/mmc/host/sdhci-msm.c
> @@ -18,6 +18,7 @@
>  #include <linux/of_device.h>
>  #include <linux/delay.h>
>  #include <linux/mmc/mmc.h>
> +#include <linux/pm_runtime.h>
>  #include <linux/slab.h>
>
>  #include "sdhci-pltfm.h"
> @@ -549,6 +550,11 @@ static int sdhci_msm_probe(struct platform_device *pdev)
>         if (ret)
>                 goto clk_disable;
>
> +       platform_set_drvdata(pdev, msm_host);
> +
> +       pm_runtime_set_active(&pdev->dev);
> +       pm_runtime_enable(&pdev->dev);

I think you need to move these a bit earlier, before calling sdhci_add_host().

Maybe it's just easier if you look at the sdhci-of-at91.c driver,
which behaves nicely around runtime PM deployment. You can probably
use the very similar code, except the ->runtime_suspend|resume()
callbacks.

And don't forget to deploy runtime PM support in the ->remove()
callback as well, again sdhci-of-at91 is a good reference.

[...]

Kind regards
Uffe

[toc] | [next] | [standalone]


#1473039

FromPramod Gurav <pramod.gurav@linaro.org>
Date2016-08-31 07:30 +0200
Message-ID<sc6g1-6Gh-3@gated-at.bofh.it>
In reply to#1471880
Thanks Ulf for the review.

On 29 August 2016 at 19:50, Ulf Hansson <ulf.hansson@linaro.org> wrote:
> On 16 June 2016 at 14:35, Pramod Gurav <pramod.gurav@linaro.org> wrote:

<snip>

>> +       platform_set_drvdata(pdev, msm_host);
>> +
>> +       pm_runtime_set_active(&pdev->dev);
>> +       pm_runtime_enable(&pdev->dev);
>
> I think you need to move these a bit earlier, before calling sdhci_add_host().
>
> Maybe it's just easier if you look at the sdhci-of-at91.c driver,
> which behaves nicely around runtime PM deployment. You can probably
> use the very similar code, except the ->runtime_suspend|resume()
> callbacks.
>
> And don't forget to deploy runtime PM support in the ->remove()
> callback as well, again sdhci-of-at91 is a good reference.
>

Will take a look at the said driver and do necessary changes and repost.
Thanks again.

Regards,
Pramod

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web