]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit1d3965327e277bca819f66e794670adcc06b514e
treea14f539eae97f2774956978826f6af06d7784943
parentd71fdc0eaa51c2035aa73c57e9931864956da332
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