Skip to content

Commit cb2a6d1

Browse files
bjorn-helgaasjonmason
authored andcommitted
ntb: idt: drop redundant pci_enable_pcie_error_reporting()
pci_enable_pcie_error_reporting() enables the device to send ERR_* Messages. Since f26e58b ("PCI/AER: Enable error reporting when AER is native"), the PCI core does this for all devices during enumeration, so the driver doesn't need to do it itself. Remove the redundant pci_enable_pcie_error_reporting() call from the driver. Also remove the corresponding pci_disable_pcie_error_reporting() from the driver .remove() path. Note that this only controls ERR_* Messages from the device. An ERR_* Message may cause the Root Port to generate an interrupt, depending on the AER Root Error Command register managed by the AER service driver. Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Acked-by: Serge Semin <fancer.lancer@gmail.com> Signed-off-by: Jon Mason <jdmason@kudzu.us>
1 parent ce2188a commit cb2a6d1

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

drivers/ntb/hw/idt/ntb_hw_idt.c

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2651,20 +2651,18 @@ static int idt_init_pci(struct idt_ntb_dev *ndev)
26512651
}
26522652

26532653
/*
2654-
* Enable the device advanced error reporting. It's not critical to
2654+
* The PCI core enables device error reporting. It's not critical to
26552655
* have AER disabled in the kernel.
2656+
*
2657+
* Cleanup nonfatal error status before getting to init.
26562658
*/
2657-
ret = pci_enable_pcie_error_reporting(pdev);
2658-
if (ret != 0)
2659-
dev_warn(&pdev->dev, "PCIe AER capability disabled\n");
2660-
else /* Cleanup nonfatal error status before getting to init */
2661-
pci_aer_clear_nonfatal_status(pdev);
2659+
pci_aer_clear_nonfatal_status(pdev);
26622660

26632661
/* First enable the PCI device */
26642662
ret = pcim_enable_device(pdev);
26652663
if (ret != 0) {
26662664
dev_err(&pdev->dev, "Failed to enable PCIe device\n");
2667-
goto err_disable_aer;
2665+
return ret;
26682666
}
26692667

26702668
/*
@@ -2692,8 +2690,6 @@ static int idt_init_pci(struct idt_ntb_dev *ndev)
26922690

26932691
err_clear_master:
26942692
pci_clear_master(pdev);
2695-
err_disable_aer:
2696-
(void)pci_disable_pcie_error_reporting(pdev);
26972693

26982694
return ret;
26992695
}
@@ -2714,9 +2710,6 @@ static void idt_deinit_pci(struct idt_ntb_dev *ndev)
27142710
/* Clear the bus master disabling the Request TLPs translation */
27152711
pci_clear_master(pdev);
27162712

2717-
/* Disable the AER capability */
2718-
(void)pci_disable_pcie_error_reporting(pdev);
2719-
27202713
dev_dbg(&pdev->dev, "NT-function PCIe interface cleared");
27212714
}
27222715

0 commit comments

Comments
 (0)