Skip to content

mmc: core: Improve code for polling and HW busy detect

Ulf Hansson linux-mmc oe-kbuild-all 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest12 patches 9 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/12mmc: core: Throttle polling rate for CMD6drivers/mmc/core/mmc_ops.c+8 -03 replies
2/12mmc: core: Drop unused definedrivers/mmc/core/mmc_ops.c+0 -10 replies
3/12mmc: core: Extend mmc_switch_status() to rid of __mmc_switch_status()drivers/mmc/core/mmc.c drivers/mmc/core/mmc_ops.c drivers/mmc/core/mmc_ops.h+11 -170 replies
4/12mmc: core: Drop redundant in-parameter to __mmc_switch()drivers/mmc/core/mmc.c drivers/mmc/core/mmc_ops.c drivers/mmc/core/mmc_ops.h+15 -200 replies
5/12mmc: core: Split up mmc_poll_for_busy()drivers/mmc/core/mmc_ops.c+31 -160 replies
6/12mmc: core: Enable re-use of mmc_blk_in_tran_state()drivers/mmc/core/block.c include/linux/mmc/mmc.h+14 -200 replies
7/12mmc: core: Update CMD13 busy check for CMD6 commandsdrivers/mmc/core/mmc_ops.c+1 -10 replies
8/12mmc: core: Convert to mmc_poll_for_busy() for erase/trim/discarddrivers/mmc/core/core.c drivers/mmc/core/mmc_ops.c drivers/mmc/core/mmc_ops.h+33 -400 replies
9/12mmc: core: Drop redundant out-parameter to mmc_send_hpi_cmd()drivers/mmc/core/mmc_ops.c+2 -40 replies
10/12mmc: core: Convert to mmc_poll_for_busy() for HPI commandsdrivers/mmc/core/mmc_ops.c drivers/mmc/core/mmc_ops.h+6 -150 replies
11/12mmc: core: Fixup support for HW busy detection for HPI commandsdrivers/mmc/core/mmc_ops.c+25 -110 replies
12/12mmc: core: Re-work the error path for the eMMC sanitize commanddrivers/mmc/core/block.c drivers/mmc/core/core.c drivers/mmc/core/mmc_ops.c +1 more+19 -370 replies

Reviews trailers per patch

1 of 12 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchLudovic BarreBaolin Wang
SeriesT-b R-b T-b
1/12R-b
2/12
3/12
4/12
5/12
6/12
7/12
8/12
9/12
10/12
11/12
12/12

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 00/12] mmc: core: Improve code for polling and HW busy detect

There exists several separate variants of polling loops, used to detect when the card stop signals busy for various operations, in the mmc core. All of them have different issues that needs to be fixed.

The intent with this series, is to address some of these problems, via first improving the mmc_poll_for_busy() function, then consolidate code by moving more users to it.

While I was working on this, I stumbled over some code here and there, that deserved some cleanup, hence I also folded in a couple of patches for this.

So far, I have only managed to extensively test the updated mmc_poll_for_busy() function for CMD6 commands. Some tests for erase/trim/discard and for HPI+sanitize are needed.

Note that, there are still separate polling loops in the mmc block layer, but moving that to mmc_poll_for_busy() involves some additional work. I am looking into that as a next step.

Please help review and test!

Kind regards
Ulf Hansson

Ulf Hansson (12):
mmc: core: Throttle polling rate for CMD6
mmc: core: Drop unused define
mmc: core: Extend mmc_switch_status() to rid of __mmc_switch_status()
mmc: core: Drop redundant in-parameter to __mmc_switch()
mmc: core: Split up mmc_poll_for_busy()
mmc: core: Enable re-use of mmc_blk_in_tran_state()
mmc: core: Update CMD13 busy check for CMD6 commands
mmc: core: Convert to mmc_poll_for_busy() for erase/trim/discard
mmc: core: Drop redundant out-parameter to mmc_send_hpi_cmd()
mmc: core: Convert to mmc_poll_for_busy() for HPI commands
mmc: core: Fixup support for HW busy detection for HPI commands
mmc: core: Re-work the error path for the eMMC sanitize command

 drivers/mmc/core/block.c   |  55 +++++--------
 drivers/mmc/core/core.c    |  53 +------------
 drivers/mmc/core/mmc.c     |  38 ++++-----
 drivers/mmc/core/mmc_ops.c | 159 ++++++++++++++++++++++---------------
 drivers/mmc/core/mmc_ops.h |  13 ++-
 include/linux/mmc/core.h   |   3 -
 include/linux/mmc/mmc.h    |  10 +++
 7 files changed, 157 insertions(+), 174 deletions(-)
Signature · 1 line
2.17.1