@@ -424,6 +424,16 @@ static int mmc_blk_issue_rw_rq(struct mmc_queue *mq, struct request *req)
mmc_wait_for_req(card->host, &brq.mrq);
+ /*
+ * Check if need to do HW reset.
+ */
+ if (brq.cmd.error)
+ mmc_handle_timeout_error(card->host, brq.cmd.error);
+ else if (brq.data.error)
+ mmc_handle_timeout_error(card->host, brq.data.error);
+ else if (brq.stop.error)
+ mmc_handle_timeout_error(card->host, brq.stop.error);
+
mmc_queue_bounce_post(mq);
/*
@@ -1385,6 +1385,8 @@ static int mmc_do_erase(struct mmc_card *card, unsigned int from,
if (err) {
printk(KERN_ERR "mmc_erase: erase error %d, status %#x\n",
err, cmd.resp[0]);
+ /* Before return, check whether can do a HW reset */
+ mmc_handle_timeout_error(card->host, cmd.error);
err = -EIO;
goto out;
}