Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 58d1246d authored by Adrian Hunter's avatar Adrian Hunter Committed by Chris Ball
Browse files

mmc: sdhci: specify maximum discard timeout



In general, SDHC hardware timeout cannot be avoided.
Accordingly, the maximum timeout is specified to limit
the maximum discard size.

Signed-off-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
Signed-off-by: default avatarChris Ball <cjb@laptop.org>
parent e056a1b5
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -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)