Commit 836dc2fe authored by Philip Rakity's avatar Philip Rakity Committed by Chris Ball

mmc: core: Fix bit width test failing on old eMMC cards

PARTITION_SUPPORT needs to be set before doing the compare on version
number so the bit width test does not get invalid data.  Before this
patch, a Sandisk iNAND eMMC card would detect 1-bit width although
the hardware supports 4-bit.

Only affects old emmc devices - pre 4.4 devices.
Reported-by: default avatarElad Yi <elad.yi@gmail.com>
Signed-off-by: default avatarPhilip Rakity <prakity@yahoo.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: default avatarChris Ball <cjb@laptop.org>
parent 8e1c4e4d
...@@ -369,13 +369,13 @@ static int mmc_read_ext_csd(struct mmc_card *card, u8 *ext_csd) ...@@ -369,13 +369,13 @@ static int mmc_read_ext_csd(struct mmc_card *card, u8 *ext_csd)
ext_csd[EXT_CSD_SEC_FEATURE_SUPPORT]; ext_csd[EXT_CSD_SEC_FEATURE_SUPPORT];
card->ext_csd.raw_trim_mult = card->ext_csd.raw_trim_mult =
ext_csd[EXT_CSD_TRIM_MULT]; ext_csd[EXT_CSD_TRIM_MULT];
card->ext_csd.raw_partition_support = ext_csd[EXT_CSD_PARTITION_SUPPORT];
if (card->ext_csd.rev >= 4) { if (card->ext_csd.rev >= 4) {
/* /*
* Enhanced area feature support -- check whether the eMMC * Enhanced area feature support -- check whether the eMMC
* card has the Enhanced area enabled. If so, export enhanced * card has the Enhanced area enabled. If so, export enhanced
* area offset and size to user by adding sysfs interface. * area offset and size to user by adding sysfs interface.
*/ */
card->ext_csd.raw_partition_support = ext_csd[EXT_CSD_PARTITION_SUPPORT];
if ((ext_csd[EXT_CSD_PARTITION_SUPPORT] & 0x2) && if ((ext_csd[EXT_CSD_PARTITION_SUPPORT] & 0x2) &&
(ext_csd[EXT_CSD_PARTITION_ATTRIBUTE] & 0x1)) { (ext_csd[EXT_CSD_PARTITION_ATTRIBUTE] & 0x1)) {
hc_erase_grp_sz = hc_erase_grp_sz =
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment