Skip to content

Commit 1314d7a

Browse files
beanhuogregkh
authored andcommitted
mmc: core: Allows to override the timeout value for ioctl() path
commit 23e09be upstream. Occasionally, user-land applications initiate longer timeout values for certain commands through ioctl() system call. But so far we are still using a fixed timeout of 10 seconds in mmc_poll_for_busy() on the ioctl() path, even if a custom timeout is specified in the userspace application. This patch allows custom timeout values to override this default timeout values on the ioctl path. Cc: stable <[email protected]> Signed-off-by: Bean Huo <[email protected]> Acked-by: Avri Altman <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Ulf Hansson <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent ef5ab2e commit 1314d7a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/mmc/core/block.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -609,11 +609,11 @@ static int __mmc_blk_ioctl_cmd(struct mmc_card *card, struct mmc_blk_data *md,
609609

610610
if (idata->rpmb || (cmd.flags & MMC_RSP_R1B) == MMC_RSP_R1B) {
611611
/*
612-
* Ensure RPMB/R1B command has completed by polling CMD13
613-
* "Send Status".
612+
* Ensure RPMB/R1B command has completed by polling CMD13 "Send Status". Here we
613+
* allow to override the default timeout value if a custom timeout is specified.
614614
*/
615-
err = mmc_poll_for_busy(card, MMC_BLK_TIMEOUT_MS, false,
616-
MMC_BUSY_IO);
615+
err = mmc_poll_for_busy(card, idata->ic.cmd_timeout_ms ? : MMC_BLK_TIMEOUT_MS,
616+
false, MMC_BUSY_IO);
617617
}
618618

619619
return err;

0 commit comments

Comments
 (0)