]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit - drivers/nvme/host/pci.c
NVMe: Fix potential corruption during shutdown
authorKeith Busch <keith.busch@intel.com>
Thu, 19 Feb 2015 17:34:48 +0000 (10:34 -0700)
committerKeith Busch <keith.busch@intel.com>
Thu, 19 Feb 2015 23:15:37 +0000 (16:15 -0700)
commit07836e659c81ec6b0d683dfbf7958339a22a7b69
tree6c043eb7b855825c6cb304f19cb0103bc4303cc2
parent2e1d8448196ba85cd78a18723413a3c92aabe0f3
NVMe: Fix potential corruption during shutdown

The driver has to end unreturned commands at some point even if the
controller has not provided a completion. The driver tried to be safe by
deleting IO queues prior to ending all unreturned commands. That should
cause the controller to internally abort inflight commands, but IO queue
deletion request does not have to be successful, so all bets are off. We
still have to make progress, so to be extra safe, this patch doesn't
clear a queue to release the dma mapping for a command until after the
pci device has been disabled.

This patch removes the special handling during device initialization
so controller recovery can be done all the time. This is possible since
initialization is not inlined with pci probe anymore.

Reported-by: Nilish Choudhury <nilesh.choudhury@oracle.com>
Signed-off-by: Keith Busch <keith.busch@intel.com>
drivers/block/nvme-core.c
include/linux/nvme.h