diff options
| author | Yaniv Rosner <yaniv.rosner@broadcom.com> | 2012-12-02 18:56:49 -0500 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2012-12-03 13:46:43 -0500 |
| commit | 092a5fc9636268bc2c0fef4d9b99845699cf19f9 (patch) | |
| tree | 4acad922142c39c72616abfd7b8581562af121d0 | |
| parent | 64e9a9b8a0eef9cbd9f86f0e79fc4eeea24abe76 (diff) | |
bnx2x: recognize fan failure
If fan failure is detected, MCP prevents PCI I/O registers from being
mapped to the bar, causing a fatal error as driver is unaware.
This patch recognizes such an event occurred and gracefully terminates
the probe process.
Signed-off-by: Yaniv Rosner <yaniv.rosner@broadcom.com>
Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
| -rw-r--r-- | drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 8 | ||||
| -rw-r--r-- | drivers/net/ethernet/broadcom/bnx2x/bnx2x_reg.h | 4 |
2 files changed, 11 insertions, 1 deletions
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c index c8ec3fcd2d35..6064294802af 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | |||
| @@ -11570,6 +11570,14 @@ static int __devinit bnx2x_init_dev(struct pci_dev *pdev, | |||
| 11570 | goto err_out_disable; | 11570 | goto err_out_disable; |
| 11571 | } | 11571 | } |
| 11572 | 11572 | ||
| 11573 | pci_read_config_dword(pdev, PCICFG_REVISION_ID_OFFSET, &pci_cfg_dword); | ||
| 11574 | if ((pci_cfg_dword & PCICFG_REVESION_ID_MASK) == | ||
| 11575 | PCICFG_REVESION_ID_ERROR_VAL) { | ||
| 11576 | pr_err("PCI device error, probably due to fan failure, aborting\n"); | ||
| 11577 | rc = -ENODEV; | ||
| 11578 | goto err_out_disable; | ||
| 11579 | } | ||
| 11580 | |||
| 11573 | if (atomic_read(&pdev->enable_cnt) == 1) { | 11581 | if (atomic_read(&pdev->enable_cnt) == 1) { |
| 11574 | rc = pci_request_regions(pdev, DRV_MODULE_NAME); | 11582 | rc = pci_request_regions(pdev, DRV_MODULE_NAME); |
| 11575 | if (rc) { | 11583 | if (rc) { |
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_reg.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_reg.h index 87cf37c71b30..bc2f65b32649 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_reg.h +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_reg.h | |||
| @@ -6160,7 +6160,9 @@ | |||
| 6160 | #define PCICFG_COMMAND_INT_DISABLE (1<<10) | 6160 | #define PCICFG_COMMAND_INT_DISABLE (1<<10) |
| 6161 | #define PCICFG_COMMAND_RESERVED (0x1f<<11) | 6161 | #define PCICFG_COMMAND_RESERVED (0x1f<<11) |
| 6162 | #define PCICFG_STATUS_OFFSET 0x06 | 6162 | #define PCICFG_STATUS_OFFSET 0x06 |
| 6163 | #define PCICFG_REVESION_ID_OFFSET 0x08 | 6163 | #define PCICFG_REVISION_ID_OFFSET 0x08 |
| 6164 | #define PCICFG_REVESION_ID_MASK 0xff | ||
| 6165 | #define PCICFG_REVESION_ID_ERROR_VAL 0xff | ||
| 6164 | #define PCICFG_CACHE_LINE_SIZE 0x0c | 6166 | #define PCICFG_CACHE_LINE_SIZE 0x0c |
| 6165 | #define PCICFG_LATENCY_TIMER 0x0d | 6167 | #define PCICFG_LATENCY_TIMER 0x0d |
| 6166 | #define PCICFG_BAR_1_LOW 0x10 | 6168 | #define PCICFG_BAR_1_LOW 0x10 |
