diff options
author | Wolfram Sang <wsa+renesas@sang-engineering.com> | 2016-05-09 03:59:59 -0400 |
---|---|---|
committer | Ulf Hansson <ulf.hansson@linaro.org> | 2016-05-16 05:31:27 -0400 |
commit | 88ea46bcbfd677b779897bbada32ec0709a6c92f (patch) | |
tree | 49d5cb6ee7697dbe63788d43221dbfa60f880b6b | |
parent | 5b5fe95a6977b9cdd30749cb1576df2329d70da9 (diff) |
mmc: sdio: fall back to SDIO 1.0 for broken 1.1 cards
I have two SDIO WLAN cards which specify being SDIO Rev. 1.1 cards but
their FUNCE tuple reports the smaller size of a Rev 1.0 card. So,
enforce 1.0 on these cards to avoid reading the not present registers.
They are not really used anyhow. My cards initialize properly after this
patch.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
-rw-r--r-- | drivers/mmc/core/sdio_cis.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/mmc/core/sdio_cis.c b/drivers/mmc/core/sdio_cis.c index 6f6fc527a263..dcb3dee59fa5 100644 --- a/drivers/mmc/core/sdio_cis.c +++ b/drivers/mmc/core/sdio_cis.c | |||
@@ -177,8 +177,13 @@ static int cistpl_funce_func(struct mmc_card *card, struct sdio_func *func, | |||
177 | vsn = func->card->cccr.sdio_vsn; | 177 | vsn = func->card->cccr.sdio_vsn; |
178 | min_size = (vsn == SDIO_SDIO_REV_1_00) ? 28 : 42; | 178 | min_size = (vsn == SDIO_SDIO_REV_1_00) ? 28 : 42; |
179 | 179 | ||
180 | if (size < min_size) | 180 | if (size == 28 && vsn == SDIO_SDIO_REV_1_10) { |
181 | pr_warn("%s: card has broken SDIO 1.1 CIS, forcing SDIO 1.0\n", | ||
182 | mmc_hostname(card->host)); | ||
183 | vsn = SDIO_SDIO_REV_1_00; | ||
184 | } else if (size < min_size) { | ||
181 | return -EINVAL; | 185 | return -EINVAL; |
186 | } | ||
182 | 187 | ||
183 | /* TPLFE_MAX_BLK_SIZE */ | 188 | /* TPLFE_MAX_BLK_SIZE */ |
184 | func->max_blksize = buf[12] | (buf[13] << 8); | 189 | func->max_blksize = buf[12] | (buf[13] << 8); |