diff options
author | Marcel Ziswiler <marcel.ziswiler@toradex.com> | 2017-11-29 13:54:42 +0100 |
---|---|---|
committer | Marcel Ziswiler <marcel.ziswiler@toradex.com> | 2017-11-29 13:54:42 +0100 |
commit | 5d1644bfc709bccb52317dff5439b97be68b8955 (patch) | |
tree | d9d24fb1affef33d49c253daa7f5a1fd02eb81d1 | |
parent | 65c8b4fda12bac74b660e55e8977ca6afad8a35e (diff) |
Revert "mmc: Allow forward compatibility for eMMC"
This reverts commit 0293e897d740cc7991c82567aab5dee0e66294fd.
Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Acked-by: Dominik Sliwa <dominik.sliwa@toradex.com>
-rw-r--r-- | drivers/mmc/core/mmc.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c index 6eb9a4ddcee8..2ed77066e8d6 100644 --- a/drivers/mmc/core/mmc.c +++ b/drivers/mmc/core/mmc.c @@ -293,12 +293,13 @@ static int mmc_read_ext_csd(struct mmc_card *card, u8 *ext_csd) } } - /* - * The EXT_CSD format is meant to be forward compatible. As long - * as CSD_STRUCTURE does not change, all values for EXT_CSD_REV - * are authorized, see JEDEC JESD84-B50 section B.8. - */ card->ext_csd.rev = ext_csd[EXT_CSD_REV]; + if (card->ext_csd.rev > 7) { + pr_err("%s: unrecognised EXT_CSD revision %d\n", + mmc_hostname(card->host), card->ext_csd.rev); + err = -EINVAL; + goto out; + } card->ext_csd.raw_sectors[0] = ext_csd[EXT_CSD_SEC_CNT + 0]; card->ext_csd.raw_sectors[1] = ext_csd[EXT_CSD_SEC_CNT + 1]; |