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

Commit 14d89ee3 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: stop BKOPs before handling RPMB and ioctl"

parents b29641e8 6c6c7f40
Loading
Loading
Loading
Loading
+28 −0
Original line number Diff line number Diff line
@@ -685,6 +685,15 @@ static int mmc_blk_ioctl_cmd(struct block_device *bdev,
		}
	}

	if (mmc_card_doing_bkops(card)) {
		err = mmc_stop_bkops(card);
		if (err) {
			dev_err(mmc_dev(card->host),
				"%s: stop_bkops failed %d\n", __func__, err);
			goto cmd_rel_host;
		}
	}

	err = mmc_blk_part_switch(card, md);
	if (err)
		goto cmd_rel_host;
@@ -832,6 +841,25 @@ static int mmc_blk_ioctl_rpmb_cmd(struct block_device *bdev,

	mmc_get_card(card);

	if (mmc_card_doing_bkops(card)) {
		if (mmc_card_cmdq(card)) {
			err = mmc_cmdq_halt(card->host, true);
			if (err)
				goto cmd_rel_host;
		}
		err = mmc_stop_bkops(card);
		if (err) {
			dev_err(mmc_dev(card->host),
				"%s: stop_bkops failed %d\n", __func__, err);
			goto cmd_rel_host;
		}
		if (mmc_card_cmdq(card)) {
			err = mmc_cmdq_halt(card->host, false);
			if (err)
				goto cmd_rel_host;
		}
	}

	err = mmc_blk_part_switch(card, md);
	if (err)
		goto cmd_rel_host;