blk-mq: don't insert passthrough request into sw queue
[platform/kernel/linux-starfive.git] / block / blk-mq.c
index 16c524e..720b506 100644 (file)
@@ -2728,7 +2728,12 @@ static void blk_mq_dispatch_plug_list(struct blk_plug *plug, bool from_sched)
 
        percpu_ref_get(&this_hctx->queue->q_usage_counter);
        /* passthrough requests should never be issued to the I/O scheduler */
-       if (this_hctx->queue->elevator && !is_passthrough) {
+       if (is_passthrough) {
+               spin_lock(&this_hctx->lock);
+               list_splice_tail_init(&list, &this_hctx->dispatch);
+               spin_unlock(&this_hctx->lock);
+               blk_mq_run_hw_queue(this_hctx, from_sched);
+       } else if (this_hctx->queue->elevator) {
                this_hctx->queue->elevator->type->ops.insert_requests(this_hctx,
                                &list, 0);
                blk_mq_run_hw_queue(this_hctx, from_sched);