Re: [RFC PATCH] mmc: sdhci: tegra: fix wrong unit with busy_timeout

Sowjanya Komatineni
2020-11-13T18:34:27Z

On 11/13/20 8:38 AM, Thierry Reding wrote:
> On Fri, Nov 13, 2020 at 01:53:30PM +0100, Wolfram Sang wrote:
>> 'busy_timeout' is in msecs, not in jiffies. Use the correct factor.
>>
>> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
>> ---
>>
>> Not tested. Found by code investigation about 'busy_timeout'. A quick
>> grep showed no other problematic code within the MMC host drivers.
>>
>> drivers/mmc/host/sdhci-tegra.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
> Sowjanya, can you take a look at this?
>
> Thierry

Thanks Wolfram.

Right cmd busy_timeout is in msec and we have to enable
ERASE_TIMEOUT_LIMIT bit for more than 11s busy operations.

So it should be MSEC_PER_SEC.

>
>> diff --git a/drivers/mmc/host/sdhci-tegra.c b/drivers/mmc/host/sdhci-tegra.c
>> index ed12aacb1c73..ad0dc3adc7d1 100644
>> --- a/drivers/mmc/host/sdhci-tegra.c
>> +++ b/drivers/mmc/host/sdhci-tegra.c
>> @@ -1272,7 +1272,7 @@ static void tegra_sdhci_set_timeout(struct sdhci_host *host,
>> * busy wait mode.
>> */
>> val = sdhci_readl(host, SDHCI_TEGRA_VENDOR_MISC_CTRL);
>> - if (cmd && cmd->busy_timeout >= 11 * HZ)
>> + if (cmd && cmd->busy_timeout >= 11 * MSECS_PER_SEC)
>> val |= SDHCI_MISC_CTRL_ERASE_TIMEOUT_LIMIT;
>> else
>> val &= ~SDHCI_MISC_CTRL_ERASE_TIMEOUT_LIMIT;
>> --
>> 2.28.0