Skip to content

Commit 02fcf9c

Browse files
Andy-ld Lustorulf
authored andcommitted
mmc: mtk-sd: Add support for ignoring cmd response CRC
The current process flow does not handle MMC requests that are indicated to ignore the command response CRC. For instance, cmd12 and cmd48 from mmc_cqe_recovery() are marked to ignore CRC, but they are not matched to the appropriate response type in msdc_cmd_find_resp(). As a result, they are defaulted to 'MMC_RSP_NONE', which means no response is expected. This commit applies the flag 'MMC_RSP_R1B_NO_CRC' to fix the response type setting in msdc_cmd_find_resp() and adds the logic to ignore CRC in msdc_cmd_done(). Reviewed-by: AngeloGioacchino Del Regno <[email protected]> Signed-off-by: Andy-ld Lu <[email protected]> Message-ID: <[email protected]> Signed-off-by: Ulf Hansson <[email protected]>
1 parent ed97550 commit 02fcf9c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/mmc/host/mtk-sd.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1097,11 +1097,12 @@ static inline u32 msdc_cmd_find_resp(struct msdc_host *host,
10971097
u32 resp;
10981098

10991099
switch (mmc_resp_type(cmd)) {
1100-
/* Actually, R1, R5, R6, R7 are the same */
1100+
/* Actually, R1, R5, R6, R7 are the same */
11011101
case MMC_RSP_R1:
11021102
resp = 0x1;
11031103
break;
11041104
case MMC_RSP_R1B:
1105+
case MMC_RSP_R1B_NO_CRC:
11051106
resp = 0x7;
11061107
break;
11071108
case MMC_RSP_R2:
@@ -1351,7 +1352,8 @@ static bool msdc_cmd_done(struct msdc_host *host, int events,
13511352
* CRC error.
13521353
*/
13531354
msdc_reset_hw(host);
1354-
if (events & MSDC_INT_RSPCRCERR) {
1355+
if (events & MSDC_INT_RSPCRCERR &&
1356+
mmc_resp_type(cmd) != MMC_RSP_R1B_NO_CRC) {
13551357
cmd->error = -EILSEQ;
13561358
host->error |= REQ_CMD_EIO;
13571359
} else if (events & MSDC_INT_CMDTMO) {

0 commit comments

Comments
 (0)