linux-mmc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RFC 0/3] mmc: block: Fix tuning (by avoiding it) for RPMB
@ 2016-04-21 13:28 Adrian Hunter
  2016-04-21 13:28 ` [PATCH RFC 1/3] mmc: mmc: Factor out mmc_hs200_to_hs() Adrian Hunter
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Adrian Hunter @ 2016-04-21 13:28 UTC (permalink / raw)
  To: Ulf Hansson; +Cc: linux-mmc, Tomas Winkler

Hi

The RPMB partition only allows certain commands.  In particular,
the tuning command (CMD21) is not allowed -  refer JEDEC eMMC
standard v5.1 section 6.2.2 Command restrictions.

That means commands will begin failing if re-tuning is needed
while switched to the RPMB partition.

Here are 4 options to fix the problem:


1. The approach taken by this patch set:

To avoid tuning for RPMB, switch to High Speed mode from HS200
or HS400 mode if re-tuning has been enabled.  And switch back
when leaving RPMB.

Advantages: Directly does what needs to be done.

Disadvantages: Assumes the mode switching will work.


2. Same as 1 but disable the tuning modes by removing them from
card->mmc_avail_type and doing a full mmc_reset().

Advantages: Simpler to program

Disadvantages: Doing a full reset is slower.  Doing a full reset
is not an expected consequence of accessing RPMB.


3. Simply disable re-tuning and attempt to recover from any errors.

Disadvantages: Due to the interdependent nature of RPMB reads/writes
it might not be possible to recover without returning an error to the
RPMB user.  Also it would be difficult to test if the recovery actually
worked in all cases.


4. Do a partiton switch as part of re-tuning.

Disadvantages: Makes re-tuning more complicated.  Would require moving
the control of partition switching into the core.  CRC errors arising
from the need to re-tune might break the interdependent nature of RPMB
operations.


As a final note, if a solution is found then we might be able to revert
commit 4e93b9a6abc0 ("mmc: card: Don't access RPMB partitions for normal
read/write").


Adrian Hunter (3):
      mmc: mmc: Factor out mmc_hs200_to_hs()
      mmc: mmc: Factor out mmc_hs400_to_hs() and __mmc_hs_to_hs200()
      mmc: block: Fix tuning (by avoiding it) for RPMB

 drivers/mmc/card/block.c |  36 +++++++++++
 drivers/mmc/core/mmc.c   | 156 ++++++++++++++++++++++++++++++++++++++++++-----
 include/linux/mmc/card.h |   2 +-
 include/linux/mmc/core.h |   3 +
 include/linux/mmc/host.h |   5 ++
 5 files changed, 186 insertions(+), 16 deletions(-)


Regards
Adrian

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

end of thread, other threads:[~2016-05-02 21:19 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-21 13:28 [PATCH RFC 0/3] mmc: block: Fix tuning (by avoiding it) for RPMB Adrian Hunter
2016-04-21 13:28 ` [PATCH RFC 1/3] mmc: mmc: Factor out mmc_hs200_to_hs() Adrian Hunter
2016-04-21 13:28 ` [PATCH RFC 2/3] mmc: mmc: Factor out mmc_hs400_to_hs() and __mmc_hs_to_hs200() Adrian Hunter
2016-04-21 13:28 ` [PATCH RFC 3/3] mmc: block: Fix tuning (by avoiding it) for RPMB Adrian Hunter
2016-04-28 10:34   ` Ulf Hansson
2016-04-28 11:02     ` Adrian Hunter
2016-04-28 11:46       ` Ulf Hansson
2016-04-28 13:02         ` Adrian Hunter
2016-05-02  8:24           ` Ulf Hansson
2016-05-02  9:31             ` Adrian Hunter
2016-05-02 11:14               ` Ulf Hansson
2016-04-28  7:21 ` [PATCH RFC 0/3] " Adrian Hunter
2016-05-02 21:19   ` Winkler, Tomas

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