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

Commit 14cce002 authored by qctecmdr Service's avatar qctecmdr Service Committed by Gerrit - the friendly Code Review server
Browse files

Merge "mmc: card: Add explicit checks for secure-discard requests"

parents 740ffdf6 6e3ca554
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -3641,6 +3641,9 @@ static int mmc_blk_cmdq_issue_rq(struct mmc_queue *mq, struct request *req)
				ret = mmc_blk_cmdq_issue_discard_rq(mq, req);
			break;
		case REQ_OP_SECURE_ERASE:
			ret = mmc_cmdq_wait_for_small_sector_read(card, req);
			if (ret)
				break;
			if (!(card->quirks & MMC_QUIRK_SEC_ERASE_TRIM_BROKEN))
				ret = mmc_blk_cmdq_issue_secdiscard_rq(mq, req);
			else
+2 −1
Original line number Diff line number Diff line
@@ -91,7 +91,8 @@ static inline void mmc_cmdq_ready_wait(struct mmc_host *host,
	wait_event(ctx->wait, kthread_should_stop()
		|| (mmc_peek_request(mq) &&
		!(((req_op(mq->cmdq_req_peeked) == REQ_OP_FLUSH) ||
		   (req_op(mq->cmdq_req_peeked) == REQ_OP_DISCARD))
		   (req_op(mq->cmdq_req_peeked) == REQ_OP_DISCARD) ||
		   (req_op(mq->cmdq_req_peeked) == REQ_OP_SECURE_ERASE))
		  && test_bit(CMDQ_STATE_DCMD_ACTIVE, &ctx->curr_state))
		&& !(!host->card->part_curr && !mmc_card_suspended(host->card)
		     && mmc_host_halt(host))