Skip to content

Commit

Permalink
mmc_block: check card state after write
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Pierre Ossman committed Nov 21, 2007
1 parent 2ffbb83 commit d198f10
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion drivers/mmc/card/block.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit d198f10

Please sign in to comment.