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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




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@xxxxxxxxxxxxxxxxxxxx>
---

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



[Index of Archives]     [ARM Kernel]     [Linux ARM]     [Linux ARM MSM]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux