]> www.infradead.org Git - users/jedix/linux-maple.git/commit
nvme: Complete all stuck requests
authorKeith Busch <keith.busch@intel.com>
Wed, 1 Mar 2017 19:22:12 +0000 (14:22 -0500)
committerAshok Vairavan <ashok.vairavan@oracle.com>
Wed, 19 Jul 2017 20:03:07 +0000 (13:03 -0700)
commitefddf41f6dfa167443cc6438a806356a199bd5ca
tree93b6520e918836dc56f1337a985f3133a4603af9
parent7b6f034acde9ab5171883009cb67e67915834433
nvme: Complete all stuck requests

If the nvme driver is shutting down its controller, the drievr will not
start the queues up again, preventing blk-mq's hot CPU notifier from
making forward progress.

To fix that, this patch starts a request_queue freeze when the driver
resets a controller so no new requests may enter. The driver will wait
for frozen after IO queues are restarted to ensure the queue reference
can be reinitialized when nvme requests to unfreeze the queues.

If the driver is doing a safe shutdown, the driver will wait for the
controller to successfully complete all inflight requests so that we
don't unnecessarily fail them. Once the controller has been disabled,
the queues will be restarted to force remaining entered requests to end
in failure so that blk-mq's hot cpu notifier may progress.

Signed-off-by: Keith Busch <keith.busch@intel.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Jens Axboe <axboe@fb.com>
(cherry picked from commit 302ad8cc09339ea261eef58a8d5f4a116a8ffda5)

Orabug: 26486098

Signed-off-by: Ashok Vairavan <ashok.vairavan@oracle.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/nvme/host/core.c
drivers/nvme/host/nvme.h
drivers/nvme/host/pci.c