On Sat, Jan 04, 2025 at 10:25:21PM +0900, Damien Le Moal wrote: > __blk_mq_update_nr_hw_queues() freezes a device queues during operation, > which also includes updating the BLK_FEAT_POLL feature flag for the > device queues using queue_limits_start_update() and > queue_limits_commit_update(). This call order thus creates an invalid > ordering of a queue freeze and queue limit locking which can lead to a > deadlock when the device driver must issue commands to probe the device > when revalidating its limits. > > Avoid this issue by moving the update of the BLK_FEAT_POLL feature flag > out of the main queue remapping loop to the end of > __blk_mq_update_nr_hw_queues(), after the device queues have been > unfrozen. What happens if I/O is queued after the unfreeze, but before clearing the poll flag?