summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMario Schuknecht <[email protected]>2014-09-30 17:04:42 +0200
committerPantelis Antoniou <[email protected]>2014-10-03 17:26:50 +0300
commit786a27b7ec9efd1ebf50008050e3cff9ce458198 (patch)
tree855509aef2abd6f1ff9ad02caa2af88f9fadb1b1
parentbcd06989b860c691f5afbd1c03d1b0d9e9970cdc (diff)
mmc: Fix mmc bus width
After setting the bus width, the extended CSD register is read. Some selected fields are compared with previously read extended CSD register fields. In this comparison the EXT_CSD_ERASE_GROUP_DEF field is compared. But this field is previously written under certain circumstances. And then the comparison fails. Only compare read-only fields. Therefore compare field EXT_CSD_HC_WP_GRP_SIZE instead of field EXT_CSD_ERASE_GROUP_DEF. Signed-off-by: Mario Schuknecht <[email protected]> Acked-by: Pantelis Antoniou <[email protected]>
-rw-r--r--drivers/mmc/mmc.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index e4a28d4b4ae..44a4feb96e0 100644
--- a/drivers/mmc/mmc.c
+++ b/drivers/mmc/mmc.c
@@ -1134,10 +1134,11 @@ static int mmc_startup(struct mmc *mmc)
mmc_set_bus_width(mmc, widths[idx]);
err = mmc_send_ext_csd(mmc, test_csd);
+ /* Only compare read only fields */
if (!err && ext_csd[EXT_CSD_PARTITIONING_SUPPORT] \
== test_csd[EXT_CSD_PARTITIONING_SUPPORT]
- && ext_csd[EXT_CSD_ERASE_GROUP_DEF] \
- == test_csd[EXT_CSD_ERASE_GROUP_DEF] \
+ && ext_csd[EXT_CSD_HC_WP_GRP_SIZE] \
+ == test_csd[EXT_CSD_HC_WP_GRP_SIZE] \
&& ext_csd[EXT_CSD_REV] \
== test_csd[EXT_CSD_REV]
&& ext_csd[EXT_CSD_HC_ERASE_GRP_SIZE] \