All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/9] mmc: core: Re-work CMD13 polling method for CMD6 for mmc
@ 2016-11-16 10:51 Ulf Hansson
  2016-11-16 10:51 ` [PATCH 1/9] mmc: core: Retry instead of ignore at CRC errors when polling for busy Ulf Hansson
                   ` (9 more replies)
  0 siblings, 10 replies; 25+ messages in thread
From: Ulf Hansson @ 2016-11-16 10:51 UTC (permalink / raw)
  To: linux-mmc, Ulf Hansson
  Cc: Jaehoon Chung, Adrian Hunter, Linus Walleij, Chaotian Jing,
	Stephen Boyd, Michael Walle, Yong Mao, Shawn Lin

Several changes has been made for how and when to use CMD13 as a
polling-method, to find out when the mmc cards stops signaling busy after
sending a CMD6. This particularly concerns the cases when switching to new bus
speed modes, such as HS (high-speed), HS DDR, HS200, HS400 and HS400ES.

Currently CMD13 polling is *not* allowed for these cases, but this was recently
changed - and which did cause regressions for card detection for some
platforms.

A simple fix was made to solve these regressions, simply by using a default
CMD6 generic timeout of 500ms, as to avoid using the fall-back timeout in
__mmc_switch() of 10min. That greatly improve the situation and one could
consider the regressions as "solved".

However, this simple fix is still causing unnecessary long card initialization
times, especially for those mmc hosts that doesn't support HW busy detection
(using MMC_CAP_WAIT_WHILE_BUSY and/or implements the ->card_busy() host ops).

This because we wait a fixed amount of time (CMD6 generic timeout) to make sure
the card is done signaling busy, while in practice this happens a lot sooner.

A couple of tests for HS and HS DDR eMMC cards, shows the card only need a few
ms to complete the bus speed mode changes, thus it's far less than the CMD6
generic timeout.

To improve this behaviour and shorten the card initialization time, we need to
allow using CMD13 as polling method to find out when the card stops signaling
busy. Although, enabling CMD13 polling may also introduce other issues as
according to the JEDEC spec, it's not the recommended method. Especially it
mentions that CRC errors may be triggered when sending a CMD13 command during a
bus timing change.

To deal with these issues, we need to change from ignoring those CRC errors but
instead continue to treat the card as being busy and continue to poll with
CMD13. Perhaps this behaviour is one of reasons to why the earlier CMD13 polling
method didn't work out well.

This series requires extensive testing, please help with that!

I have currently tested it with HS and HS DDR eMMC cards, and for combinations
of an mmc hosts (mmci) supporting HW busy detection and not (local hacks in
mmci.c).


Ulf Hansson (9):
  mmc: core: Retry instead of ignore at CRC errors when polling for busy
  mmc: core: Remove redundant __mmc_send_status()
  mmc: core: Rename ignore_crc to retry_crc_err to reflect its purpose
  mmc: core: Enable __mmc_switch() to change bus speed timing for the
    host
  mmc: core: Allow CMD13 polling when switching to HS mode for mmc
  mmc: core: Update CMD13 polling policy when switch to HS DDR mode
  mmc: core: Allow CMD13 polling when switch to HS200 mode
  mmc: core: Allow CMD13 polling when switch to HS400 mode
  mmc: core: Allow CMD13 polling when switch to HS400ES mode

 drivers/mmc/core/core.c    |   2 +-
 drivers/mmc/core/mmc.c     | 156 ++++++++++++++-------------------------------
 drivers/mmc/core/mmc_ops.c |  45 +++++++------
 drivers/mmc/core/mmc_ops.h |   4 +-
 4 files changed, 77 insertions(+), 130 deletions(-)

-- 
1.9.1


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

end of thread, other threads:[~2016-11-23  1:25 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-16 10:51 [PATCH 0/9] mmc: core: Re-work CMD13 polling method for CMD6 for mmc Ulf Hansson
2016-11-16 10:51 ` [PATCH 1/9] mmc: core: Retry instead of ignore at CRC errors when polling for busy Ulf Hansson
2016-11-16 10:51 ` [PATCH 2/9] mmc: core: Remove redundant __mmc_send_status() Ulf Hansson
2016-11-16 10:51 ` [PATCH 3/9] mmc: core: Rename ignore_crc to retry_crc_err to reflect its purpose Ulf Hansson
2016-11-16 10:51 ` [PATCH 4/9] mmc: core: Enable __mmc_switch() to change bus speed timing for the host Ulf Hansson
2016-11-16 10:51 ` [PATCH 5/9] mmc: core: Allow CMD13 polling when switching to HS mode for mmc Ulf Hansson
2016-11-16 10:51 ` [PATCH 6/9] mmc: core: Update CMD13 polling policy when switch to HS DDR mode Ulf Hansson
2016-11-16 10:51 ` [PATCH 7/9] mmc: core: Allow CMD13 polling when switch to HS200 mode Ulf Hansson
2016-11-17 10:23   ` Adrian Hunter
2016-11-17 15:02     ` Ulf Hansson
2016-11-18  9:30       ` Adrian Hunter
2016-11-18 12:20         ` Ulf Hansson
2016-11-18 12:32           ` Adrian Hunter
2016-11-18 13:16             ` Ulf Hansson
2016-11-18  8:05   ` Shawn Lin
2016-11-18 11:45     ` Ulf Hansson
2016-11-23  1:24       ` Shawn Lin
2016-11-16 10:51 ` [PATCH 8/9] mmc: core: Allow CMD13 polling when switch to HS400 mode Ulf Hansson
2016-11-18 12:02   ` Adrian Hunter
2016-11-18 12:59     ` Ulf Hansson
2016-11-16 10:51 ` [PATCH 9/9] mmc: core: Allow CMD13 polling when switch to HS400ES mode Ulf Hansson
2016-11-18 13:35   ` Adrian Hunter
2016-11-18 14:37     ` Ulf Hansson
2016-11-18 14:43       ` Adrian Hunter
2016-11-17  9:06 ` [PATCH 0/9] mmc: core: Re-work CMD13 polling method for CMD6 for mmc Linus Walleij

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.