We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 89042df commit 2f9bef0Copy full SHA for 2f9bef0
drivers/mmc/core/mmc.c
@@ -279,8 +279,13 @@ static int mmc_read_ext_csd(struct mmc_card *card, u8 *ext_csd)
279
ext_csd[EXT_CSD_SEC_CNT + 3] << 24;
280
281
/* Cards with density > 2GiB are sector addressed */
282
- if (card->ext_csd.sectors > (2u * 1024 * 1024 * 1024) / 512)
+ if (card->ext_csd.sectors > (2u * 1024 * 1024 * 1024) / 512) {
283
+ unsigned boot_sectors;
284
+ /* size is in 256K chunks, i.e. 512 sectors each */
285
+ boot_sectors = ext_csd[EXT_CSD_BOOT_MULT] * 512;
286
+ card->ext_csd.sectors -= boot_sectors;
287
mmc_card_set_blockaddr(card);
288
+ }
289
}
290
card->ext_csd.raw_card_type = ext_csd[EXT_CSD_CARD_TYPE];
291
switch (ext_csd[EXT_CSD_CARD_TYPE] & EXT_CSD_CARD_TYPE_MASK) {
0 commit comments