diff options
| author | Ritesh Harjani <riteshh@codeaurora.org> | 2016-02-25 17:54:58 +0530 |
|---|---|---|
| committer | Subhash Jadavani <subhashj@codeaurora.org> | 2016-05-31 15:28:15 -0700 |
| commit | e4db7c6cf66a4a9bbb4e9657f6852ba4cdeef8fa (patch) | |
| tree | aea7542332284d14f029570ecee5c8822835d508 | |
| parent | a1202f10d990ac8d3be7471f4c415f2761a1e941 (diff) | |
mmc: block: Add quirk and increase read data timeout for hynix emmc
Hynix emmc cards are causing read data timeout.
Increase timeout value to max of 4sec and add card
quirk for all Hynix emmc cards.
Change-Id: I78637dc787964ec5cafe297587d6a12ecf1d31c6
Signed-off-by: Ritesh Harjani <riteshh@codeaurora.org>
| -rw-r--r-- | drivers/mmc/card/block.c | 7 | ||||
| -rw-r--r-- | drivers/mmc/core/core.c | 4 | ||||
| -rw-r--r-- | include/linux/mmc/card.h | 1 |
3 files changed, 11 insertions, 1 deletions
diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c index 74a7c6ca6826..71caa588a019 100644 --- a/drivers/mmc/card/block.c +++ b/drivers/mmc/card/block.c @@ -4111,6 +4111,13 @@ static const struct mmc_fixup blk_fixups[] = MMC_QUIRK_LONG_READ_TIME), /* + * Hynix eMMC cards need longer data read timeout than + * indicated in CSD. + */ + MMC_FIXUP(CID_NAME_ANY, CID_MANFID_HYNIX, CID_OEMID_ANY, add_quirk_mmc, + MMC_QUIRK_LONG_READ_TIME), + + /* * On these Samsung MoviNAND parts, performing secure erase or * secure trim can result in unrecoverable corruption due to a * firmware bug. diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index 13e06f96d0c9..65113800026c 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c @@ -1962,9 +1962,11 @@ void mmc_set_data_timeout(struct mmc_data *data, const struct mmc_card *card) * Address this by setting the read timeout to a "reasonably high" * value. For the cards tested, 300ms has proven enough. If necessary, * this value can be increased if other problematic cards require this. + * Certain Hynix 5.x cards giving read timeout even with 300ms. + * Increasing further to max value (4s). */ if (mmc_card_long_read_time(card) && data->flags & MMC_DATA_READ) { - data->timeout_ns = 300000000; + data->timeout_ns = 4000000000u; data->timeout_clks = 0; } diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h index 0f0c9963950e..8ebf9988b04e 100644 --- a/include/linux/mmc/card.h +++ b/include/linux/mmc/card.h @@ -486,6 +486,7 @@ struct mmc_fixup { #define CID_MANFID_MICRON 0x13 #define CID_MANFID_SAMSUNG 0x15 #define CID_MANFID_KINGSTON 0x70 +#define CID_MANFID_HYNIX 0x90 #define CID_MANFID_ANY (-1u) #define CID_OEMID_ANY ((unsigned short) -1) |
