linux-mmc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Seungwon Jeon <tgih.jun@samsung.com>
To: linux-mmc@vger.kernel.org
Cc: 'Chris Ball' <cjb@laptop.org>,
	saugata.das@linaro.org, ygardi@codeaurora.org
Subject: [PATCH] mmc: core: Substitute mmc_flush_cash for mmc_cache_ctrl in suspend
Date: Fri, 10 Feb 2012 12:56:35 +0900	[thread overview]
Message-ID: <000101cce7a7$fc0df6b0$f429e410$%jun@samsung.com> (raw)

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



             reply	other threads:[~2012-02-10  3:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-10  3:56 Seungwon Jeon [this message]
2012-02-13 20:34 ` [PATCH] mmc: core: Substitute mmc_flush_cash for mmc_cache_ctrl in suspend Saugata Das
2012-03-07  3:49   ` Seungwon Jeon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='000101cce7a7$fc0df6b0$f429e410$%jun@samsung.com' \
    --to=tgih.jun@samsung.com \
    --cc=cjb@laptop.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=saugata.das@linaro.org \
    --cc=ygardi@codeaurora.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).