Skip to content

Commit

Permalink
mmc: sdhci: specify maximum discard timeout
Browse files Browse the repository at this point in the history
In general, SDHC hardware timeout cannot be avoided.
Accordingly, the maximum timeout is specified to limit
the maximum discard size.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
  • Loading branch information
Adrian Hunter authored and Chris Ball committed Jul 20, 2011
1 parent e056a1b commit 58d1246
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/mmc/host/sdhci.c
Original file line number Diff line number Diff line change
Expand Up @@ -2509,6 +2509,11 @@ int sdhci_add_host(struct sdhci_host *host)
} else
mmc->f_min = host->max_clk / SDHCI_MAX_DIV_SPEC_200;

if (host->quirks & SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK)
mmc->max_discard_to = (1 << 27) / (mmc->f_max / 1000);
else
mmc->max_discard_to = (1 << 27) / host->timeout_clk;

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

if (host->quirks & SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12)
Expand Down

0 comments on commit 58d1246

Please sign in to comment.