blk-mq: Register <dev>/queue/mq after having registered <dev>/queue 83/290883/2
authorBart Van Assche <bart.vanassche@sandisk.com>
Wed, 26 Apr 2017 20:47:48 +0000 (13:47 -0700)
committerSeung-Woo Kim <sw0312.kim@samsung.com>
Wed, 5 Apr 2023 01:20:19 +0000 (10:20 +0900)
commit4a4595d3b13017cbd600f18b1c0ff2e2cd7082ec
treee0126ff257ee1b2450658106feae1eacb80e45ac
parent6bb323e9561e440bb617d8e70a45892399ad0381
blk-mq: Register <dev>/queue/mq after having registered <dev>/queue

A later patch in this series will modify blk_mq_debugfs_register()
such that it uses q->kobj.parent to determine the name of a
request queue. Hence make sure that that pointer is initialized
before blk_mq_debugfs_register() is called. To avoid lock inversion,
protect sysfs / debugfs registration with the queue sysfs_lock
instead of the global mutex all_q_mutex.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Omar Sandoval <osandov@fb.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
[sw0312.kim: backport mainline commit 2d0364c8c1a9 to fix possible deadlock in blk-mq for cpu hotplug]
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Change-Id: Id43aae4f67f6aa43b5ad0ccd19b8f40baab337b8
block/blk-mq-sysfs.c
block/blk-mq.h
block/blk-sysfs.c