aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc
diff options
context:
space:
mode:
authorChris Ball <cjb@laptop.org>2010-03-05 16:43:33 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2010-03-06 14:26:37 -0500
commit3bca4cf703826fcb2bbabbe19c6fc7b2fc4fd7cc (patch)
tree6be86594d47aaf9f61febba43cbc0e470bfadabb /drivers/mmc
parent2f4cbb3d834922ffa0309b6a08fa42dac87ef9d2 (diff)
sdio: don't use CMD[357] as part of a powered SDIO resume
Seen on a Marvell 8686 SDIO card and Via VX855 controller: we must avoid sending CMD3/5/7 on a resume where power has been maintained, because the 8686 will refuse to respond to them and the MMC stack will give up on the card. Signed-off-by: Chris Ball <cjb@laptop.org> Signed-off-by: Nicolas Pitre <nico@marvell.com> Cc: <linux-mmc@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/core/sdio.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c
index 06b64085a355..7d8ba64b0170 100644
--- a/drivers/mmc/core/sdio.c
+++ b/drivers/mmc/core/sdio.c
@@ -224,7 +224,7 @@ static int sdio_enable_hs(struct mmc_card *card)
224 * we're trying to reinitialise. 224 * we're trying to reinitialise.
225 */ 225 */
226static int mmc_sdio_init_card(struct mmc_host *host, u32 ocr, 226static int mmc_sdio_init_card(struct mmc_host *host, u32 ocr,
227 struct mmc_card *oldcard) 227 struct mmc_card *oldcard, int powered_resume)
228{ 228{
229 struct mmc_card *card; 229 struct mmc_card *card;
230 int err; 230 int err;
@@ -235,9 +235,11 @@ static int mmc_sdio_init_card(struct mmc_host *host, u32 ocr,
235 /* 235 /*
236 * Inform the card of the voltage 236 * Inform the card of the voltage
237 */ 237 */
238 err = mmc_send_io_op_cond(host, host->ocr, &ocr); 238 if (!powered_resume) {
239 if (err) 239 err = mmc_send_io_op_cond(host, host->ocr, &ocr);
240 goto err; 240 if (err)
241 goto err;
242 }
241 243
242 /* 244 /*
243 * For SPI, enable CRC as appropriate. 245 * For SPI, enable CRC as appropriate.
@@ -262,7 +264,7 @@ static int mmc_sdio_init_card(struct mmc_host *host, u32 ocr,
262 /* 264 /*
263 * For native busses: set card RCA and quit open drain mode. 265 * For native busses: set card RCA and quit open drain mode.
264 */ 266 */
265 if (!mmc_host_is_spi(host)) { 267 if (!powered_resume && !mmc_host_is_spi(host)) {
266 err = mmc_send_relative_addr(host, &card->rca); 268 err = mmc_send_relative_addr(host, &card->rca);
267 if (err) 269 if (err)
268 goto remove; 270 goto remove;
@@ -273,7 +275,7 @@ static int mmc_sdio_init_card(struct mmc_host *host, u32 ocr,
273 /* 275 /*
274 * Select card, as all following commands rely on that. 276 * Select card, as all following commands rely on that.
275 */ 277 */
276 if (!mmc_host_is_spi(host)) { 278 if (!powered_resume && !mmc_host_is_spi(host)) {
277 err = mmc_select_card(card); 279 err = mmc_select_card(card);
278 if (err) 280 if (err)
279 goto remove; 281 goto remove;
@@ -437,7 +439,8 @@ static int mmc_sdio_resume(struct mmc_host *host)
437 439
438 /* Basic card reinitialization. */ 440 /* Basic card reinitialization. */
439 mmc_claim_host(host); 441 mmc_claim_host(host);
440 err = mmc_sdio_init_card(host, host->ocr, host->card); 442 err = mmc_sdio_init_card(host, host->ocr, host->card,
443 (host->pm_flags & MMC_PM_KEEP_POWER));
441 mmc_release_host(host); 444 mmc_release_host(host);
442 445
443 /* 446 /*
@@ -507,7 +510,7 @@ int mmc_attach_sdio(struct mmc_host *host, u32 ocr)
507 /* 510 /*
508 * Detect and init the card. 511 * Detect and init the card.
509 */ 512 */
510 err = mmc_sdio_init_card(host, host->ocr, NULL); 513 err = mmc_sdio_init_card(host, host->ocr, NULL, 0);
511 if (err) 514 if (err)
512 goto err; 515 goto err;
513 card = host->card; 516 card = host->card;