diff options
author | Yuval Mintz <yuvalmin@broadcom.com> | 2013-12-26 02:57:08 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-12-26 13:38:21 -0500 |
commit | 33d8e6a5f555b0d61cb3cb0e3c28e611c7408f4e (patch) | |
tree | 0d388850ff1b027c02bad0a014ef447901facf1b /drivers | |
parent | 91ebb929b6f802604bb0ccdd3fec9c7b30d804f1 (diff) |
bnx2x: Add AER support (missing bits)
This function adds several OS calls required to fully enable PCIe AER support -
pci_enable_pcie_error_reporting() and pci_cleanup_aer_uncorrect_error_status().
Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Ariel Elior <ariele@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ethernet/broadcom/bnx2x/bnx2x.h | 1 | ||||
-rw-r--r-- | drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 29 |
2 files changed, 30 insertions, 0 deletions
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h index 52019a90cd15..dad67905f4e2 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h | |||
@@ -1546,6 +1546,7 @@ struct bnx2x { | |||
1546 | #define INTERRUPTS_ENABLED_FLAG (1 << 23) | 1546 | #define INTERRUPTS_ENABLED_FLAG (1 << 23) |
1547 | #define BC_SUPPORTS_RMMOD_CMD (1 << 24) | 1547 | #define BC_SUPPORTS_RMMOD_CMD (1 << 24) |
1548 | #define HAS_PHYS_PORT_ID (1 << 25) | 1548 | #define HAS_PHYS_PORT_ID (1 << 25) |
1549 | #define AER_ENABLED (1 << 26) | ||
1549 | 1550 | ||
1550 | #define BP_NOMCP(bp) ((bp)->flags & NO_MCP_FLAG) | 1551 | #define BP_NOMCP(bp) ((bp)->flags & NO_MCP_FLAG) |
1551 | 1552 | ||
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c index 591041379b27..72973cc7ecbe 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <linux/slab.h> | 27 | #include <linux/slab.h> |
28 | #include <linux/interrupt.h> | 28 | #include <linux/interrupt.h> |
29 | #include <linux/pci.h> | 29 | #include <linux/pci.h> |
30 | #include <linux/aer.h> | ||
30 | #include <linux/init.h> | 31 | #include <linux/init.h> |
31 | #include <linux/netdevice.h> | 32 | #include <linux/netdevice.h> |
32 | #include <linux/etherdevice.h> | 33 | #include <linux/etherdevice.h> |
@@ -12225,6 +12226,14 @@ static int bnx2x_set_coherency_mask(struct bnx2x *bp) | |||
12225 | return 0; | 12226 | return 0; |
12226 | } | 12227 | } |
12227 | 12228 | ||
12229 | static void bnx2x_disable_pcie_error_reporting(struct bnx2x *bp) | ||
12230 | { | ||
12231 | if (bp->flags & AER_ENABLED) { | ||
12232 | pci_disable_pcie_error_reporting(bp->pdev); | ||
12233 | bp->flags &= ~AER_ENABLED; | ||
12234 | } | ||
12235 | } | ||
12236 | |||
12228 | static int bnx2x_init_dev(struct bnx2x *bp, struct pci_dev *pdev, | 12237 | static int bnx2x_init_dev(struct bnx2x *bp, struct pci_dev *pdev, |
12229 | struct net_device *dev, unsigned long board_type) | 12238 | struct net_device *dev, unsigned long board_type) |
12230 | { | 12239 | { |
@@ -12331,6 +12340,14 @@ static int bnx2x_init_dev(struct bnx2x *bp, struct pci_dev *pdev, | |||
12331 | /* clean indirect addresses */ | 12340 | /* clean indirect addresses */ |
12332 | pci_write_config_dword(bp->pdev, PCICFG_GRC_ADDRESS, | 12341 | pci_write_config_dword(bp->pdev, PCICFG_GRC_ADDRESS, |
12333 | PCICFG_VENDOR_ID_OFFSET); | 12342 | PCICFG_VENDOR_ID_OFFSET); |
12343 | |||
12344 | /* AER (Advanced Error reporting) configuration */ | ||
12345 | rc = pci_enable_pcie_error_reporting(pdev); | ||
12346 | if (!rc) | ||
12347 | bp->flags |= AER_ENABLED; | ||
12348 | else | ||
12349 | BNX2X_DEV_INFO("Failed To configure PCIe AER [%d]\n", rc); | ||
12350 | |||
12334 | /* | 12351 | /* |
12335 | * Clean the following indirect addresses for all functions since it | 12352 | * Clean the following indirect addresses for all functions since it |
12336 | * is not used by the driver. | 12353 | * is not used by the driver. |
@@ -12938,6 +12955,8 @@ static int bnx2x_init_one(struct pci_dev *pdev, | |||
12938 | return 0; | 12955 | return 0; |
12939 | 12956 | ||
12940 | init_one_exit: | 12957 | init_one_exit: |
12958 | bnx2x_disable_pcie_error_reporting(bp); | ||
12959 | |||
12941 | if (bp->regview) | 12960 | if (bp->regview) |
12942 | iounmap(bp->regview); | 12961 | iounmap(bp->regview); |
12943 | 12962 | ||
@@ -13011,6 +13030,8 @@ static void __bnx2x_remove(struct pci_dev *pdev, | |||
13011 | pci_set_power_state(pdev, PCI_D3hot); | 13030 | pci_set_power_state(pdev, PCI_D3hot); |
13012 | } | 13031 | } |
13013 | 13032 | ||
13033 | bnx2x_disable_pcie_error_reporting(bp); | ||
13034 | |||
13014 | if (bp->regview) | 13035 | if (bp->regview) |
13015 | iounmap(bp->regview); | 13036 | iounmap(bp->regview); |
13016 | 13037 | ||
@@ -13188,6 +13209,14 @@ static pci_ers_result_t bnx2x_io_slot_reset(struct pci_dev *pdev) | |||
13188 | 13209 | ||
13189 | rtnl_unlock(); | 13210 | rtnl_unlock(); |
13190 | 13211 | ||
13212 | /* If AER, perform cleanup of the PCIe registers */ | ||
13213 | if (bp->flags & AER_ENABLED) { | ||
13214 | if (pci_cleanup_aer_uncorrect_error_status(pdev)) | ||
13215 | BNX2X_ERR("pci_cleanup_aer_uncorrect_error_status failed\n"); | ||
13216 | else | ||
13217 | DP(NETIF_MSG_HW, "pci_cleanup_aer_uncorrect_error_status succeeded\n"); | ||
13218 | } | ||
13219 | |||
13191 | return PCI_ERS_RESULT_RECOVERED; | 13220 | return PCI_ERS_RESULT_RECOVERED; |
13192 | } | 13221 | } |
13193 | 13222 | ||