From 90f82a4fe799dd7ca2b511dbcffa6fbf12541e98 Mon Sep 17 00:00:00 2001 From: lin tao Date: Fri, 1 Nov 2013 15:19:13 +0800 Subject: [PATCH] mmc: core: sd: fix sd physical layer version 3.0 or above max AU from size 4MB (0x9) to 64MB (0xF) --- drivers/mmc/core/sd.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c index 57618f9e8c21..2ffe1690f9b5 100755 --- a/drivers/mmc/core/sd.c +++ b/drivers/mmc/core/sd.c @@ -215,7 +215,7 @@ static int mmc_decode_scr(struct mmc_card *card) static int mmc_read_ssr(struct mmc_card *card) { unsigned int au, es, et, eo; - int err, i; + int err, i, max_au; u32 *ssr; if (!(card->csd.cmdclass & CCC_APP_SPEC)) { @@ -239,13 +239,14 @@ static int mmc_read_ssr(struct mmc_card *card) for (i = 0; i < 16; i++) ssr[i] = be32_to_cpu(ssr[i]); + max_au = card->scr.sda_spec3 ? 0xF : 0x9; /* * UNSTUFF_BITS only works with four u32s so we have to offset the * bitfield positions accordingly. */ au = UNSTUFF_BITS(ssr, 428 - 384, 4); //if (au > 0 || au <= 9) { //Modifyed by xbw at 2013-02-28 - if (au > 0 && au <= 9) { + if (au > 0 && au <= max_au) { card->ssr.au = 1 << (au + 4); es = UNSTUFF_BITS(ssr, 408 - 384, 16); et = UNSTUFF_BITS(ssr, 402 - 384, 6); -- 2.34.1