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

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

Merge "mmc: block: ensure CMDQ is empty before queuing cache flush"

parents 6b931e51 66a7393a
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -3403,6 +3403,19 @@ static int mmc_blk_cmdq_issue_rq(struct mmc_queue *mq, struct request *req)
			else
				ret = mmc_blk_cmdq_issue_discard_rq(mq, req);
		} else if (cmd_flags & REQ_FLUSH) {
			if (card->quirks &
			    MMC_QUIRK_CMDQ_EMPTY_BEFORE_FLUSH) {
				ret = wait_event_interruptible(
					card->host->cmdq_ctx.queue_empty_wq,
					(!card->host->cmdq_ctx.active_reqs));
				if (ret) {
					pr_err("%s: failed while waiting for the CMDQ to be empty %s err (%d)\n",
						mmc_hostname(card->host),
						__func__, ret);
					BUG_ON(1);
				}
			}

			ret = mmc_blk_cmdq_issue_flush_rq(mq, req);
		} else {
			ret = mmc_blk_cmdq_issue_rw_rq(mq, req);
@@ -3860,6 +3873,8 @@ static const struct mmc_fixup blk_fixups[] =
		  MMC_QUIRK_BLK_NO_CMD23),
	MMC_FIXUP("MMC32G", CID_MANFID_TOSHIBA, CID_OEMID_ANY, add_quirk_mmc,
		  MMC_QUIRK_BLK_NO_CMD23),
	MMC_FIXUP(CID_NAME_ANY, CID_MANFID_TOSHIBA, CID_OEMID_ANY,
		  add_quirk_mmc, MMC_QUIRK_CMDQ_EMPTY_BEFORE_FLUSH),

	/*
	 * Some Micron MMC cards needs longer data read timeout than
+3 −0
Original line number Diff line number Diff line
@@ -383,6 +383,9 @@ struct mmc_card {
#define MMC_QUIRK_QCA6574_SETTINGS (1 << 15)	/* QCA6574 card settings*/
#define MMC_QUIRK_QCA9377_SETTINGS (1 << 16)	/* QCA9377 card settings*/

/* Make sure CMDQ is empty before queuing cache flush */
#define MMC_QUIRK_CMDQ_EMPTY_BEFORE_FLUSH (1 << 17)

	unsigned int		erase_size;	/* erase size in sectors */
 	unsigned int		erase_shift;	/* if erase unit is power 2 */
 	unsigned int		pref_erase;	/* in sectors */