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

Commit cb0f99b5 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "mmc: quirks: Fix data timeout values for certain vendor eMMC cards"

parents d137e7f9 18545228
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -1639,6 +1639,11 @@ void mmc_set_data_timeout(struct mmc_data *data, const struct mmc_card *card)
				data->timeout_ns =  100000000;	/* 100ms */
		}
	}
	/* Increase the timeout values for some bad INAND MCP devices */
	if (card->quirks & MMC_QUIRK_INAND_DATA_TIMEOUT) {
		data->timeout_ns = 4000000000u; /* 4s */
		data->timeout_clks = 0;
	}
}
EXPORT_SYMBOL(mmc_set_data_timeout);

+4 −0
Original line number Diff line number Diff line
@@ -113,6 +113,10 @@ static const struct mmc_fixup mmc_blk_fixups[] = {
	MMC_FIXUP("V10016", CID_MANFID_KINGSTON, CID_OEMID_ANY, add_quirk_mmc,
		  MMC_QUIRK_TRIM_BROKEN),

	/* Some INAND MCP devices advertise incorrect timeout values */
	MMC_FIXUP("SEM04G", 0x45, CID_OEMID_ANY, add_quirk_mmc,
		  MMC_QUIRK_INAND_DATA_TIMEOUT),

	END_FIXUP
};

+6 −0
Original line number Diff line number Diff line
@@ -894,6 +894,12 @@ static u8 sdhci_calc_timeout(struct sdhci_host *host, struct mmc_command *cmd,
	if (!data && !cmd->busy_timeout)
		return 0xE;

	/* During initialization, don't use max timeout as the clock is slow */
	if ((host->quirks2 & SDHCI_QUIRK2_USE_RESERVED_MAX_TIMEOUT) &&
		(host->clock > 400000)) {
		return 0xF;
	}

	/* timeout in us */
	target_timeout = sdhci_target_timeout(host, cmd, data);