Skip to content

Commit c1620f8

Browse files
committed
RDMA/efa: Reset device on probe failure
JIRA: https://issues.redhat.com/browse/RHEL-83223 commit 123c13f Author: Michael Margolin <mrgolin@amazon.com> Date: Wed Dec 25 13:15:48 2024 +0000 RDMA/efa: Reset device on probe failure Make sure the device is being reset on driver exit whatever the reason is, to keep the device aligned and allow it to close shared resources (e.g. admin queue). Reviewed-by: Firas Jahjah <firasj@amazon.com> Reviewed-by: Yonatan Nachum <ynachum@amazon.com> Signed-off-by: Michael Margolin <mrgolin@amazon.com> Link: https://patch.msgid.link/20241225131548.15155-1-mrgolin@amazon.com Reviewed-by: Gal Pressman <gal.pressman@linux.dev> Signed-off-by: Leon Romanovsky <leon@kernel.org> Signed-off-by: Kamal Heib <kheib@redhat.com>
1 parent 9994ad0 commit c1620f8

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

drivers/infiniband/hw/efa/efa_main.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,6 @@ static void efa_ib_device_remove(struct efa_dev *dev)
470470
ibdev_info(&dev->ibdev, "Unregister ib device\n");
471471
ib_unregister_device(&dev->ibdev);
472472
efa_destroy_eqs(dev);
473-
efa_com_dev_reset(&dev->edev, EFA_REGS_RESET_NORMAL);
474473
efa_release_doorbell_bar(dev);
475474
}
476475

@@ -643,12 +642,14 @@ static struct efa_dev *efa_probe_device(struct pci_dev *pdev)
643642
return ERR_PTR(err);
644643
}
645644

646-
static void efa_remove_device(struct pci_dev *pdev)
645+
static void efa_remove_device(struct pci_dev *pdev,
646+
enum efa_regs_reset_reason_types reset_reason)
647647
{
648648
struct efa_dev *dev = pci_get_drvdata(pdev);
649649
struct efa_com_dev *edev;
650650

651651
edev = &dev->edev;
652+
efa_com_dev_reset(edev, reset_reason);
652653
efa_com_admin_destroy(edev);
653654
efa_free_irq(dev, &dev->admin_irq);
654655
efa_disable_msix(dev);
@@ -676,7 +677,7 @@ static int efa_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
676677
return 0;
677678

678679
err_remove_device:
679-
efa_remove_device(pdev);
680+
efa_remove_device(pdev, EFA_REGS_RESET_INIT_ERR);
680681
return err;
681682
}
682683

@@ -685,7 +686,7 @@ static void efa_remove(struct pci_dev *pdev)
685686
struct efa_dev *dev = pci_get_drvdata(pdev);
686687

687688
efa_ib_device_remove(dev);
688-
efa_remove_device(pdev);
689+
efa_remove_device(pdev, EFA_REGS_RESET_NORMAL);
689690
}
690691

691692
static void efa_shutdown(struct pci_dev *pdev)

0 commit comments

Comments
 (0)