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

bnx2: 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.

cd709aa90648 ("bnx2: Add PCI Advanced Error Reporting support.") added
pci_enable_pcie_error_reporting() for all devices, and c239f279e571 ("bnx2:
Enable AER on PCIE devices only") restricted it to BNX2_CHIP_5709 devices
to avoid an error message when it failed on non-PCIe devices. The PCI core
only enables PCIe error reporting on PCIe devices, which I assume means
BNX2_CHIP_5709.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Cc: Rasesh Mody <rmody@marvell.com>
Cc: GR-Linux-NIC-Dev@marvell.com
Reviewed-by: Michael Chan <michael.chan@broadcom.com>
Acked-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Bjorn Helgaas and committed by
Jakub Kicinski
5f00358b b4e24578

-22
-21
drivers/net/ethernet/broadcom/bnx2.c
··· 48 48 #include <linux/cache.h> 49 49 #include <linux/firmware.h> 50 50 #include <linux/log2.h> 51 - #include <linux/aer.h> 52 51 #include <linux/crash_dump.h> 53 52 54 53 #if IS_ENABLED(CONFIG_CNIC) ··· 8092 8093 int rc, i, j; 8093 8094 u32 reg; 8094 8095 u64 dma_mask, persist_dma_mask; 8095 - int err; 8096 8096 8097 8097 SET_NETDEV_DEV(dev, &pdev->dev); 8098 8098 bp = netdev_priv(dev); ··· 8174 8176 bp->flags |= BNX2_FLAG_PCIE; 8175 8177 if (BNX2_CHIP_REV(bp) == BNX2_CHIP_REV_Ax) 8176 8178 bp->flags |= BNX2_FLAG_JUMBO_BROKEN; 8177 - 8178 - /* AER (Advanced Error Reporting) hooks */ 8179 - err = pci_enable_pcie_error_reporting(pdev); 8180 - if (!err) 8181 - bp->flags |= BNX2_FLAG_AER_ENABLED; 8182 - 8183 8179 } else { 8184 8180 bp->pcix_cap = pci_find_capability(pdev, PCI_CAP_ID_PCIX); 8185 8181 if (bp->pcix_cap == 0) { ··· 8452 8460 return 0; 8453 8461 8454 8462 err_out_unmap: 8455 - if (bp->flags & BNX2_FLAG_AER_ENABLED) { 8456 - pci_disable_pcie_error_reporting(pdev); 8457 - bp->flags &= ~BNX2_FLAG_AER_ENABLED; 8458 - } 8459 - 8460 8463 pci_iounmap(pdev, bp->regview); 8461 8464 bp->regview = NULL; 8462 8465 ··· 8625 8638 bnx2_free_stats_blk(dev); 8626 8639 kfree(bp->temp_stats_blk); 8627 8640 8628 - if (bp->flags & BNX2_FLAG_AER_ENABLED) { 8629 - pci_disable_pcie_error_reporting(pdev); 8630 - bp->flags &= ~BNX2_FLAG_AER_ENABLED; 8631 - } 8632 - 8633 8641 bnx2_release_firmware(bp); 8634 8642 8635 8643 free_netdev(dev); ··· 8747 8765 dev_close(dev); 8748 8766 } 8749 8767 rtnl_unlock(); 8750 - 8751 - if (!(bp->flags & BNX2_FLAG_AER_ENABLED)) 8752 - return result; 8753 8768 8754 8769 return result; 8755 8770 }
-1
drivers/net/ethernet/broadcom/bnx2.h
··· 6808 6808 #define BNX2_FLAG_JUMBO_BROKEN 0x00000800 6809 6809 #define BNX2_FLAG_CAN_KEEP_VLAN 0x00001000 6810 6810 #define BNX2_FLAG_BROKEN_STATS 0x00002000 6811 - #define BNX2_FLAG_AER_ENABLED 0x00004000 6812 6811 6813 6812 struct bnx2_napi bnx2_napi[BNX2_MAX_MSIX_VEC]; 6814 6813