Commit 8b7feff8 authored by Pierre Ossman's avatar Pierre Ossman

mmc: correct request error handling

We need to jump to the part of just flushing the request
when we cannot claim the bus. Sending commands to a bus
we do not own will give unpredictable results.
Signed-off-by: default avatarPierre Ossman <drzeus@drzeus.cx>
parent 89b4e133
...@@ -224,10 +224,10 @@ static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req) ...@@ -224,10 +224,10 @@ static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req)
struct mmc_blk_data *md = mq->data; struct mmc_blk_data *md = mq->data;
struct mmc_card *card = md->queue.card; struct mmc_card *card = md->queue.card;
struct mmc_blk_request brq; struct mmc_blk_request brq;
int ret; int ret = 1;
if (mmc_card_claim_host(card)) if (mmc_card_claim_host(card))
goto cmd_err; goto flush_queue;
do { do {
struct mmc_command cmd; struct mmc_command cmd;
...@@ -344,8 +344,6 @@ static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req) ...@@ -344,8 +344,6 @@ static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req)
return 1; return 1;
cmd_err: cmd_err:
ret = 1;
/* /*
* If this is an SD card and we're writing, we can first * If this is an SD card and we're writing, we can first
* mark the known good sectors as ok. * mark the known good sectors as ok.
...@@ -379,6 +377,7 @@ static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req) ...@@ -379,6 +377,7 @@ static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req)
mmc_card_release_host(card); mmc_card_release_host(card);
flush_queue:
spin_lock_irq(&md->lock); spin_lock_irq(&md->lock);
while (ret) { while (ret) {
ret = end_that_request_chunk(req, 0, ret = end_that_request_chunk(req, 0,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment