diff options
| author | Michael Chan <mchan@broadcom.com> | 2011-01-25 17:14:51 -0500 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2011-01-26 17:28:52 -0500 |
| commit | 4bb9ebc78097376b3734c6d3001a96aecac0f7bb (patch) | |
| tree | 6f6d54fa1b27782a97cea8446012d0fc073a0917 | |
| parent | 5138826b52f8bc441770069b1b305e1d1426ae9e (diff) | |
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: Breno Leitao <leitao@linux.vnet.ibm.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
| -rw-r--r-- | drivers/net/bnx2.c | 17 | ||||
| -rw-r--r-- | drivers/net/bnx2.h | 1 |
2 files changed, 10 insertions, 8 deletions
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c index 99e7652e2169..0ba59d5aeb7f 100644 --- a/drivers/net/bnx2.c +++ b/drivers/net/bnx2.c | |||
| @@ -7966,11 +7966,8 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev) | |||
| 7966 | 7966 | ||
| 7967 | /* AER (Advanced Error Reporting) hooks */ | 7967 | /* AER (Advanced Error Reporting) hooks */ |
| 7968 | err = pci_enable_pcie_error_reporting(pdev); | 7968 | err = pci_enable_pcie_error_reporting(pdev); |
| 7969 | if (err) { | 7969 | if (!err) |
| 7970 | dev_err(&pdev->dev, "pci_enable_pcie_error_reporting " | 7970 | bp->flags |= BNX2_FLAG_AER_ENABLED; |
| 7971 | "failed 0x%x\n", err); | ||
| 7972 | /* non-fatal, continue */ | ||
| 7973 | } | ||
| 7974 | 7971 | ||
| 7975 | } else { | 7972 | } else { |
| 7976 | bp->pcix_cap = pci_find_capability(pdev, PCI_CAP_ID_PCIX); | 7973 | 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 | return 0; | 8230 | return 0; |
| 8234 | 8231 | ||
| 8235 | err_out_unmap: | 8232 | err_out_unmap: |
| 8236 | if (bp->flags & BNX2_FLAG_PCIE) | 8233 | if (bp->flags & BNX2_FLAG_AER_ENABLED) { |
| 8237 | pci_disable_pcie_error_reporting(pdev); | 8234 | pci_disable_pcie_error_reporting(pdev); |
| 8235 | bp->flags &= ~BNX2_FLAG_AER_ENABLED; | ||
| 8236 | } | ||
| 8238 | 8237 | ||
| 8239 | if (bp->regview) { | 8238 | if (bp->regview) { |
| 8240 | iounmap(bp->regview); | 8239 | iounmap(bp->regview); |
| @@ -8422,8 +8421,10 @@ bnx2_remove_one(struct pci_dev *pdev) | |||
| 8422 | 8421 | ||
| 8423 | kfree(bp->temp_stats_blk); | 8422 | kfree(bp->temp_stats_blk); |
| 8424 | 8423 | ||
| 8425 | if (bp->flags & BNX2_FLAG_PCIE) | 8424 | if (bp->flags & BNX2_FLAG_AER_ENABLED) { |
| 8426 | pci_disable_pcie_error_reporting(pdev); | 8425 | pci_disable_pcie_error_reporting(pdev); |
| 8426 | bp->flags &= ~BNX2_FLAG_AER_ENABLED; | ||
| 8427 | } | ||
| 8427 | 8428 | ||
| 8428 | free_netdev(dev); | 8429 | free_netdev(dev); |
| 8429 | 8430 | ||
| @@ -8539,7 +8540,7 @@ static pci_ers_result_t bnx2_io_slot_reset(struct pci_dev *pdev) | |||
| 8539 | } | 8540 | } |
| 8540 | rtnl_unlock(); | 8541 | rtnl_unlock(); |
| 8541 | 8542 | ||
| 8542 | if (!(bp->flags & BNX2_FLAG_PCIE)) | 8543 | if (!(bp->flags & BNX2_FLAG_AER_ENABLED)) |
| 8543 | return result; | 8544 | return result; |
| 8544 | 8545 | ||
| 8545 | err = pci_cleanup_aer_uncorrect_error_status(pdev); | 8546 | err = pci_cleanup_aer_uncorrect_error_status(pdev); |
diff --git a/drivers/net/bnx2.h b/drivers/net/bnx2.h index 5488a2e82fe9..f459fb2f9add 100644 --- a/drivers/net/bnx2.h +++ b/drivers/net/bnx2.h | |||
| @@ -6741,6 +6741,7 @@ struct bnx2 { | |||
| 6741 | #define BNX2_FLAG_JUMBO_BROKEN 0x00000800 | 6741 | #define BNX2_FLAG_JUMBO_BROKEN 0x00000800 |
| 6742 | #define BNX2_FLAG_CAN_KEEP_VLAN 0x00001000 | 6742 | #define BNX2_FLAG_CAN_KEEP_VLAN 0x00001000 |
| 6743 | #define BNX2_FLAG_BROKEN_STATS 0x00002000 | 6743 | #define BNX2_FLAG_BROKEN_STATS 0x00002000 |
| 6744 | #define BNX2_FLAG_AER_ENABLED 0x00004000 | ||
| 6744 | 6745 | ||
| 6745 | struct bnx2_napi bnx2_napi[BNX2_MAX_MSIX_VEC]; | 6746 | struct bnx2_napi bnx2_napi[BNX2_MAX_MSIX_VEC]; |
| 6746 | 6747 | ||
