[Letux-kernel] [BUG] mmc: core: adjust polling interval for CMD1

H. Nikolaus Schaller hns at goldelico.com
Wed Mar 2 10:40:25 CET 2022


Hi,

> Am 02.03.2022 um 09:20 schrieb Jean Rene Dawin <jdawin at math.uni-bielefeld.de>:
> 
> Ulf Hansson wrote on Tue  1/03/22 14:38:
>> On Thu, 17 Feb 2022 at 21:12, H. Nikolaus Schaller <hns at goldelico.com> wrote:
>>> 
>> 
>> From: Ulf Hansson <ulf.hansson at linaro.org>
>> Date: Tue, 1 Mar 2022 14:24:21 +0100
>> Subject: [PATCH] mmc: core: Extend timeout to 2s for MMC_SEND_OP_COND
>> 
>> It looks like the timeout for the MMC_SEND_OP_COND (CMD1) might have become
>> a bit too small due to recent changes. Therefore, let's extend it to 2s,
>> which is probably more inline with its previous value, to fix the reported
>> timeout problems.
>> 
>> While at it, let's add a define for the timeout value, rather than using
>> a hard-coded value for it.
>> 
>> Reported-by: Jean Rene Dawin <jdawin at math.uni-bielefeld.de>
>> Reported-by: H. Nikolaus Schaller <hns at goldelico.com>
>> Cc: Huijin Park <huijin.park at samsung.com>
>> Fixes: 76bfc7ccc2fa ("mmc: core: adjust polling interval for CMD1")
>> Signed-off-by: Ulf Hansson <ulf.hansson at linaro.org>
>> ---
>> drivers/mmc/core/mmc_ops.c | 4 +++-
>> 1 file changed, 3 insertions(+), 1 deletion(-)
>> 
>> diff --git a/drivers/mmc/core/mmc_ops.c b/drivers/mmc/core/mmc_ops.c
>> index d63d1c735335..1f57174b3cf3 100644
>> --- a/drivers/mmc/core/mmc_ops.c
>> +++ b/drivers/mmc/core/mmc_ops.c
>> @@ -21,6 +21,7 @@
>> 
>> #define MMC_BKOPS_TIMEOUT_MS           (120 * 1000) /* 120s */
>> #define MMC_SANITIZE_TIMEOUT_MS                (240 * 1000) /* 240s */
>> +#define MMC_OP_COND_TIMEOUT_MS         2000 /* 2s */
>> 
>> static const u8 tuning_blk_pattern_4bit[] = {
>>        0xff, 0x0f, 0xff, 0x00, 0xff, 0xcc, 0xc3, 0xcc,
>> @@ -232,7 +233,8 @@ int mmc_send_op_cond(struct mmc_host *host, u32
>> ocr, u32 *rocr)
>>        cmd.arg = mmc_host_is_spi(host) ? 0 : ocr;
>>        cmd.flags = MMC_RSP_SPI_R1 | MMC_RSP_R3 | MMC_CMD_BCR;
>> 
>> -       err = __mmc_poll_for_busy(host, 1000, &__mmc_send_op_cond_cb, &cb_data);
>> +       err = __mmc_poll_for_busy(host, MMC_OP_COND_TIMEOUT_MS,
>> +                                 &__mmc_send_op_cond_cb, &cb_data);
>>        if (err)
>>                return err;
>> 
>> -- 
>> 2.25.1
> 
> Hi,
> 
> thanks. But testing with this patch still gives the same errors:
> 
> [   52.259940] mmc1: Card stuck being busy! __mmc_poll_for_busy
> [   52.273380] mmc1: error -110 doing runtime resume
> 
> and the system gets stuck eventually.

Same result from my tests.

BR and thanks,
Nikolaus



More information about the Letux-kernel mailing list