From: Hanumath Prasad Date: Wed, 11 Aug 2010 01:01:45 +0000 (-0700) Subject: mmc: only set blockaddressed for > 2GiB cards X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=fc8a0985c2846292312556cba10b8a4182f55967;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git mmc: only set blockaddressed for > 2GiB cards 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 Signed-off-by: Hanumath Prasad Signed-off-by: Rabin Vincent Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c index cd8d3d2ea901..ccba3869c029 100644 --- a/drivers/mmc/core/mmc.c +++ b/drivers/mmc/core/mmc.c @@ -234,7 +234,9 @@ static int mmc_read_ext_csd(struct mmc_card *card) 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); }