Commit f0d54a54 authored by Keith Busch's avatar Keith Busch Committed by Bjorn Helgaas

NVMe: Implement PCIe reset notification callback

Quiesce and shutdown the device prior to reset, then restart the device and
resume IO after.
Signed-off-by: default avatarKeith Busch <keith.busch@intel.com>
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
parent 3ebe7f9f
...@@ -2775,6 +2775,16 @@ static int nvme_probe(struct pci_dev *pdev, const struct pci_device_id *id) ...@@ -2775,6 +2775,16 @@ static int nvme_probe(struct pci_dev *pdev, const struct pci_device_id *id)
return result; return result;
} }
static void nvme_reset_notify(struct pci_dev *pdev, bool prepare)
{
struct nvme_dev *dev = pci_get_drvdata(pdev);
if (prepare)
nvme_dev_shutdown(dev);
else
nvme_dev_resume(dev);
}
static void nvme_shutdown(struct pci_dev *pdev) static void nvme_shutdown(struct pci_dev *pdev)
{ {
struct nvme_dev *dev = pci_get_drvdata(pdev); struct nvme_dev *dev = pci_get_drvdata(pdev);
...@@ -2839,6 +2849,7 @@ static const struct pci_error_handlers nvme_err_handler = { ...@@ -2839,6 +2849,7 @@ static const struct pci_error_handlers nvme_err_handler = {
.link_reset = nvme_link_reset, .link_reset = nvme_link_reset,
.slot_reset = nvme_slot_reset, .slot_reset = nvme_slot_reset,
.resume = nvme_error_resume, .resume = nvme_error_resume,
.reset_notify = nvme_reset_notify,
}; };
/* Move to pci_ids.h later */ /* Move to pci_ids.h later */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment