Skip to content

mmc: Improve host driver's support for R1B responses

Ulf Hansson linux-mmc 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest19 patches 9 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/19mmc: atmel-mci: Keep timer enabled when queuing a next requestdrivers/mmc/host/atmel-mci.c+2 -21 reply
2/19mmc: atmel-mci: Set the timer per command rather than per requestdrivers/mmc/host/atmel-mci.c+4 -21 reply
3/19mmc: atmel-mci: Respect the cmd->busy_timeout from the mmc coredrivers/mmc/host/atmel-mci.c+4 -21 reply
4/19mmc: jz4740: Inform the mmc core about the maximum busy timeoutdrivers/mmc/host/jz4740_mmc.c+11 -20 replies
5/19mmc: usdhi6rol0: Inform the mmc core about the maximum busy timeoutdrivers/mmc/host/usdhi6rol0.c+8 -11 reply
6/19mmc: cb710: Inform the mmc core about the maximum busy timeoutdrivers/mmc/host/cb710-mmc.c+8 -03 replies
7/19mmc: owl-mmc: Respect the cmd->busy_timeout from the mmc coredrivers/mmc/host/owl-mmc.c+7 -10 replies
8/19mmc: sdricoh_cs: Drop unused definesdrivers/mmc/host/sdricoh_cs.c+0 -20 replies
9/19mmc: sdricoh_cs: Use MMC_APP_CMD rather than a hardcoded numberdrivers/mmc/host/sdricoh_cs.c+2 -10 replies
10/19mmc: sdricoh_cs: Move MMC_APP_CMD handling to sdricoh_mmc_cmd()drivers/mmc/host/sdricoh_cs.c+14 -130 replies
11/19mmc: sdricoh_cs: Drop redundant in-parameter to sdricoh_query_status()drivers/mmc/host/sdricoh_cs.c+7 -80 replies
12/19mmc: sdricoh_cs: Throttle polling rate for data transfersdrivers/mmc/host/sdricoh_cs.c+14 -110 replies
13/19mmc: sdricoh_cs: Throttle polling rate for commandsdrivers/mmc/host/sdricoh_cs.c+15 -170 replies
14/19mmc: sdricoh_cs: Respect the cmd->busy_timeout from the mmc coredrivers/mmc/host/sdricoh_cs.c+5 -20 replies
15/19mmc: tifm_sd: Inform the mmc core about the maximum busy timeoutdrivers/mmc/host/tifm_sd.c+8 -10 replies
16/19mmc: via-sdmmc: Respect the cmd->busy_timeout from the mmc coredrivers/mmc/host/via-sdmmc.c+6 -10 replies
17/19mmc: mmc_spi: Add/rename defines for timeoutsdrivers/mmc/host/mmc_spi.c+5 -100 replies
18/19mmc: mmc_spi: Respect the cmd->busy_timeout from the mmc coredrivers/mmc/host/mmc_spi.c+6 -30 replies
19/19staging: greybus: sdio: Respect the cmd->busy_timeout from the mmc coredrivers/staging/greybus/sdio.c+7 -32 replies

Reviews trailers per patch

5 of 19 patches have a Reviewed-by or Acked-by.

PatchJesper NilssonRui Miguel SilvaGreg Kroah-HartmanLudovic Desroches
1/19A-b
2/19A-b
3/19A-b
4/19
5/19A-b
6/19
7/19
8/19
9/19
10/19
11/19
12/19
13/19
14/19
15/19
16/19
17/19
18/19
19/19A-b A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.

Read the v1 thread

Cover letter [PATCH 00/19] mmc: Improve host driver's support for R1B responses

Some MMC/SD commands uses R1B responses, which means the card may assert the DAT0 line to signal busy for a period of time, after it has received the command. The mmc core normally specifies the busy period for the command in the cmd->busy_timeout. Ideally the driver should respect it, but that isn't always the case, for several reasons.

For example, the mmc host may not even support HW busy signal detection, the HW may have a build-in upper limit of the timeout and the driver simply uses that or it uses some other internal command/request SW timeout mechanism with another timeout value.

In cases when the host driver can't support a cmd->busy_timeout, the core implements a fallback method, which is based upon sending CMD13 to poll the card about the status instead. However, to make this work, the host driver need to specify the mmc->max_busy_timeout, as to make the core aware of when to use the fallback method with CMD13 polling.

Step by step, host drivers has been improved to better cope with the above scenarios. Although in this series, I have walked through *all* host drivers and those that looked particularly suspicious I have fixed.

Note, none of the changes has been tested on HW, so I am relying on help with this.

The next step beyond this series is to make MMC_CAP_ERASE default enabled, as that would trigger CMD38 to be used. CMD38 uses the R1B response and may typically require longer busy periods to be supported.

Kind regards
Ulf Hanssom

Ulf Hansson (19):
mmc: atmel-mci: Keep timer enabled when queuing a next request
mmc: atmel-mci: Set the timer per command rather than per request
mmc: atmel-mci: Respect the cmd->busy_timeout from the mmc core
mmc: jz4740: Inform the mmc core about the maximum busy timeout
mmc: usdhi6rol0: Inform the mmc core about the maximum busy timeout
mmc: cb710: Inform the mmc core about the maximum busy timeout
mmc: owl-mmc: Respect the cmd->busy_timeout from the mmc core
mmc: sdricoh_cs: Drop unused defines
mmc: sdricoh_cs: Use MMC_APP_CMD rather than a hardcoded number
mmc: sdricoh_cs: Move MMC_APP_CMD handling to sdricoh_mmc_cmd()
mmc: sdricoh_cs: Drop redundant in-parameter to sdricoh_query_status()
mmc: sdricoh_cs: Throttle polling rate for data transfers
mmc: sdricoh_cs: Throttle polling rate for commands
mmc: sdricoh_cs: Respect the cmd->busy_timeout from the mmc core
mmc: tifm_sd: Inform the mmc core about the maximum busy timeout
mmc: via-sdmmc: Respect the cmd->busy_timeout from the mmc core
mmc: mmc_spi: Add/rename defines for timeouts
mmc: mmc_spi: Respect the cmd->busy_timeout from the mmc core
staging: greybus: sdio: Respect the cmd->busy_timeout from the mmc
core

 drivers/mmc/host/atmel-mci.c   |  12 ++--
 drivers/mmc/host/cb710-mmc.c   |   8 +++
 drivers/mmc/host/jz4740_mmc.c  |  13 ++++-
 drivers/mmc/host/mmc_spi.c     |  20 +++----
 drivers/mmc/host/owl-mmc.c     |   8 ++-
 drivers/mmc/host/sdricoh_cs.c  | 103 +++++++++++++++++----------------
 drivers/mmc/host/tifm_sd.c     |   9 ++-
 drivers/mmc/host/usdhi6rol0.c  |   9 ++-
 drivers/mmc/host/via-sdmmc.c   |   7 ++-
 drivers/staging/greybus/sdio.c |  10 +++-
 10 files changed, 125 insertions(+), 74 deletions(-)
Signature · 1 line
2.20.1