linux-mmc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch 039/177] mmc: only set blockaddressed for > 2GiB cards
@ 2010-08-11  1:01 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2010-08-11  1:01 UTC (permalink / raw)
  To: torvalds; +Cc: akpm, hanumath.prasad, linus.walleij, linux-mmc, rabin.vincent

From: Hanumath Prasad <hanumath.prasad@stericsson.com>

A non-zero value of SEC_COUNT does not indicate that the card is sector
addressed.  According to the MMC specification, cards with a density
greater than 2GiB are sector addressed.

Acked-by: Linus Walleij <linus.walleij@stericsson.com>
Signed-off-by: Hanumath Prasad <hanumath.prasad@stericsson.com>
Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com>
Cc: <linux-mmc@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 drivers/mmc/core/mmc.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

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);
 	}
 
_

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-08-11  1:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-11  1:01 [patch 039/177] mmc: only set blockaddressed for > 2GiB cards akpm

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).