diff mbox

[repost] mmc: sh_mmcif: Fix suspend process

Message ID 1440334688-20674-1-git-send-email-ykaneko0929@gmail.com (mailing list archive)
State Accepted
Delegated to: Geert Uytterhoeven
Headers show

Commit Message

Yoshihiro Kaneko Aug. 23, 2015, 12:58 p.m. UTC
From: Koji Matsuoka <koji.matsuoka.xm@renesas.com>

The clock should be enable when SDHI registers are accessed.

Signed-off-by: Koji Matsuoka <koji.matsuoka.xm@renesas.com>
Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
---

This patch is based on mmc-next branch of Ulf Hansson's mmc tree.

* Perhaps this relates to the need to enhance clock management

 drivers/mmc/host/sh_mmcif.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Ulf Hansson Aug. 25, 2015, 3:27 p.m. UTC | #1
On 23 August 2015 at 14:58, Yoshihiro Kaneko <ykaneko0929@gmail.com> wrote:
> From: Koji Matsuoka <koji.matsuoka.xm@renesas.com>
>
> The clock should be enable when SDHI registers are accessed.

Yes, correct. But...

>
> Signed-off-by: Koji Matsuoka <koji.matsuoka.xm@renesas.com>
> Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
> ---
>
> This patch is based on mmc-next branch of Ulf Hansson's mmc tree.
>
> * Perhaps this relates to the need to enhance clock management
>
>  drivers/mmc/host/sh_mmcif.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/mmc/host/sh_mmcif.c b/drivers/mmc/host/sh_mmcif.c
> index 5a1fdd4..ad9ffea 100644
> --- a/drivers/mmc/host/sh_mmcif.c
> +++ b/drivers/mmc/host/sh_mmcif.c
> @@ -1632,7 +1632,9 @@ static int sh_mmcif_suspend(struct device *dev)
>  {
>         struct sh_mmcif_host *host = dev_get_drvdata(dev);
>
> +       pm_runtime_get_sync(dev);
>         sh_mmcif_writel(host->addr, MMCIF_CE_INT_MASK, MASK_ALL);
> +       pm_runtime_put(dev);

... when will the clock be gated, since the pm_runtime_put() here wont
do the trick!

That's a bit more complicated to deal with, but for now I will apply
this patch as is.

>
>         return 0;
>  }
> --
> 1.9.1
>

Thanks, applied for next!

Kind regards
Uffe
--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Yoshihiro Kaneko Sept. 6, 2015, 3:42 p.m. UTC | #2
Hello Ulf,

2015-08-26 0:27 GMT+09:00 Ulf Hansson <ulf.hansson@linaro.org>:
> On 23 August 2015 at 14:58, Yoshihiro Kaneko <ykaneko0929@gmail.com> wrote:
>> From: Koji Matsuoka <koji.matsuoka.xm@renesas.com>
>>
>> The clock should be enable when SDHI registers are accessed.
>
> Yes, correct. But...
>
>>
>> Signed-off-by: Koji Matsuoka <koji.matsuoka.xm@renesas.com>
>> Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
>> ---
>>
>> This patch is based on mmc-next branch of Ulf Hansson's mmc tree.
>>
>> * Perhaps this relates to the need to enhance clock management
>>
>>  drivers/mmc/host/sh_mmcif.c | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/drivers/mmc/host/sh_mmcif.c b/drivers/mmc/host/sh_mmcif.c
>> index 5a1fdd4..ad9ffea 100644
>> --- a/drivers/mmc/host/sh_mmcif.c
>> +++ b/drivers/mmc/host/sh_mmcif.c
>> @@ -1632,7 +1632,9 @@ static int sh_mmcif_suspend(struct device *dev)
>>  {
>>         struct sh_mmcif_host *host = dev_get_drvdata(dev);
>>
>> +       pm_runtime_get_sync(dev);
>>         sh_mmcif_writel(host->addr, MMCIF_CE_INT_MASK, MASK_ALL);
>> +       pm_runtime_put(dev);
>
> ... when will the clock be gated, since the pm_runtime_put() here wont
> do the trick!
>
> That's a bit more complicated to deal with, but for now I will apply
> this patch as is.

Thanks!
I need to learn more.

Best Regards,
Kaneko

>
>>
>>         return 0;
>>  }
>> --
>> 1.9.1
>>
>
> Thanks, applied for next!
>
> Kind regards
> Uffe
--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/mmc/host/sh_mmcif.c b/drivers/mmc/host/sh_mmcif.c
index 5a1fdd4..ad9ffea 100644
--- a/drivers/mmc/host/sh_mmcif.c
+++ b/drivers/mmc/host/sh_mmcif.c
@@ -1632,7 +1632,9 @@  static int sh_mmcif_suspend(struct device *dev)
 {
 	struct sh_mmcif_host *host = dev_get_drvdata(dev);
 
+	pm_runtime_get_sync(dev);
 	sh_mmcif_writel(host->addr, MMCIF_CE_INT_MASK, MASK_ALL);
+	pm_runtime_put(dev);
 
 	return 0;
 }