Skip to content

Commit 65be3fe

Browse files
andy-shevcjb
authored andcommitted
mmc: sdhci: use f_max instead of host->clock for timeouts
When timeout_clk is calculated the host->clock could be zero. So, instead of host->clock the calculation now uses mmc->f_max. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Cc: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Chris Ball <cjb@laptop.org>
1 parent 272308c commit 65be3fe

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

‎drivers/mmc/host/sdhci.c‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2505,12 +2505,9 @@ int sdhci_add_host(struct sdhci_host *host)
25052505
host->timeout_clk *= 1000;
25062506

25072507
if (host->quirks & SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK)
2508-
host->timeout_clk = host->clock / 1000;
2508+
host->timeout_clk = mmc->f_max / 1000;
25092509

2510-
if (host->quirks & SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK)
2511-
mmc->max_discard_to = (1 << 27) / (mmc->f_max / 1000);
2512-
else
2513-
mmc->max_discard_to = (1 << 27) / host->timeout_clk;
2510+
mmc->max_discard_to = (1 << 27) / host->timeout_clk;
25142511

25152512
mmc->caps |= MMC_CAP_SDIO_IRQ | MMC_CAP_ERASE | MMC_CAP_CMD23;
25162513

0 commit comments

Comments
 (0)