From nobody Fri Sep 25 03:17:45 2026 Received: from mail-m3299.qiye.163.com (mail-m3299.qiye.163.com [220.197.32.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B373149B459; Thu, 17 Sep 2026 09:04:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=220.197.32.99 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789635865; cv=none; b=btBlOISGo+lVJUdXCaiDH/vnsVoxMw6GCfQG3GVENEquwPFu7ZVr7YfiZ7YoIMWt850FvA04NXx4iyjbY0HqoRom73XhO7vbbzdZ9vNQYrAF/tf+u8gXhFVy9Q0yiMARijxFuck6o8FBcsZ6ZxyMO0lnOd/kbupM9CQ/28GB7y4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789635865; c=relaxed/simple; bh=Rcrd5CQuFqJV2HtJdDxzBX0cfsc/fuUn4FclhcQuH2g=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=a3XhZCL9cF/R+VgC9i+lQ4FYsLtC+7LX0a5vEczS6VnWwgBvWeMWQE0M9DOkm0SgB8La8yT6eSbmzgtml7BgbgS67DfmPu0ErXwd4fgE3OXUwd51F4kAbLrM2wJL1s7N2MQczsUQlcbF3ElGlDE0+i5HpO+qS6dxOS8W9uwdmdY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=rock-chips.com; spf=pass smtp.mailfrom=rock-chips.com; dkim=pass (1024-bit key) header.d=rock-chips.com header.i=@rock-chips.com header.b=T4CJ/OvA; arc=none smtp.client-ip=220.197.32.99 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=rock-chips.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=rock-chips.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=rock-chips.com header.i=@rock-chips.com header.b="T4CJ/OvA" Received: from localhost.localdomain (unknown [58.22.7.114]) by smtp.qiye.163.com (Hmail) with ESMTP id 4e2034817; Thu, 17 Sep 2026 16:48:51 +0800 (GMT+08:00) From: Shawn Lin To: Ulf Hansson Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, Shawn Lin Subject: [PATCH 1/3] docs: mmc: document eMMC health status support in mmc-tools Date: Thu, 17 Sep 2026 16:48:35 +0800 Message-Id: <1789634917-143165-2-git-send-email-shawn.lin@rock-chips.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1789634917-143165-1-git-send-email-shawn.lin@rock-chips.com> References: <1789634917-143165-1-git-send-email-shawn.lin@rock-chips.com> X-HM-Tid: 0aa0ae8de9a203a4kunm476cf0c89835e X-HM-MType: 1 X-HM-Spam-Status: e1kfGhgUHx5ZQUpXWQgPGg8OCBgUHx5ZQUlOS1dZFg8aDwILHllBWSg2Ly tZV1koWUFDSUNOT01LS0k3V1kYFggdWUFKV1ktWUFJV1kPCRoVCBIfWUFZQ0hCTlYdSUlIGR0aTB 0ZGUNWFRQJFhoXVRMBExYaEhckFA4PWVdZGBILWUFZTkNVSUlVTFVKSk9ZV1kWGg8SFR0UWUFZT0 tIVUpLSU9PT0hVSktLVUpCS0tZBg++ DKIM-Signature: a=rsa-sha256; b=T4CJ/OvARSknN0031K/AL9dG3zC5BKOMQKbBTUJ2HjibxEeibsv6jZtWhq+34k2OUa+m7XAduiuf82Me91/UB+Qcq4AKdBziNRpNR373m6i6H7IRYIj4XLiR6CbKCZtElhxSb/E2bQaro1OrAIUXR5qPqjbH4h6R7gNaC5QkSI0=; s=default; c=relaxed/relaxed; d=rock-chips.com; v=1; bh=x9nw84dgY4KGqpe+l4fzVDV8jyMGMJi6ktFWuzjfqSw=; h=date:mime-version:subject:message-id:from; Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Shawn Lin mmc-utils added eMMC health status support, add a line for reference. Signed-off-by: Shawn Lin --- 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/dri= ver-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. --=20 2.7.4 From nobody Fri Sep 25 03:17:45 2026 Received: from mail-m49239.qiye.163.com (mail-m49239.qiye.163.com [45.254.49.239]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CB79A4BA9F2; Thu, 17 Sep 2026 10:04:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.254.49.239 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789639504; cv=none; b=rAaYBUNWDB7d/ZLXF0jjyXe5eA86bGvwPS5m5bWoxuBl7WDSx74szl1xLZ6YxkRKcN6DGDVNu1dMztJRUqLzolNmvJLLvIFOR+ZbfmKfwIi5jyc+2PrHbsoO1plC4n70U4kxNlZ46ad9+7hg7z0LFza1H20l6oESQOpqSWZ1jsM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789639504; c=relaxed/simple; bh=XN48dGpTYdwidGnJPBmKoAFR+QOJxwtxfRmPsyJBTi4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=OrFtuf3NBOlCebNutDZ+pO/uQWcoovr6UbY5E9mSI45PRhW+iXmXrqZW9FKNsw+0TDDmY+kmLrJKv+xg5QkgE+OqWVFnTzv3qhl/BchmvjdOZn2vjoY/KDbsrPSQ9KFpA8UmolntpDPOWszFn8cksbM222geJNy0qiZrU5o74+4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=rock-chips.com; spf=pass smtp.mailfrom=rock-chips.com; dkim=pass (1024-bit key) header.d=rock-chips.com header.i=@rock-chips.com header.b=fKyMcQn2; arc=none smtp.client-ip=45.254.49.239 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=rock-chips.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=rock-chips.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=rock-chips.com header.i=@rock-chips.com header.b="fKyMcQn2" Received: from localhost.localdomain (unknown [58.22.7.114]) by smtp.qiye.163.com (Hmail) with ESMTP id 4e203484a; Thu, 17 Sep 2026 16:48:59 +0800 (GMT+08:00) From: Shawn Lin To: Ulf Hansson Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, Shawn Lin Subject: [PATCH 2/3] docs: mmc: fix stale async request documentation Date: Thu, 17 Sep 2026 16:48:36 +0800 Message-Id: <1789634917-143165-3-git-send-email-shawn.lin@rock-chips.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1789634917-143165-1-git-send-email-shawn.lin@rock-chips.com> References: <1789634917-143165-1-git-send-email-shawn.lin@rock-chips.com> X-HM-Tid: 0aa0ae8e091003a4kunm476cf0c8983b4 X-HM-MType: 1 X-HM-Spam-Status: e1kfGhgUHx5ZQUpXWQgPGg8OCBgUHx5ZQUlOS1dZFg8aDwILHllBWSg2Ly tZV1koWUFDSUNOT01LS0k3V1kYFggdWUFKV1ktWUFJV1kPCRoVCBIfWUFZGRodTVZLTElLTk1PQk kYH09WFRQJFhoXVRMBExYaEhckFA4PWVdZGBILWUFZTkNVSUlVTFVKSk9ZV1kWGg8SFR0UWUFZT0 tIVUpLSU9PT0hVSktLVUpCS0tZBg++ DKIM-Signature: a=rsa-sha256; b=fKyMcQn2a1i8eSBRL8iadsMOe058dmz/CjwIAPtZRS3ADpHyZtDolBmEUq3rfX31tqeq3O8cH6Iwya6aaDzTGbYbSouYESTOw+kuxLBrAPPTbMc6Z6AoTDVoyY/EJbWWIJcU6wyrdPCQplwImmQLDSFlQ8x1kI8UigJ7YYkwOV4=; s=default; c=relaxed/relaxed; d=rock-chips.com; v=1; bh=loyEuDZ5PGTOg02RYKxKU5VNnLeScMXNhADO2TWHIGA=; h=date:mime-version:subject:message-id:from; Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Shawn Lin 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 supp= ort") and 126b62700386 ("mmc: core: Remove code no longer needed after the swit= ch 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-reques= t 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 s= ections describing the long-gone interfaces and the dead link. Signed-off-by: Shawn Lin --- 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 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =20 -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. =20 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 lowe= r frequency, the DMA preparation may cost even more. As long as these slower preparations are r= un in parallel with the transfer performance won't be affected. =20 -Details on measurements from IOZone and mmc_test -=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +MMC core API +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =20 -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: =20 -MMC core API extension -=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D - -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. =20 MMC host extensions =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D @@ -59,40 +58,3 @@ to before and after the actual mmc_host_ops.request() fu= nction is called. =20 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 -=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D - -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); --=20 2.7.4 From nobody Fri Sep 25 03:17:45 2026 Received: from mail-aws33103.qiye.163.com (mail-aws33103.qiye.163.com [54.168.33.103]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5C7693DAACE; Thu, 17 Sep 2026 16:45:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=54.168.33.103 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789663550; cv=none; b=Bd54GmC+vHdtMBAp52LvEDgNX+dAxVTXXy/3/VMZNQLWQrRiEDp2sz+3gyi/6zcLPGlYyW3pelomVvqAH8msAeJ+kEhAG0ITw+fdPa1cFqSA+3bF9b7qrr6sgUINg0pt7dgH9RR8QnGYFjyZtD7c5PGLaeIFLf3Mjuhx1Niqa3w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789663550; c=relaxed/simple; bh=ybUw/VAHJ34uriUZtpn0bT3L0WPyk0v+DTnIOENRITc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=cDXC0RwQC9s572fbrPs9eXGlNYUOcV9V4iZmEB2Ce0egls0V7yGjGl5Au8AMYX/coFOgXXuaxU5xC6IAHMgQRpcz50u4kTuKUADyQ9iU4deqaJiETISr/V7QCcRhotIaN4AbkXb8xRv5TF5weJpzRDmJ9WfQEZrjQQt5qUSEYCI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=rock-chips.com; spf=pass smtp.mailfrom=rock-chips.com; dkim=pass (1024-bit key) header.d=rock-chips.com header.i=@rock-chips.com header.b=AJBIpqTB; arc=none smtp.client-ip=54.168.33.103 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=rock-chips.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=rock-chips.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=rock-chips.com header.i=@rock-chips.com header.b="AJBIpqTB" Received: from localhost.localdomain (unknown [58.22.7.114]) by smtp.qiye.163.com (Hmail) with ESMTP id 4e203485e; Thu, 17 Sep 2026 16:49:01 +0800 (GMT+08:00) From: Shawn Lin To: Ulf Hansson Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, Shawn Lin Subject: [PATCH 3/3] mmc: core: fix stale mmc_start_req() references in comments Date: Thu, 17 Sep 2026 16:48:37 +0800 Message-Id: <1789634917-143165-4-git-send-email-shawn.lin@rock-chips.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1789634917-143165-1-git-send-email-shawn.lin@rock-chips.com> References: <1789634917-143165-1-git-send-email-shawn.lin@rock-chips.com> X-HM-Tid: 0aa0ae8e123003a4kunm476cf0c8983d6 X-HM-MType: 1 X-HM-Spam-Status: e1kfGhgUHx5ZQUpXWQgPGg8OCBgUHx5ZQUlOS1dZFg8aDwILHllBWSg2Ly tZV1koWUFDSUNOT01LS0k3V1kYFggdWUFKV1ktWUFJV1kPCRoVCBIfWUFZQhoeSFZDQkNMGEMaGk xPHk5WFRQJFhoXVRMBExYaEhckFA4PWVdZGBILWUFZTkNVSUlVTFVKSk9ZV1kWGg8SFR0UWUFZT0 tIVUpLSU9PT0hVSktLVUpCS0tZBg++ DKIM-Signature: a=rsa-sha256; b=AJBIpqTB66BmBkvQGDaS6nhAmkGwXURz4jekSHHbDQAOcxRTSzXCcTZXkQcCWBLmhg2lsVTmBFOwnVAHPqwy/WRq0QrsOgRK+gqL3NTeEQsOeelbHPLRKXm5IEZpR1JCbXoxJRoDljZjP0w7d1UBtrwflykP9DMGvVwvQGJYd0Y=; s=default; c=relaxed/relaxed; d=rock-chips.com; v=1; bh=/k6J3dxPvPltz/ZMrbyXh8Ewz7+GFZJ0zTlamg5BQ3Q=; h=date:mime-version:subject:message-id:from; Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Shawn Lin 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 --- 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 =3D 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. */ --=20 2.7.4