aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc
diff options
context:
space:
mode:
authorPierre Ossman <drzeus@drzeus.cx>2007-11-02 13:21:13 -0400
committerPierre Ossman <drzeus@drzeus.cx>2007-11-21 12:40:53 -0500
commitd198f101989d9bb950327f0d043f6203bb862343 (patch)
tree1bcbef20c668de6d8287c813d6253f903fc6842f /drivers/mmc
parent2ffbb8377c7a0713baf6644e285adc27a5654582 (diff)
mmc_block: check card state after write
Some cards have been reported to signal that they're ready prematurely. Checking both the busy bit and card state solves the issue. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/card/block.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
index e38d5a3b2a89..acaa05200ae7 100644
--- a/drivers/mmc/card/block.c
+++ b/drivers/mmc/card/block.c
@@ -321,7 +321,13 @@ static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req)
321 req->rq_disk->disk_name, err); 321 req->rq_disk->disk_name, err);
322 goto cmd_err; 322 goto cmd_err;
323 } 323 }
324 } while (!(cmd.resp[0] & R1_READY_FOR_DATA)); 324 /*
325 * Some cards mishandle the status bits,
326 * so make sure to check both the busy
327 * indication and the card state.
328 */
329 } while (!(cmd.resp[0] & R1_READY_FOR_DATA) ||
330 (R1_CURRENT_STATE(cmd.resp[0]) == 7));
325 331
326#if 0 332#if 0
327 if (cmd.resp[0] & ~0x00000900) 333 if (cmd.resp[0] & ~0x00000900)