Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d198f101989d9bb950327f0d043f6203bb862343
Commit:     d198f101989d9bb950327f0d043f6203bb862343
Parent:     2ffbb8377c7a0713baf6644e285adc27a5654582
Author:     Pierre Ossman <[EMAIL PROTECTED]>
AuthorDate: Fri Nov 2 18:21:13 2007 +0100
Committer:  Pierre Ossman <[EMAIL PROTECTED]>
CommitDate: Wed Nov 21 18:40:53 2007 +0100

    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 <[EMAIL PROTECTED]>
---
 drivers/mmc/card/block.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
index e38d5a3..acaa052 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)
                                               req->rq_disk->disk_name, err);
                                        goto cmd_err;
                                }
-                       } while (!(cmd.resp[0] & R1_READY_FOR_DATA));
+                               /*
+                                * Some cards mishandle the status bits,
+                                * so make sure to check both the busy
+                                * indication and the card state.
+                                */
+                       } while (!(cmd.resp[0] & R1_READY_FOR_DATA) ||
+                               (R1_CURRENT_STATE(cmd.resp[0]) == 7));
 
 #if 0
                        if (cmd.resp[0] & ~0x00000900)
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to