devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mmc: dw_mmc: Don't disable vmmc if keeping power in suspend
@ 2013-08-07  3:28 Derek Basehore
  2013-08-12 10:33 ` Seungwon Jeon
  0 siblings, 1 reply; 3+ messages in thread
From: Derek Basehore @ 2013-08-07  3:28 UTC (permalink / raw)
  To: Seungwon Jeon
  Cc: Chris Ball, Grant Likely, Rob Herring, linux-mmc, linux-kernel,
	devicetree, Derek Basehore

If we keep power for suspend on a host for dw_mmc, don't disable vmmc-supply
regulator when suspending the host.

Signed-off-by: Derek Basehore <dbasehore@chromium.org>
Reviewed-by: Doug Anderson <dianders@chromium.org>
---
 drivers/mmc/host/dw_mmc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
index ee5f167..bf82d7c 100644
--- a/drivers/mmc/host/dw_mmc.c
+++ b/drivers/mmc/host/dw_mmc.c
@@ -2474,7 +2474,7 @@ int dw_mci_suspend(struct dw_mci *host)
 		}
 	}
 
-	if (host->vmmc)
+	if (host->vmmc && !(host->pdata->pm_caps & MMC_PM_KEEP_POWER))
 		regulator_disable(host->vmmc);
 
 	return 0;
@@ -2485,7 +2485,7 @@ int dw_mci_resume(struct dw_mci *host)
 {
 	int i, ret;
 
-	if (host->vmmc) {
+	if (host->vmmc && !(host->pdata->pm_caps & MMC_PM_KEEP_POWER)) {
 		ret = regulator_enable(host->vmmc);
 		if (ret) {
 			dev_err(host->dev,
-- 
1.8.3


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

* RE: [PATCH] mmc: dw_mmc: Don't disable vmmc if keeping power in suspend
  2013-08-07  3:28 [PATCH] mmc: dw_mmc: Don't disable vmmc if keeping power in suspend Derek Basehore
@ 2013-08-12 10:33 ` Seungwon Jeon
  2013-08-12 17:31   ` Doug Anderson
  0 siblings, 1 reply; 3+ messages in thread
From: Seungwon Jeon @ 2013-08-12 10:33 UTC (permalink / raw)
  To: 'Derek Basehore'
  Cc: 'Chris Ball', 'Grant Likely',
	'Rob Herring', linux-mmc, linux-kernel, devicetree

On Wed, August 07, 2013, Derek Basehore
> If we keep power for suspend on a host for dw_mmc, don't disable vmmc-supply
> regulator when suspending the host.

I have a trivial comment.
It would be better to add some macro for checking MMC_PM_KEEP_POWER.
And I just wonder how the problem is silent. Origin code has stood up somewhat long.
Did you see?

Acked-by: Seungwon Jeon <tgih.jun@samsung.com>

Thanks,
Seungwon Jeon

> 
> Signed-off-by: Derek Basehore <dbasehore@chromium.org>
> Reviewed-by: Doug Anderson <dianders@chromium.org>
> ---
>  drivers/mmc/host/dw_mmc.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
> index ee5f167..bf82d7c 100644
> --- a/drivers/mmc/host/dw_mmc.c
> +++ b/drivers/mmc/host/dw_mmc.c
> @@ -2474,7 +2474,7 @@ int dw_mci_suspend(struct dw_mci *host)
>  		}
>  	}
> 
> -	if (host->vmmc)
> +	if (host->vmmc && !(host->pdata->pm_caps & MMC_PM_KEEP_POWER))
>  		regulator_disable(host->vmmc);
> 
>  	return 0;
> @@ -2485,7 +2485,7 @@ int dw_mci_resume(struct dw_mci *host)
>  {
>  	int i, ret;
> 
> -	if (host->vmmc) {
> +	if (host->vmmc && !(host->pdata->pm_caps & MMC_PM_KEEP_POWER)) {
>  		ret = regulator_enable(host->vmmc);
>  		if (ret) {
>  			dev_err(host->dev,
> --
> 1.8.3
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

* Re: [PATCH] mmc: dw_mmc: Don't disable vmmc if keeping power in suspend
  2013-08-12 10:33 ` Seungwon Jeon
@ 2013-08-12 17:31   ` Doug Anderson
  0 siblings, 0 replies; 3+ messages in thread
From: Doug Anderson @ 2013-08-12 17:31 UTC (permalink / raw)
  To: Seungwon Jeon
  Cc: Derek Basehore, Chris Ball, Grant Likely, Rob Herring,
	linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org,
	devicetree

Seungwon and Derek,

On Mon, Aug 12, 2013 at 3:33 AM, Seungwon Jeon <tgih.jun@samsung.com> wrote:
> On Wed, August 07, 2013, Derek Basehore
>> If we keep power for suspend on a host for dw_mmc, don't disable vmmc-supply
>> regulator when suspending the host.
>
> I have a trivial comment.
> It would be better to add some macro for checking MMC_PM_KEEP_POWER.
> And I just wonder how the problem is silent. Origin code has stood up somewhat long.
> Did you see?
>
> Acked-by: Seungwon Jeon <tgih.jun@samsung.com>
>
> Thanks,
> Seungwon Jeon
>
>>
>> Signed-off-by: Derek Basehore <dbasehore@chromium.org>
>> Reviewed-by: Doug Anderson <dianders@chromium.org>
>> ---
>>  drivers/mmc/host/dw_mmc.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)

Though I reviewed this originally, I'd actually propose not landing it.

I've spent more time with the regulator code in dw_mmc and currently
believe that the regulators should be enabled / disabled in
MMC_POWER_UP / MMC_POWER_OFF.  When we do that then the mmc core will
handle MMC_PM_KEEP_POWER.  You can see my current thoughts on this in
<https://gerrit.chromium.org/gerrit/#/c/65263/>.  I will try to post
that upstream before too long, but feel free to let me know any
comments.

-Doug

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

end of thread, other threads:[~2013-08-12 17:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-07  3:28 [PATCH] mmc: dw_mmc: Don't disable vmmc if keeping power in suspend Derek Basehore
2013-08-12 10:33 ` Seungwon Jeon
2013-08-12 17:31   ` Doug Anderson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).