aboutsummaryrefslogtreecommitdiff
path: root/Documentation/driver-api
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2026-10-22 07:29:07 -1000
committerLinus Torvalds <torvalds@linux-foundation.org>2026-10-22 07:29:07 -1000
commit03480653ddfd1b004dc622acb4fa913b05c3edaa (patch)
tree5523a2d035f09a3dfbb57c09f359b13c0ddf026f /Documentation/driver-api
parent9aa54fb74ead1737b92a9dc2f7a5d9d5e48dc7b5 (diff)
parentfd9af27f6c2319713bb23832066585f8a59a1771 (diff)
Merge tag 'mmc-v7.4' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc
Pull MMC updates from Ulf Hansson: "MMC core: - Add a power-off-delay-us DT property to support HW specific delays - Add mmc_send_tuning_timeout() to allow hosts to specify a timeout - Enable hosts to control the re-programming of the crypto keys MMC host: - dw_mmc: Add a common watchdog and convert the various timeouts to use it - dw_mmc: Expose the watchdog state in debugfs - dw_mmc-rockchip: Use a tighter per command tuning timeout - greybus-sdio: Convert to devm_mmc_alloc_host() - meson-gx: Enable the bus pipeline clock on T7 - rtsx_usb_sdmmc: Start card power-up at 3.3V - sdhci-cadence: Add Altera Agilex5 SD6HC support - sdhci-cadence: Add Cadence SD6HC support - sdhci-msm: Add support for the MSM8952 and Maili variants - sdhci-msm: Use pm ops to better manage restoring of crypto keys - sdhci-of-dwcmshc: Disable CQE error halt request for Rockchip - sdhci-pxav3: Disable clock inversion for SD HS cards - sunplus: Fixup initialization for DDR modes - sunxi: Add support for Allwinner B288 - vub300: Remove the driver for the obsolete HW" * tag 'mmc-v7.4' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc: (43 commits) dt-bindings: mmc: sun4i-a10-mmc: add Allwinner B288 mmc: dw_mmc-rockchip: use a tighter per-command tuning timeout mmc: core: add mmc_send_tuning_timeout() mmc: sdhci-of-dwcmshc: Disable CQE error halt request for Rockchip dt-bindings: mmc: sdhci-msm: Add MSM8952 compatible mmc: use assign_bit() where applicable mmc: sdhci-pci: Replace deprecated PCI functions mmc: sunplus: initialise rd_crc_dly=1 for DDR modes mmc: core: fix stale mmc_start_req() references in comments docs: mmc: fix stale async request documentation docs: mmc: document eMMC health status support in mmc-tools mmc: cavium-thunderx: Drop redundant calls to get|put_device() mmc: core: Turn mmc_alloc|free_host() into static functions staging: greybus: sdio: Convert to devm_mmc_alloc_host() mmc: vub300: Remove the driver for the obsolete HW mmc: dw_mmc: remove unused slot member mmc: sdhci-pxav3: avoid of_node CREDITS: Add Pierre Ossman mmc: fix typos in comments mmc: meson-gx: enable the bus pipeline clock on T7 ...
Diffstat (limited to 'Documentation/driver-api')
-rw-r--r--Documentation/driver-api/mmc/mmc-async-req.rst64
-rw-r--r--Documentation/driver-api/mmc/mmc-tools.rst1
2 files changed, 14 insertions, 51 deletions
diff --git a/Documentation/driver-api/mmc/mmc-async-req.rst b/Documentation/driver-api/mmc/mmc-async-req.rst
index 0f7197c9c3b5..d9d4ac74b846 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);
diff --git a/Documentation/driver-api/mmc/mmc-tools.rst b/Documentation/driver-api/mmc/mmc-tools.rst
index eee1c2ccfa8f..728d3aa67eda 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.