blk-mq: avoid to synchronize rcu inside blk_cleanup_queue()
[GitHub/moto-9609/android_kernel_motorola_exynos9610.git] / block / blk-core.c
index 1d27e2a152e073907ff6ab53b0600392448fc4b2..6aa2bc4e96529fe00da224166d3c71fddb585f65 100644 (file)
@@ -669,9 +669,13 @@ void blk_cleanup_queue(struct request_queue *q)
         * make sure all in-progress dispatch are completed because
         * blk_freeze_queue() can only complete all requests, and
         * dispatch may still be in-progress since we dispatch requests
-        * from more than one contexts
+        * from more than one contexts.
+        *
+        * No need to quiesce queue if it isn't initialized yet since
+        * blk_freeze_queue() should be enough for cases of passthrough
+        * request.
         */
-       if (q->mq_ops)
+       if (q->mq_ops && blk_queue_init_done(q))
                blk_mq_quiesce_queue(q);
 
        /* for synchronous bio-based driver finish in-flight integrity i/o */