]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit - drivers/nvme/host/pci.c
NVMe: Surprise removal handling
authorKeith Busch <keith.busch@intel.com>
Tue, 10 Dec 2013 20:10:39 +0000 (13:10 -0700)
committerMatthew Wilcox <matthew.r.wilcox@intel.com>
Tue, 28 Jan 2014 00:28:43 +0000 (19:28 -0500)
commit0e53d18051725da46cbccfb7874a6422d4d4f274
treea14f539eae97f2774956978826f6af06d7784943
parentc30341dc3c436cf43508cd44cdfbb3810c38c195
NVMe: Surprise removal handling

This adds checks to see if the nvme pci device was removed. The check
reads the status register for the value of -1, which it should never be
unless the device is no longer present.

If a user performs a surprise removal on an nvme device, the driver will
be notified either by the pci driver remove callback if the platform's
slot is capable of this event, or via reading the device BAR status
register, which will indicate controller failure and trigger a reset.

Either way, the device is not present so all outstanding commands would
timeout. This will not send queue deletion commands to a drive that
isn't present and fail after ioremap, significantly speeding up surprise
removal; previously this took over 2 minutes per IO queue pair created,
but this will complete removing the device within a few seconds.

Signed-off-by: Keith Busch <keith.busch@intel.com>
Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
drivers/block/nvme-core.c