linux-mmc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mmc: core: Substitute mmc_flush_cash for mmc_cache_ctrl in suspend
@ 2012-02-10  3:56 Seungwon Jeon
  2012-02-13 20:34 ` Saugata Das
  0 siblings, 1 reply; 3+ messages in thread
From: Seungwon Jeon @ 2012-02-10  3:56 UTC (permalink / raw)
  To: linux-mmc; +Cc: 'Chris Ball', saugata.das, ygardi

After the cache is disabled in suspend, enabling cache can be done by
mmc_init_card in resume. Currently this call path has been changed. In
case of sleep mode mmc_init_card isn't called. So mmc_cache_ctrl need to
be replaced with mmc_flush_cache in suspend.

Signed-off-by: Seungwon Jeon <tgih.jun@samsung.com>
---
 drivers/mmc/core/core.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 8a19143..70e25d8 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -2329,9 +2329,14 @@ EXPORT_SYMBOL(mmc_card_can_sleep);
  */
 int mmc_flush_cache(struct mmc_card *card)
 {
-	struct mmc_host *host = card->host;
+	struct mmc_host *host;
 	int err = 0;
 
+	if (!card)
+		return err;
+
+	host = card->host;
+
 	if (!(host->caps2 & MMC_CAP2_CACHE_CTRL))
 		return err;
 
@@ -2401,7 +2406,7 @@ int mmc_suspend_host(struct mmc_host *host)
 	cancel_delayed_work(&host->detect);
 	mmc_flush_scheduled_work();
 	if (mmc_try_claim_host(host)) {
-		err = mmc_cache_ctrl(host, 0);
+		err = mmc_flush_cache(host->card);
 		mmc_do_release_host(host);
 	} else {
 		err = -EBUSY;
-- 
1.7.0.4



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

* Re: [PATCH] mmc: core: Substitute mmc_flush_cash for mmc_cache_ctrl in suspend
  2012-02-10  3:56 [PATCH] mmc: core: Substitute mmc_flush_cash for mmc_cache_ctrl in suspend Seungwon Jeon
@ 2012-02-13 20:34 ` Saugata Das
  2012-03-07  3:49   ` Seungwon Jeon
  0 siblings, 1 reply; 3+ messages in thread
From: Saugata Das @ 2012-02-13 20:34 UTC (permalink / raw)
  To: Seungwon Jeon; +Cc: linux-mmc, Chris Ball, ygardi

On 10 February 2012 09:26, Seungwon Jeon <tgih.jun@samsung.com> wrote:
> After the cache is disabled in suspend, enabling cache can be done by
> mmc_init_card in resume. Currently this call path has been changed. In
> case of sleep mode mmc_init_card isn't called. So mmc_cache_ctrl need to
> be replaced with mmc_flush_cache in suspend.
>
> Signed-off-by: Seungwon Jeon <tgih.jun@samsung.com>
> ---
>  drivers/mmc/core/core.c |    9 +++++++--
>  1 files changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
> index 8a19143..70e25d8 100644
> --- a/drivers/mmc/core/core.c
> +++ b/drivers/mmc/core/core.c
> @@ -2329,9 +2329,14 @@ EXPORT_SYMBOL(mmc_card_can_sleep);
>  */
>  int mmc_flush_cache(struct mmc_card *card)
>  {
> -       struct mmc_host *host = card->host;
> +       struct mmc_host *host;
>        int err = 0;
>
> +       if (!card)
> +               return err;
> +
> +       host = card->host;
> +
>        if (!(host->caps2 & MMC_CAP2_CACHE_CTRL))
>                return err;
>
> @@ -2401,7 +2406,7 @@ int mmc_suspend_host(struct mmc_host *host)
>        cancel_delayed_work(&host->detect);
>        mmc_flush_scheduled_work();
>        if (mmc_try_claim_host(host)) {
> -               err = mmc_cache_ctrl(host, 0);
> +               err = mmc_flush_cache(host->card);
>                mmc_do_release_host(host);
>        } else {
>                err = -EBUSY;
> --
> 1.7.0.4

Thanks for the changes.
Reviewed-by: Saugata Das <saugata.das@linaro.org>

>
>
> --
> 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: core: Substitute mmc_flush_cash for mmc_cache_ctrl in suspend
  2012-02-13 20:34 ` Saugata Das
@ 2012-03-07  3:49   ` Seungwon Jeon
  0 siblings, 0 replies; 3+ messages in thread
From: Seungwon Jeon @ 2012-03-07  3:49 UTC (permalink / raw)
  To: 'Saugata Das'; +Cc: linux-mmc, 'Chris Ball', ygardi

Saugata Das <saugata.das@linaro.org>:
> On 10 February 2012 09:26, Seungwon Jeon <tgih.jun@samsung.com> wrote:
> > After the cache is disabled in suspend, enabling cache can be done by
> > mmc_init_card in resume. Currently this call path has been changed. In
> > case of sleep mode mmc_init_card isn't called. So mmc_cache_ctrl need to
> > be replaced with mmc_flush_cache in suspend.
> >
> > Signed-off-by: Seungwon Jeon <tgih.jun@samsung.com>
> > ---
> >  drivers/mmc/core/core.c |    9 +++++++--
> >  1 files changed, 7 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
> > index 8a19143..70e25d8 100644
> > --- a/drivers/mmc/core/core.c
> > +++ b/drivers/mmc/core/core.c
> > @@ -2329,9 +2329,14 @@ EXPORT_SYMBOL(mmc_card_can_sleep);
> >  */
> >  int mmc_flush_cache(struct mmc_card *card)
> >  {
> > -       struct mmc_host *host = card->host;
> > +       struct mmc_host *host;
> >        int err = 0;
> >
> > +       if (!card)
> > +               return err;
> > +
> > +       host = card->host;
> > +
> >        if (!(host->caps2 & MMC_CAP2_CACHE_CTRL))
> >                return err;
> >
> > @@ -2401,7 +2406,7 @@ int mmc_suspend_host(struct mmc_host *host)
> >        cancel_delayed_work(&host->detect);
> >        mmc_flush_scheduled_work();
> >        if (mmc_try_claim_host(host)) {
> > -               err = mmc_cache_ctrl(host, 0);
> > +               err = mmc_flush_cache(host->card);
> >                mmc_do_release_host(host);
> >        } else {
> >                err = -EBUSY;
> > --
> > 1.7.0.4
> 
> Thanks for the changes.
> Reviewed-by: Saugata Das <saugata.das@linaro.org>
> 
Is there more opinions?

Thanks,
Seungwon Jeon.
> >
> >
> > --
> > 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
> --
> 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

end of thread, other threads:[~2012-03-07  3:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-10  3:56 [PATCH] mmc: core: Substitute mmc_flush_cash for mmc_cache_ctrl in suspend Seungwon Jeon
2012-02-13 20:34 ` Saugata Das
2012-03-07  3:49   ` Seungwon Jeon

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).