diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c index 0ca94e88f92a21b9d53d4848aa9a0f8dfa121bc0..6622e326218744c502e30a22926f8fbc6ef2a4c8 100644 --- a/drivers/mmc/core/block.c +++ b/drivers/mmc/core/block.c @@ -345,10 +345,6 @@ struct mmc_blk_ioc_data { struct mmc_ioc_cmd ic; unsigned char *buf; u64 buf_bytes; - unsigned int flags; -#define MMC_BLK_IOC_DROP BIT(0) /* drop this mrq */ -#define MMC_BLK_IOC_SBC BIT(1) /* use mrq.sbc */ - struct mmc_rpmb_data *rpmb; }; @@ -450,7 +446,7 @@ static int card_busy_detect(struct mmc_card *card, unsigned int timeout_ms, } static int __mmc_blk_ioctl_cmd(struct mmc_card *card, struct mmc_blk_data *md, - struct mmc_blk_ioc_data **idatas, int i) + struct mmc_blk_ioc_data *idata) { struct mmc_command cmd = {}, sbc = {}; struct mmc_data data = {}; @@ -458,18 +454,10 @@ static int __mmc_blk_ioctl_cmd(struct mmc_card *card, struct mmc_blk_data *md, struct scatterlist sg; int err; unsigned int target_part; - struct mmc_blk_ioc_data *idata = idatas[i]; - struct mmc_blk_ioc_data *prev_idata = NULL; if (!card || !md || !idata) return -EINVAL; - if (idata->flags & MMC_BLK_IOC_DROP) - return 0; - - if (idata->flags & MMC_BLK_IOC_SBC && i > 0) - prev_idata = idatas[i - 1]; - /* * The RPMB accesses comes in from the character device, so we * need to target these explicitly. Else we just target the @@ -536,7 +524,7 @@ static int __mmc_blk_ioctl_cmd(struct mmc_card *card, struct mmc_blk_data *md, return err; } - if (idata->rpmb || prev_idata) { + if (idata->rpmb) { sbc.opcode = MMC_SET_BLOCK_COUNT; /* * We don't do any blockcount validation because the max size @@ -544,8 +532,6 @@ static int __mmc_blk_ioctl_cmd(struct mmc_card *card, struct mmc_blk_data *md, * 'Reliable Write' bit here. */ sbc.arg = data.blocks | (idata->ic.write_flag & BIT(31)); - if (prev_idata) - sbc.arg = prev_idata->ic.arg; sbc.flags = MMC_RSP_R1 | MMC_CMD_AC; mrq.sbc = &sbc; } @@ -557,15 +543,6 @@ static int __mmc_blk_ioctl_cmd(struct mmc_card *card, struct mmc_blk_data *md, mmc_wait_for_req(card->host, &mrq); memcpy(&idata->ic.response, cmd.resp, sizeof(cmd.resp)); - if (prev_idata) { - memcpy(&prev_idata->ic.response, sbc.resp, sizeof(sbc.resp)); - if (sbc.error) { - dev_err(mmc_dev(card->host), "%s: sbc error %d\n", - __func__, sbc.error); - return sbc.error; - } - } - if (cmd.error) { dev_err(mmc_dev(card->host), "%s: cmd error %d\n", __func__, cmd.error); @@ -1003,20 +980,6 @@ static inline void mmc_blk_reset_success(struct mmc_blk_data *md, int type) md->reset_done &= ~type; } -static void mmc_blk_check_sbc(struct mmc_queue_req *mq_rq) -{ - struct mmc_blk_ioc_data **idata = mq_rq->drv_op_data; - int i; - - for (i = 1; i < mq_rq->ioc_count; i++) { - if (idata[i - 1]->ic.opcode == MMC_SET_BLOCK_COUNT && - mmc_op_multi(idata[i]->ic.opcode)) { - idata[i - 1]->flags |= MMC_BLK_IOC_DROP; - idata[i]->flags |= MMC_BLK_IOC_SBC; - } - } -} - /* * The non-block commands come back from the block layer after it queued it and * processed it with all other requests and then they get issued in this @@ -1044,14 +1007,11 @@ static void mmc_blk_issue_drv_op(struct mmc_queue *mq, struct request *req) if (ret) break; } - - mmc_blk_check_sbc(mq_rq); - fallthrough; case MMC_DRV_OP_IOCTL_RPMB: idata = mq_rq->drv_op_data; for (i = 0, ret = 0; i < mq_rq->ioc_count; i++) { - ret = __mmc_blk_ioctl_cmd(card, md, idata, i); + ret = __mmc_blk_ioctl_cmd(card, md, idata[i]); if (ret) break; }