Skip to content

Commit ad91619

Browse files
committed
mmc: block: Use generic_cmd6_time when modifying INAND_CMD38_ARG_EXT_CSD
The INAND_CMD38_ARG_EXT_CSD is a vendor specific EXT_CSD register, which is used to prepare an erase/trim operation. However, it doesn't make sense to use a timeout of 10 minutes while updating the register, which becomes the case when the timeout_ms argument for mmc_switch() is set to zero. Instead, let's use the generic_cmd6_time, as that seems like a reasonable timeout to use for these cases. Signed-off-by: Ulf Hansson <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 24ed3bd commit ad91619

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/mmc/core/block.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1107,7 +1107,7 @@ static void mmc_blk_issue_discard_rq(struct mmc_queue *mq, struct request *req)
11071107
card->erase_arg == MMC_TRIM_ARG ?
11081108
INAND_CMD38_ARG_TRIM :
11091109
INAND_CMD38_ARG_ERASE,
1110-
0);
1110+
card->ext_csd.generic_cmd6_time);
11111111
}
11121112
if (!err)
11131113
err = mmc_erase(card, from, nr, card->erase_arg);
@@ -1149,7 +1149,7 @@ static void mmc_blk_issue_secdiscard_rq(struct mmc_queue *mq,
11491149
arg == MMC_SECURE_TRIM1_ARG ?
11501150
INAND_CMD38_ARG_SECTRIM1 :
11511151
INAND_CMD38_ARG_SECERASE,
1152-
0);
1152+
card->ext_csd.generic_cmd6_time);
11531153
if (err)
11541154
goto out_retry;
11551155
}
@@ -1167,7 +1167,7 @@ static void mmc_blk_issue_secdiscard_rq(struct mmc_queue *mq,
11671167
err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
11681168
INAND_CMD38_ARG_EXT_CSD,
11691169
INAND_CMD38_ARG_SECTRIM2,
1170-
0);
1170+
card->ext_csd.generic_cmd6_time);
11711171
if (err)
11721172
goto out_retry;
11731173
}

0 commit comments

Comments
 (0)