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

Commit 8c4feb67 authored by Asutosh Das's avatar Asutosh Das
Browse files

mmc: core: increase data-timeout value for Hynix cards



Add a quirk to increase the data-timeout value for Hynix eMMC
cards only. This value is fixed to a maximum of 4 seconds.

Change-Id: I4bca6cbc877b323b29a3f7f5923d0708c48adf2c
CRs-fixed: 587284
Signed-off-by: default avatarAsutosh Das <asutoshd@codeaurora.org>
parent ca6129fc
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -3151,6 +3151,8 @@ static const struct mmc_fixup blk_fixups[] =
		  MMC_QUIRK_SEC_ERASE_TRIM_BROKEN),
	MMC_FIXUP("VZL00M", CID_MANFID_SAMSUNG, CID_OEMID_ANY, add_quirk_mmc,
		  MMC_QUIRK_SEC_ERASE_TRIM_BROKEN),
	MMC_FIXUP(CID_NAME_ANY, CID_MANFID_HYNIX, CID_OEMID_ANY, add_quirk_mmc,
		  MMC_QUIRK_BROKEN_DATA_TIMEOUT),

	/* Some INAND MCP devices advertise incorrect timeout values */
	MMC_FIXUP("SEM04G", 0x45, CID_OEMID_ANY, add_quirk_mmc,
+5 −0
Original line number Diff line number Diff line
@@ -1341,6 +1341,11 @@ void mmc_set_data_timeout(struct mmc_data *data, const struct mmc_card *card)
		data->timeout_ns = 4000000000u; /* 4s */
		data->timeout_clks = 0;
	}
	/* Some emmc cards require a longer read/write time */
	if (card->quirks & MMC_QUIRK_BROKEN_DATA_TIMEOUT) {
		if (data->timeout_ns <  4000000000u)
			data->timeout_ns = 4000000000u;	/* 4s */
	}
}
EXPORT_SYMBOL(mmc_set_data_timeout);

+3 −0
Original line number Diff line number Diff line
@@ -354,6 +354,9 @@ struct mmc_card {
#define MMC_QUIRK_INAND_DATA_TIMEOUT  (1<<11)   /* For incorrect data timeout */
/* To avoid eMMC device getting broken permanently due to HPI feature */
#define MMC_QUIRK_BROKEN_HPI (1 << 12)
 /* Skip data-timeout advertised by card */
#define MMC_QUIRK_BROKEN_DATA_TIMEOUT	(1<<13)


	unsigned int		erase_size;	/* erase size in sectors */
 	unsigned int		erase_shift;	/* if erase unit is power 2 */