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

Commit cd71634b 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: check if manual BKOPS is ongoing before scaling"

parents e2c2f3f6 bacf9640
Loading
Loading
Loading
Loading
+24 −5
Original line number Diff line number Diff line
@@ -3340,14 +3340,27 @@ static int mmc_blk_cmdq_issue_rq(struct mmc_queue *mq, struct request *req)
	unsigned int cmd_flags = req ? req->cmd_flags : 0;

	mmc_get_card(card);

	if (!card->host->cmdq_ctx.active_reqs && mmc_card_doing_bkops(card)) {
		ret = mmc_cmdq_halt(card->host, true);
		if (ret)
			goto out;
		ret = mmc_stop_bkops(card);
		if (ret) {
			pr_err("%s: %s: mmc_stop_bkops failed %d\n",
					md->disk->disk_name, __func__, ret);
			goto out;
		}
		ret = mmc_cmdq_halt(card->host, false);
		if (ret)
			goto out;
	}

	ret = mmc_blk_cmdq_part_switch(card, md);
	if (ret) {
		pr_err("%s: %s: partition switch failed %d\n",
				md->disk->disk_name, __func__, ret);
		if (req)
			blk_end_request_all(req, ret);
		mmc_put_card(card);
		goto switch_failure;
		goto out;
	}

	if (req) {
@@ -3364,7 +3377,13 @@ static int mmc_blk_cmdq_issue_rq(struct mmc_queue *mq, struct request *req)
		}
	}

switch_failure:
	return ret;

out:
	if (req)
		blk_end_request_all(req, ret);
	mmc_put_card(card);

	return ret;
}

+2 −1
Original line number Diff line number Diff line
@@ -335,7 +335,8 @@ static bool mmc_is_valid_state_for_clk_scaling(struct mmc_host *host)
	 * this mode.
	 */
	if (!card || (mmc_card_mmc(card) &&
			card->part_curr == EXT_CSD_PART_CONFIG_ACC_RPMB))
			(card->part_curr == EXT_CSD_PART_CONFIG_ACC_RPMB ||
			mmc_card_doing_bkops(card))))
		return false;

	if (mmc_send_status(card, &status)) {