linux-mmc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Adrian Hunter <adrian.hunter@intel.com>
To: Ulf Hansson <ulf.hansson@linaro.org>
Cc: linux-mmc <linux-mmc@vger.kernel.org>,
	Tomas Winkler <tomas.winkler@intel.com>
Subject: [PATCH V2 3/3] mmc: block: Pause re-tuning while switched to the RPMB partition
Date: Wed,  4 May 2016 14:38:13 +0300	[thread overview]
Message-ID: <1462361893-11897-4-git-send-email-adrian.hunter@intel.com> (raw)
In-Reply-To: <1462361893-11897-1-git-send-email-adrian.hunter@intel.com>

Re-tuning is not possible when switched to the RPMB
partition.  However re-tuning should not be needed
if re-tuning is done immediately before switching,
a small set of operations is done, and then we
immediately switch back to the main partition.

A previous patch ensured that we immediately switch
back to the main partition.

This patch uses the new facility to "pause" re-tuning
before switching to the RPMB partition, and to "unpause"
it after switching from the RPMB partition.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
---
 drivers/mmc/card/block.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
index a65043854458..565009b190cd 100644
--- a/drivers/mmc/card/block.c
+++ b/drivers/mmc/card/block.c
@@ -756,16 +756,25 @@ static inline int mmc_blk_part_switch(struct mmc_card *card,
 	if (mmc_card_mmc(card)) {
 		u8 part_config = card->ext_csd.part_config;
 
+		if (md->part_type == EXT_CSD_PART_CONFIG_ACC_RPMB)
+			mmc_retune_pause(card->host);
+
 		part_config &= ~EXT_CSD_PART_CONFIG_ACC_MASK;
 		part_config |= md->part_type;
 
 		ret = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
 				 EXT_CSD_PART_CONFIG, part_config,
 				 card->ext_csd.part_time);
-		if (ret)
+		if (ret) {
+			if (md->part_type == EXT_CSD_PART_CONFIG_ACC_RPMB)
+				mmc_retune_unpause(card->host);
 			return ret;
+		}
 
 		card->ext_csd.part_config = part_config;
+
+		if (main_md->part_curr == EXT_CSD_PART_CONFIG_ACC_RPMB)
+			mmc_retune_unpause(card->host);
 	}
 
 	main_md->part_curr = md->part_type;
-- 
1.9.1


  parent reply	other threads:[~2016-05-04 11:42 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-04 11:38 [PATCH V2 0/3] mmc: block: Fix tuning (by avoiding it) for RPMB Adrian Hunter
2016-05-04 11:38 ` [PATCH V2 1/3] mmc: core: Add a facility to "pause" re-tuning Adrian Hunter
2016-05-10 12:24   ` Ulf Hansson
2016-05-10 13:03     ` Adrian Hunter
2016-05-11  6:48       ` Ulf Hansson
2016-05-11  9:00         ` Adrian Hunter
2016-05-12  6:14           ` Adrian Hunter
2016-05-12 13:20             ` Ulf Hansson
2016-05-12 13:19               ` Adrian Hunter
2016-05-16 12:35                 ` [PATCH V3 " Adrian Hunter
2016-05-17 15:06                   ` Ulf Hansson
2016-05-18  6:44                     ` Adrian Hunter
2016-05-04 11:38 ` [PATCH V2 2/3] mmc: block: Always switch back to main area after RPMB access Adrian Hunter
2016-05-04 11:38 ` Adrian Hunter [this message]
2016-05-04 11:54 ` [PATCH V2 0/3] mmc: block: Fix tuning (by avoiding it) for RPMB Winkler, Tomas
2016-05-10 10:28 ` Ulf Hansson

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=1462361893-11897-4-git-send-email-adrian.hunter@intel.com \
    --to=adrian.hunter@intel.com \
    --cc=linux-mmc@vger.kernel.org \
    --cc=tomas.winkler@intel.com \
    --cc=ulf.hansson@linaro.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).