Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d8afc197 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "mmc: core: Avoid infinite retries of failed mmc command"

parents 51017289 8f5be087
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -71,6 +71,7 @@ MODULE_ALIAS("mmc:block");
#define PACKED_CMD_WR	0x02
#define PACKED_TRIGGER_MAX_ELEMENTS	5000

#define MMC_BLK_MAX_RETRIES 5 /* max # of retries before aborting a command */
#define MMC_SANITIZE_REQ_TIMEOUT 240000 /* msec */
#define MMC_EXTRACT_INDEX_FROM_ARG(x) ((x & 0x00FF0000) >> 16)
#define MMC_BLK_UPDATE_STOP_REASON(stats, reason)			\
@@ -2660,11 +2661,12 @@ static int mmc_blk_issue_rw_rq(struct mmc_queue *mq, struct request *rqc)
			}
			goto cmd_abort;
		case MMC_BLK_RETRY:
			if (retry++ < 5)
			if (retry++ < MMC_BLK_MAX_RETRIES)
				break;
			/* Fall through */
		case MMC_BLK_ABORT:
			if (!mmc_blk_reset(md, card->host, type))
			if (!mmc_blk_reset(md, card->host, type) &&
					(retry++ < (MMC_BLK_MAX_RETRIES + 1)))
					break;
			goto cmd_abort;
		case MMC_BLK_DATA_ERR: {