Message ID | 20230614134237.18468-1-marek.vasut+renesas@mailbox.org |
---|---|
State | Superseded |
Delegated to: | Jaehoon Chung |
Headers | show |
Series | [v2,1/3] mmc: Fix MMC_CMD_STOP_TRANSMISSION response type and add comment | expand |
On 6/14/2023 9:42 PM, Marek Vasut wrote: > Caution: This is an external email. Please take care when clicking links or opening attachments. When in doubt, report the message using the 'Report this email' button > > > The MMC_CMD_STOP_TRANSMISSION response is R1 for read transfers > per JEDEC Standard No. 84-B51 Page 126 . Correct the response > type and add a comment about it. Sorry, I may miss one point. CMD12 for SD is R1b. But CMD12 for eMMC is R1 and R1b. I am not sure how we should do with current code. Thanks, Peng. > > Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> > --- > V2: New patch > --- > Cc: "Ying-Chun Liu (PaulLiu)" <paul.liu@linaro.org> > Cc: Hai Pham <hai.pham.ud@renesas.com> > Cc: Jaehoon Chung <jh80.chung@samsung.com> > Cc: Loic Poulain <loic.poulain@linaro.org> > Cc: Peng Fan <peng.fan@nxp.com> > Cc: Simon Glass <sjg@chromium.org> > Cc: Takeshi Kihara <takeshi.kihara.df@renesas.com> > --- > drivers/mmc/mmc.c | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c > index 965bc8f0dba..f9b2f940389 100644 > --- a/drivers/mmc/mmc.c > +++ b/drivers/mmc/mmc.c > @@ -427,7 +427,12 @@ 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. > + */ > + cmd.resp_type = 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"); > -- > 2.39.2 >
diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c index 965bc8f0dba..f9b2f940389 100644 --- a/drivers/mmc/mmc.c +++ b/drivers/mmc/mmc.c @@ -427,7 +427,12 @@ 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. + */ + cmd.resp_type = 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");
The MMC_CMD_STOP_TRANSMISSION response is R1 for read transfers per JEDEC Standard No. 84-B51 Page 126 . Correct the response type and add a comment about it. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> --- V2: New patch --- Cc: "Ying-Chun Liu (PaulLiu)" <paul.liu@linaro.org> Cc: Hai Pham <hai.pham.ud@renesas.com> Cc: Jaehoon Chung <jh80.chung@samsung.com> Cc: Loic Poulain <loic.poulain@linaro.org> Cc: Peng Fan <peng.fan@nxp.com> Cc: Simon Glass <sjg@chromium.org> Cc: Takeshi Kihara <takeshi.kihara.df@renesas.com> --- drivers/mmc/mmc.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)