Commit 4bb9ebc7 authored by Michael Chan's avatar Michael Chan Committed by David S. Miller

bnx2: Eliminate AER error messages on systems not supporting it

On PPC for example, AER is not supported and we see unnecessary AER
error message without this patch:

bnx2 0003:01:00.1: pci_cleanup_aer_uncorrect_error_status failed 0xfffffffb
Reported-by: default avatarBreno Leitao <leitao@linux.vnet.ibm.com>
Signed-off-by: default avatarMichael Chan <mchan@broadcom.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 5138826b
...@@ -7966,11 +7966,8 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev) ...@@ -7966,11 +7966,8 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev)
/* AER (Advanced Error Reporting) hooks */ /* AER (Advanced Error Reporting) hooks */
err = pci_enable_pcie_error_reporting(pdev); err = pci_enable_pcie_error_reporting(pdev);
if (err) { if (!err)
dev_err(&pdev->dev, "pci_enable_pcie_error_reporting " bp->flags |= BNX2_FLAG_AER_ENABLED;
"failed 0x%x\n", err);
/* non-fatal, continue */
}
} else { } else {
bp->pcix_cap = pci_find_capability(pdev, PCI_CAP_ID_PCIX); bp->pcix_cap = pci_find_capability(pdev, PCI_CAP_ID_PCIX);
...@@ -8233,8 +8230,10 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev) ...@@ -8233,8 +8230,10 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev)
return 0; return 0;
err_out_unmap: err_out_unmap:
if (bp->flags & BNX2_FLAG_PCIE) if (bp->flags & BNX2_FLAG_AER_ENABLED) {
pci_disable_pcie_error_reporting(pdev); pci_disable_pcie_error_reporting(pdev);
bp->flags &= ~BNX2_FLAG_AER_ENABLED;
}
if (bp->regview) { if (bp->regview) {
iounmap(bp->regview); iounmap(bp->regview);
...@@ -8422,8 +8421,10 @@ bnx2_remove_one(struct pci_dev *pdev) ...@@ -8422,8 +8421,10 @@ bnx2_remove_one(struct pci_dev *pdev)
kfree(bp->temp_stats_blk); kfree(bp->temp_stats_blk);
if (bp->flags & BNX2_FLAG_PCIE) if (bp->flags & BNX2_FLAG_AER_ENABLED) {
pci_disable_pcie_error_reporting(pdev); pci_disable_pcie_error_reporting(pdev);
bp->flags &= ~BNX2_FLAG_AER_ENABLED;
}
free_netdev(dev); free_netdev(dev);
...@@ -8539,7 +8540,7 @@ static pci_ers_result_t bnx2_io_slot_reset(struct pci_dev *pdev) ...@@ -8539,7 +8540,7 @@ static pci_ers_result_t bnx2_io_slot_reset(struct pci_dev *pdev)
} }
rtnl_unlock(); rtnl_unlock();
if (!(bp->flags & BNX2_FLAG_PCIE)) if (!(bp->flags & BNX2_FLAG_AER_ENABLED))
return result; return result;
err = pci_cleanup_aer_uncorrect_error_status(pdev); err = pci_cleanup_aer_uncorrect_error_status(pdev);
......
...@@ -6741,6 +6741,7 @@ struct bnx2 { ...@@ -6741,6 +6741,7 @@ struct bnx2 {
#define BNX2_FLAG_JUMBO_BROKEN 0x00000800 #define BNX2_FLAG_JUMBO_BROKEN 0x00000800
#define BNX2_FLAG_CAN_KEEP_VLAN 0x00001000 #define BNX2_FLAG_CAN_KEEP_VLAN 0x00001000
#define BNX2_FLAG_BROKEN_STATS 0x00002000 #define BNX2_FLAG_BROKEN_STATS 0x00002000
#define BNX2_FLAG_AER_ENABLED 0x00004000
struct bnx2_napi bnx2_napi[BNX2_MAX_MSIX_VEC]; struct bnx2_napi bnx2_napi[BNX2_MAX_MSIX_VEC];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment