All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH/RFC] mmc: tmio: Fix suspend process
@ 2015-06-14 17:22 ` Yoshihiro Kaneko
  0 siblings, 0 replies; 4+ messages in thread
From: Yoshihiro Kaneko @ 2015-06-14 17:22 UTC (permalink / raw)
  To: linux-mmc
  Cc: Ian Molton, Ulf Hansson, Simon Horman, Magnus Damm,
	Kuninori Morimoto, linux-sh

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/tmio_mmc_pio.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index e3dcf31..ec10bcd 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -1240,7 +1240,9 @@ int tmio_mmc_host_runtime_suspend(struct device *dev)
 	struct mmc_host *mmc = dev_get_drvdata(dev);
 	struct tmio_mmc_host *host = mmc_priv(mmc);
 
+	pm_runtime_get_sync(dev);
 	tmio_mmc_disable_mmc_irqs(host, TMIO_MASK_ALL);
+	pm_runtime_put(dev);
 
 	if (host->clk_cache)
 		tmio_mmc_clk_stop(host);
-- 
1.9.1


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

* [PATCH/RFC] mmc: tmio: Fix suspend process
@ 2015-06-14 17:22 ` Yoshihiro Kaneko
  0 siblings, 0 replies; 4+ messages in thread
From: Yoshihiro Kaneko @ 2015-06-14 17:22 UTC (permalink / raw)
  To: linux-mmc
  Cc: Ian Molton, Ulf Hansson, Simon Horman, Magnus Damm,
	Kuninori Morimoto, linux-sh

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/tmio_mmc_pio.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index e3dcf31..ec10bcd 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -1240,7 +1240,9 @@ int tmio_mmc_host_runtime_suspend(struct device *dev)
 	struct mmc_host *mmc = dev_get_drvdata(dev);
 	struct tmio_mmc_host *host = mmc_priv(mmc);
 
+	pm_runtime_get_sync(dev);
 	tmio_mmc_disable_mmc_irqs(host, TMIO_MASK_ALL);
+	pm_runtime_put(dev);
 
 	if (host->clk_cache)
 		tmio_mmc_clk_stop(host);
-- 
1.9.1


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

* Re: [PATCH/RFC] mmc: tmio: Fix suspend process
  2015-06-14 17:22 ` Yoshihiro Kaneko
@ 2015-06-18 13:33   ` Ulf Hansson
  -1 siblings, 0 replies; 4+ messages in thread
From: Ulf Hansson @ 2015-06-18 13:33 UTC (permalink / raw)
  To: Yoshihiro Kaneko
  Cc: linux-mmc, Ian Molton, Simon Horman, Magnus Damm,
	Kuninori Morimoto, Linux-sh list

On 14 June 2015 at 19:22, Yoshihiro Kaneko <ykaneko0929@gmail.com> wrote:
> 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/tmio_mmc_pio.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
> index e3dcf31..ec10bcd 100644
> --- a/drivers/mmc/host/tmio_mmc_pio.c
> +++ b/drivers/mmc/host/tmio_mmc_pio.c
> @@ -1240,7 +1240,9 @@ int tmio_mmc_host_runtime_suspend(struct device *dev)
>         struct mmc_host *mmc = dev_get_drvdata(dev);
>         struct tmio_mmc_host *host = mmc_priv(mmc);
>
> +       pm_runtime_get_sync(dev);

I don't recommend doing a pm_runtime_get_sync() from your
->runtime_suspend() callback. There a often cases where this can
deadlock.

Anyway, isn't the clock already enabled here?

>         tmio_mmc_disable_mmc_irqs(host, TMIO_MASK_ALL);
> +       pm_runtime_put(dev);
>
>         if (host->clk_cache)
>                 tmio_mmc_clk_stop(host);
> --
> 1.9.1
>

Kind regards
Uffe

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

* Re: [PATCH/RFC] mmc: tmio: Fix suspend process
@ 2015-06-18 13:33   ` Ulf Hansson
  0 siblings, 0 replies; 4+ messages in thread
From: Ulf Hansson @ 2015-06-18 13:33 UTC (permalink / raw)
  To: Yoshihiro Kaneko
  Cc: linux-mmc, Ian Molton, Simon Horman, Magnus Damm,
	Kuninori Morimoto, Linux-sh list

On 14 June 2015 at 19:22, Yoshihiro Kaneko <ykaneko0929@gmail.com> wrote:
> 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/tmio_mmc_pio.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
> index e3dcf31..ec10bcd 100644
> --- a/drivers/mmc/host/tmio_mmc_pio.c
> +++ b/drivers/mmc/host/tmio_mmc_pio.c
> @@ -1240,7 +1240,9 @@ int tmio_mmc_host_runtime_suspend(struct device *dev)
>         struct mmc_host *mmc = dev_get_drvdata(dev);
>         struct tmio_mmc_host *host = mmc_priv(mmc);
>
> +       pm_runtime_get_sync(dev);

I don't recommend doing a pm_runtime_get_sync() from your
->runtime_suspend() callback. There a often cases where this can
deadlock.

Anyway, isn't the clock already enabled here?

>         tmio_mmc_disable_mmc_irqs(host, TMIO_MASK_ALL);
> +       pm_runtime_put(dev);
>
>         if (host->clk_cache)
>                 tmio_mmc_clk_stop(host);
> --
> 1.9.1
>

Kind regards
Uffe

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

end of thread, other threads:[~2015-06-18 13:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-14 17:22 [PATCH/RFC] mmc: tmio: Fix suspend process Yoshihiro Kaneko
2015-06-14 17:22 ` Yoshihiro Kaneko
2015-06-18 13:33 ` Ulf Hansson
2015-06-18 13:33   ` Ulf Hansson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.