* [PATCH 0/3] Small improvement about mmc documentation
@ 2026-09-17 8:48 Shawn Lin
2026-09-17 8:48 ` [PATCH 1/3] docs: mmc: document eMMC health status support in mmc-tools Shawn Lin
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Shawn Lin @ 2026-09-17 8:48 UTC (permalink / raw)
To: Ulf Hansson; +Cc: linux-mmc, linux-kernel, Shawn Lin, Shawn Lin
The first patch adds a line about eMMC health status in mmc-tools for
reference. And the last two patches amend the stale comment and link
for both of mmc-async-req.rst and the code.
Shawn Lin (3):
docs: mmc: document eMMC health status support in mmc-tools
docs: mmc: fix stale async request documentation
mmc: core: fix stale mmc_start_req() references in comments
Documentation/driver-api/mmc/mmc-async-req.rst | 64 ++++++--------------------
Documentation/driver-api/mmc/mmc-tools.rst | 1 +
drivers/mmc/core/core.c | 4 +-
drivers/mmc/core/core.h | 2 +-
4 files changed, 17 insertions(+), 54 deletions(-)
--
2.7.4
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/3] docs: mmc: document eMMC health status support in mmc-tools
2026-09-17 8:48 [PATCH 0/3] Small improvement about mmc documentation Shawn Lin
@ 2026-09-17 8:48 ` Shawn Lin
2026-09-17 8:48 ` [PATCH 2/3] docs: mmc: fix stale async request documentation Shawn Lin
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Shawn Lin @ 2026-09-17 8:48 UTC (permalink / raw)
To: Ulf Hansson; +Cc: linux-mmc, linux-kernel, Shawn Lin
From: Shawn Lin <shawn.lin@linux.dev>
mmc-utils added eMMC health status support, add a line for
reference.
Signed-off-by: Shawn Lin <shawn.lin@linux.dev>
---
Documentation/driver-api/mmc/mmc-tools.rst | 1 +
1 file changed, 1 insertion(+)
diff --git a/Documentation/driver-api/mmc/mmc-tools.rst b/Documentation/driver-api/mmc/mmc-tools.rst
index eee1c2c..728d3aa 100644
--- a/Documentation/driver-api/mmc/mmc-tools.rst
+++ b/Documentation/driver-api/mmc/mmc-tools.rst
@@ -32,6 +32,7 @@ The mmc-utils tools can do the following:
- Write to rpmb device from data file.
- Enable the eMMC cache feature.
- Disable the eMMC cache feature.
+ - Print the eMMC health status.
- Print and parse CID data.
- Print and parse CSD data.
- Print and parse SCR data.
--
2.7.4
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 2/3] docs: mmc: fix stale async request documentation
2026-09-17 8:48 [PATCH 0/3] Small improvement about mmc documentation Shawn Lin
2026-09-17 8:48 ` [PATCH 1/3] docs: mmc: document eMMC health status support in mmc-tools Shawn Lin
@ 2026-09-17 8:48 ` Shawn Lin
2026-09-17 8:48 ` [PATCH 3/3] mmc: core: fix stale mmc_start_req() references in comments Shawn Lin
2026-09-28 16:13 ` [PATCH 0/3] Small improvement about mmc documentation Ulf Hansson
3 siblings, 0 replies; 5+ messages in thread
From: Shawn Lin @ 2026-09-17 8:48 UTC (permalink / raw)
To: Ulf Hansson; +Cc: linux-mmc, linux-kernel, Shawn Lin
From: Shawn Lin <shawn.lin@linux.dev>
mmc-async-req.rst still documents interfaces that no longer exist:
- mmc_start_req() was renamed to mmc_start_areq() by commit c3399ef55d8e
("mmc: core: rename mmc_start_req() to *areq()") and then removed together
with the rest of the asynchronous request machinery when the block driver
switched to blk-mq, by commits 81196976ed94 ("mmc: block: Add blk-mq support")
and 126b62700386 ("mmc: core: Remove code no longer needed after the switch to blk-mq").
- mmc_blk_issue_rw_rq() was removed by commit 0fbfd1251830
("mmc: block: Remove code no longer needed after the switch to blk-mq"),
and was replaced by mmc_blk_mq_issue_rw_rq().
- The is_first_req argument of the ->pre_req() callback was dropped by
commit d3c6aac3bdfe ("mmc: delete is_first_req parameter from pre-request callback"),
so the "Optimize for the first request" section is obsolete as well.
- The Linaro wiki page holding the IOZone/mmc_test measurements no longer exists.
Update the document to describe the current request lifecycle: mmc_pre_req(),
mmc_start_request(), mmc_wait_for_req() and mmc_post_req()), and drop the sections
describing the long-gone interfaces and the dead link.
Signed-off-by: Shawn Lin <shawn.lin@linux.dev>
---
Documentation/driver-api/mmc/mmc-async-req.rst | 64 ++++++--------------------
1 file changed, 13 insertions(+), 51 deletions(-)
diff --git a/Documentation/driver-api/mmc/mmc-async-req.rst b/Documentation/driver-api/mmc/mmc-async-req.rst
index 0f7197c..d9d4ac7 100644
--- a/Documentation/driver-api/mmc/mmc-async-req.rst
+++ b/Documentation/driver-api/mmc/mmc-async-req.rst
@@ -23,7 +23,7 @@ MMC request.
MMC block driver
================
-The mmc_blk_issue_rw_rq() in the MMC block driver is made non-blocking.
+The mmc_blk_mq_issue_rw_rq() in the MMC block driver is made non-blocking.
The increase in throughput is proportional to the time it takes to
prepare (major part of preparations are dma_map_sg() and dma_unmap_sg())
@@ -34,21 +34,20 @@ platform. In power save mode, when clocks run on a lower frequency, the DMA
preparation may cost even more. As long as these slower preparations are run
in parallel with the transfer performance won't be affected.
-Details on measurements from IOZone and mmc_test
-================================================
+MMC core API
+============
-https://wiki.linaro.org/WorkingGroups/Kernel/Specs/StoragePerfMMC-async-req
+The preparation of a request is separated from starting the transfer, so
+that a host can prepare a request while another one is still in progress:
-MMC core API extension
-======================
-
-There is one new public function mmc_start_req().
-
-It starts a new MMC command request for a host. The function isn't
-truly non-blocking. If there is an ongoing async request it waits
-for completion of that request and starts the new one and returns. It
-doesn't wait for the new request to complete. If there is no ongoing
-request it starts the new request and returns immediately.
+ * mmc_pre_req() prepares a request before it is started. It may be called
+ while another request is running on the host.
+ * mmc_start_request() starts a prepared request without waiting for it to
+ complete. mmc_wait_for_req() starts a request and waits for it to
+ complete as well.
+ * mmc_post_req() releases the resources allocated by mmc_pre_req() after
+ the request has completed. It may likewise run while another request is
+ active.
MMC host extensions
===================
@@ -59,40 +58,3 @@ to before and after the actual mmc_host_ops.request() function is called.
In the DMA case pre_req() may do dma_map_sg() and prepare the DMA
descriptor, and post_req() runs the dma_unmap_sg().
-
-Optimize for the first request
-==============================
-
-The first request in a series of requests can't be prepared in parallel
-with the previous transfer, since there is no previous request.
-
-The argument is_first_req in pre_req() indicates that there is no previous
-request. The host driver may optimize for this scenario to minimize
-the performance loss. A way to optimize for this is to split the current
-request in two chunks, prepare the first chunk and start the request,
-and finally prepare the second chunk and start the transfer.
-
-Pseudocode to handle is_first_req scenario with minimal prepare overhead::
-
- if (is_first_req && req->size > threshold)
- /* start MMC transfer for the complete transfer size */
- mmc_start_command(MMC_CMD_TRANSFER_FULL_SIZE);
-
- /*
- * Begin to prepare DMA while cmd is being processed by MMC.
- * The first chunk of the request should take the same time
- * to prepare as the "MMC process command time".
- * If prepare time exceeds MMC cmd time
- * the transfer is delayed, guesstimate max 4k as first chunk size.
- */
- prepare_1st_chunk_for_dma(req);
- /* flush pending desc to the DMAC (dmaengine.h) */
- dma_issue_pending(req->dma_desc);
-
- prepare_2nd_chunk_for_dma(req);
- /*
- * The second issue_pending should be called before MMC runs out
- * of the first chunk. If the MMC runs out of the first data chunk
- * before this call, the transfer is delayed.
- */
- dma_issue_pending(req->dma_desc);
--
2.7.4
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 3/3] mmc: core: fix stale mmc_start_req() references in comments
2026-09-17 8:48 [PATCH 0/3] Small improvement about mmc documentation Shawn Lin
2026-09-17 8:48 ` [PATCH 1/3] docs: mmc: document eMMC health status support in mmc-tools Shawn Lin
2026-09-17 8:48 ` [PATCH 2/3] docs: mmc: fix stale async request documentation Shawn Lin
@ 2026-09-17 8:48 ` Shawn Lin
2026-09-28 16:13 ` [PATCH 0/3] Small improvement about mmc documentation Ulf Hansson
3 siblings, 0 replies; 5+ messages in thread
From: Shawn Lin @ 2026-09-17 8:48 UTC (permalink / raw)
To: Ulf Hansson; +Cc: linux-mmc, linux-kernel, Shawn Lin
From: Shawn Lin <shawn.lin@linux.dev>
Two comments still refer to mmc_start_req(). That function was renamed
to mmc_start_areq() then removed.
So, let's update the mmc_is_req_done() and mmc_pre_req() comments to refer
to the current APIs: mmc_start_request() and mmc_wait_for_req().
Signed-off-by: Shawn Lin <shawn.lin@linux.dev>
---
drivers/mmc/core/core.c | 4 ++--
drivers/mmc/core/core.h | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 59430bc..920e4b1 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -588,8 +588,8 @@ EXPORT_SYMBOL(mmc_cqe_recovery);
* mmc_is_req_done() is used with requests that have
* mrq->cap_cmd_during_tfr = true. mmc_is_req_done() must be called after
* starting a request and before waiting for it to complete. That is,
- * either in between calls to mmc_start_req(), or after mmc_wait_for_req()
- * and before mmc_wait_for_req_done(). If it is called at other times the
+ * after mmc_start_request() or mmc_wait_for_req() and before
+ * mmc_wait_for_req_done(). If it is called at other times the
* result is not meaningful.
*/
bool mmc_is_req_done(struct mmc_host *host, struct mmc_request *mrq)
diff --git a/drivers/mmc/core/core.h b/drivers/mmc/core/core.h
index 601c737..9be2875 100644
--- a/drivers/mmc/core/core.h
+++ b/drivers/mmc/core/core.h
@@ -170,7 +170,7 @@ int mmc_cqe_recovery(struct mmc_host *host);
* @host: MMC host to prepare command
* @mrq: MMC request to prepare for
*
- * mmc_pre_req() is called in prior to mmc_start_req() to let
+ * mmc_pre_req() is called in prior to mmc_start_request() to let
* host prepare for the new request. Preparation of a request may be
* performed while another request is running on the host.
*/
--
2.7.4
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 0/3] Small improvement about mmc documentation
2026-09-17 8:48 [PATCH 0/3] Small improvement about mmc documentation Shawn Lin
` (2 preceding siblings ...)
2026-09-17 8:48 ` [PATCH 3/3] mmc: core: fix stale mmc_start_req() references in comments Shawn Lin
@ 2026-09-28 16:13 ` Ulf Hansson
3 siblings, 0 replies; 5+ messages in thread
From: Ulf Hansson @ 2026-09-28 16:13 UTC (permalink / raw)
To: Shawn Lin; +Cc: Ulf Hansson, linux-mmc, linux-kernel, Shawn Lin
On Thu, Sep 17, 2026 at 10:48 AM Shawn Lin <shawn.lin@rock-chips.com> wrote:
>
>
> The first patch adds a line about eMMC health status in mmc-tools for
> reference. And the last two patches amend the stale comment and link
> for both of mmc-async-req.rst and the code.
>
>
>
> Shawn Lin (3):
> docs: mmc: document eMMC health status support in mmc-tools
> docs: mmc: fix stale async request documentation
> mmc: core: fix stale mmc_start_req() references in comments
>
> Documentation/driver-api/mmc/mmc-async-req.rst | 64 ++++++--------------------
> Documentation/driver-api/mmc/mmc-tools.rst | 1 +
> drivers/mmc/core/core.c | 4 +-
> drivers/mmc/core/core.h | 2 +-
> 4 files changed, 17 insertions(+), 54 deletions(-)
>
> --
> 2.7.4
>
The series applied for next, thanks!
Kind regards
Uffe
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-09-28 16:14 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-17 8:48 [PATCH 0/3] Small improvement about mmc documentation Shawn Lin
2026-09-17 8:48 ` [PATCH 1/3] docs: mmc: document eMMC health status support in mmc-tools Shawn Lin
2026-09-17 8:48 ` [PATCH 2/3] docs: mmc: fix stale async request documentation Shawn Lin
2026-09-17 8:48 ` [PATCH 3/3] mmc: core: fix stale mmc_start_req() references in comments Shawn Lin
2026-09-28 16:13 ` [PATCH 0/3] Small improvement about mmc documentation Ulf Hansson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®