idata->ic.write_flag ? REQ_OP_DRV_OUT : REQ_OP_DRV_IN,
__GFP_RECLAIM);
idatas[0] = idata;
+ req_to_mmc_queue_req(req)->drv_op = MMC_DRV_OP_IOCTL;
req_to_mmc_queue_req(req)->idata = idatas;
req_to_mmc_queue_req(req)->ioc_count = 1;
blk_execute_rq(mq->queue, NULL, req, 0);
}
/*
- * The ioctl commands come back from the block layer after it queued it and
+ * 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
* function.
*/
-static void mmc_blk_ioctl_cmd_issue(struct mmc_queue *mq, struct request *req)
+static void mmc_blk_issue_drv_op(struct mmc_queue *mq, struct request *req)
{
struct mmc_queue_req *mq_rq;
struct mmc_card *card = mq->card;
int i;
mq_rq = req_to_mmc_queue_req(req);
- for (i = 0; i < mq_rq->ioc_count; i++) {
- ioc_err = __mmc_blk_ioctl_cmd(card, md, mq_rq->idata[i]);
- if (ioc_err)
- break;
- }
- mq_rq->ioc_result = ioc_err;
- /* Always switch back to main area after RPMB access */
- if (md->area_type & MMC_BLK_DATA_AREA_RPMB)
- mmc_blk_part_switch(card, dev_get_drvdata(&card->dev));
+ switch (mq_rq->drv_op) {
+ case MMC_DRV_OP_IOCTL:
+ for (i = 0; i < mq_rq->ioc_count; i++) {
+ ioc_err =
+ __mmc_blk_ioctl_cmd(card, md, mq_rq->idata[i]);
+ if (ioc_err)
+ break;
+ }
+ mq_rq->ioc_result = ioc_err;
+
+ /* Always switch back to main area after RPMB access */
+ if (md->area_type & MMC_BLK_DATA_AREA_RPMB)
+ mmc_blk_part_switch(card, dev_get_drvdata(&card->dev));
- blk_end_request_all(req, ioc_err);
+ blk_end_request_all(req, ioc_err);
+ break;
+ default:
+ /* Unknown operation */
+ break;
+ }
}
static int mmc_blk_ioctl_multi_cmd(struct block_device *bdev,
req = blk_get_request(mq->queue,
idata[0]->ic.write_flag ? REQ_OP_DRV_OUT : REQ_OP_DRV_IN,
__GFP_RECLAIM);
+ req_to_mmc_queue_req(req)->drv_op = MMC_DRV_OP_IOCTL;
req_to_mmc_queue_req(req)->idata = idata;
req_to_mmc_queue_req(req)->ioc_count = num_of_cmds;
blk_execute_rq(mq->queue, NULL, req, 0);
*/
if (mq->qcnt)
mmc_blk_issue_rw_rq(mq, NULL);
- mmc_blk_ioctl_cmd_issue(mq, req);
+ mmc_blk_issue_drv_op(mq, req);
break;
case REQ_OP_DISCARD:
/*