diff mbox

[039/177] mmc: only set blockaddressed for > 2GiB cards

Message ID 201008110101.o7B11jUT027061@imap1.linux-foundation.org (mailing list archive)
State Accepted, archived
Headers show

Commit Message

Andrew Morton Aug. 11, 2010, 1:01 a.m. UTC
None
diff mbox

Patch

diff -puN drivers/mmc/core/mmc.c~mmc-only-set-blockaddressed-for-2gib-cards drivers/mmc/core/mmc.c
--- a/drivers/mmc/core/mmc.c~mmc-only-set-blockaddressed-for-2gib-cards
+++ a/drivers/mmc/core/mmc.c
@@ -234,7 +234,9 @@  static int mmc_read_ext_csd(struct mmc_c
 			ext_csd[EXT_CSD_SEC_CNT + 1] << 8 |
 			ext_csd[EXT_CSD_SEC_CNT + 2] << 16 |
 			ext_csd[EXT_CSD_SEC_CNT + 3] << 24;
-		if (card->ext_csd.sectors)
+
+		/* Cards with density > 2GiB are sector addressed */
+		if (card->ext_csd.sectors > (2u * 1024 * 1024 * 1024) / 512)
 			mmc_card_set_blockaddr(card);
 	}