• Keith Busch's avatar
    NVMe: Unbind driver on failure · 921920ab
    Keith Busch authored
    Instead of removing the PCI device from the kernel's topology on
    controller failure, this patch simply requests unbinding the device
    from the driver. This avoids concurrently running pci removal with the
    hot plug event, which has been reported to be problematic when multiple
    surprise events occur near simultaneously.
    
    The other benefit is that we will have PCI config and memory space
    available to poke around for debugging a failed controller, assuming
    the device was not physically removed.
    
    The down side occurs if the platform and/or kernel do not support any
    type of surprise hot removal. The device will remain visible through
    sysfs (and therefore lspci), and some manual work is necessary to get
    the logical topology corrected. But if your platform and/or kernel don't
    support surprise removal, you probably shouldn't be doing that anyway.
    Signed-off-by: default avatarKeith Busch <keith.busch@intel.com>
    Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
    Signed-off-by: default avatarJens Axboe <axboe@fb.com>
    921920ab
pci.c 53.4 KB