Skip to content

Commit f847e84

Browse files
mrgolinjgunthorpe
authored andcommitted
RDMA/efa: Add shutdown notifier
Add driver function to stop the device and release any active IRQs as preparation for shutdown. This should fix issues caused by unexpected AQ interrupts when booting kernel using kexec and possible data integrity issues when the system is being shutdown during traffic. Link: https://lore.kernel.org/r/20240425171814.25216-1-mrgolin@amazon.com Reviewed-by: Firas Jahjah <firasj@amazon.com> Reviewed-by: Yonatan Nachum <ynachum@amazon.com> Signed-off-by: Michael Margolin <mrgolin@amazon.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
1 parent f88320b commit f847e84

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

drivers/infiniband/hw/efa/efa_main.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -671,11 +671,22 @@ static void efa_remove(struct pci_dev *pdev)
671671
efa_remove_device(pdev);
672672
}
673673

674+
static void efa_shutdown(struct pci_dev *pdev)
675+
{
676+
struct efa_dev *dev = pci_get_drvdata(pdev);
677+
678+
efa_destroy_eqs(dev);
679+
efa_com_dev_reset(&dev->edev, EFA_REGS_RESET_SHUTDOWN);
680+
efa_free_irq(dev, &dev->admin_irq);
681+
efa_disable_msix(dev);
682+
}
683+
674684
static struct pci_driver efa_pci_driver = {
675685
.name = DRV_MODULE_NAME,
676686
.id_table = efa_pci_tbl,
677687
.probe = efa_probe,
678688
.remove = efa_remove,
689+
.shutdown = efa_shutdown,
679690
};
680691

681692
module_pci_driver(efa_pci_driver);

0 commit comments

Comments
 (0)