> -----Original Message-----
> From: Marek Vasut <marek.vasut+rene...@mailbox.org>
> Sent: 2023年6月20日 6:38
> To: u-boot@lists.denx.de
> Cc: Marek Vasut <marek.vasut+rene...@mailbox.org>; Ying-Chun Liu
> (PaulLiu) <paul....@linaro.org>; Hai Pham <hai.pham...@renesas.com>;
> Jaehoon Chung <jh80.ch...@samsung.com>; Loic Poulain
> <loic.poul...@linaro.org>; Peng Fan <peng....@nxp.com>; Simon Glass
> <s...@chromium.org>; Takeshi Kihara <takeshi.kihara...@renesas.com>
> Subject: [PATCH v3 1/3] mmc: Fix MMC_CMD_STOP_TRANSMISSION
> response type and add comment
> 
> For MMC/eMMC, the MMC_CMD_STOP_TRANSMISSION response is R1 for
> read transfers and R1b for write transfers per JEDEC Standard No. 84-B51
> Page 126 . The response is R1b unconditionally per Physical Layer Simplified
> Specification Version 9.00.
> 
> Correct the response type and add a comment about it.
> 
> Signed-off-by: Marek Vasut <marek.vasut+rene...@mailbox.org>
> ---
> V2: New patch
> V3: Account for SD case
> ---
> Cc: "Ying-Chun Liu (PaulLiu)" <paul....@linaro.org>
> Cc: Hai Pham <hai.pham...@renesas.com>
> Cc: Jaehoon Chung <jh80.ch...@samsung.com>
> Cc: Loic Poulain <loic.poul...@linaro.org>
> Cc: Peng Fan <peng....@nxp.com>
> Cc: Simon Glass <s...@chromium.org>
> Cc: Takeshi Kihara <takeshi.kihara...@renesas.com>
> ---
>  drivers/mmc/mmc.c | 11 ++++++++++-
>  1 file changed, 10 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c index
> 965bc8f0dba..38d85c71402 100644
> --- a/drivers/mmc/mmc.c
> +++ b/drivers/mmc/mmc.c
> @@ -427,7 +427,16 @@ static int mmc_read_blocks(struct mmc *mmc,
> void *dst, lbaint_t start,
>       if (blkcnt > 1) {
>               cmd.cmdidx = MMC_CMD_STOP_TRANSMISSION;
>               cmd.cmdarg = 0;
> -             cmd.resp_type = MMC_RSP_R1b;
> +             /*
> +              * JEDEC Standard No. 84-B51 Page 126
> +              * CMD12 STOP_TRANSMISSION R1/R1b[3]
> +              * NOTE 3 R1 for read cases and R1b for write cases.
> +              *
> +              * Physical Layer Simplified Specification Version 9.00
> +              * 7.3.1.3 Detailed Command Description
> +              * CMD12 R1b
> +              */
> +             cmd.resp_type = IS_SD(mmc) ? MMC_RSP_R1b :
> MMC_RSP_R1;
>               if (mmc_send_cmd(mmc, &cmd, NULL)) {
>  #if !defined(CONFIG_SPL_BUILD) ||
> defined(CONFIG_SPL_LIBCOMMON_SUPPORT)
>                       pr_err("mmc fail to send stop cmd\n");

Reviewed-by: Peng Fan <peng....@nxp.com>
> --
> 2.39.2

Reply via email to