Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ntb: idt: drop redundant pci_enable_pcie_error_reporting()

pci_enable_pcie_error_reporting() enables the device to send ERR_*
Messages. Since f26e58bf6f54 ("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>

authored by

Bjorn Helgaas and committed by
Jon Mason
cb2a6d17 ce2188ac

+5 -12
+5 -12
drivers/ntb/hw/idt/ntb_hw_idt.c
··· 2651 2651 } 2652 2652 2653 2653 /* 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 2655 2655 * have AER disabled in the kernel. 2656 + * 2657 + * Cleanup nonfatal error status before getting to init. 2656 2658 */ 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); 2662 2660 2663 2661 /* First enable the PCI device */ 2664 2662 ret = pcim_enable_device(pdev); 2665 2663 if (ret != 0) { 2666 2664 dev_err(&pdev->dev, "Failed to enable PCIe device\n"); 2667 - goto err_disable_aer; 2665 + return ret; 2668 2666 } 2669 2667 2670 2668 /* ··· 2690 2692 2691 2693 err_clear_master: 2692 2694 pci_clear_master(pdev); 2693 - err_disable_aer: 2694 - (void)pci_disable_pcie_error_reporting(pdev); 2695 2695 2696 2696 return ret; 2697 2697 } ··· 2709 2713 2710 2714 /* Clear the bus master disabling the Request TLPs translation */ 2711 2715 pci_clear_master(pdev); 2712 - 2713 - /* Disable the AER capability */ 2714 - (void)pci_disable_pcie_error_reporting(pdev); 2715 2716 2716 2717 dev_dbg(&pdev->dev, "NT-function PCIe interface cleared"); 2717 2718 }