* [PATCH net 1/1] bnx2x: recognize fan failure
@ 2012-12-03 9:56 Yuval Mintz
2012-12-03 18:47 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Yuval Mintz @ 2012-12-03 9:56 UTC (permalink / raw)
To: davem, netdev; +Cc: ariele, Yaniv Rosner, Yuval Mintz, Eilon Greenstein
From: Yaniv Rosner <yaniv.rosner@broadcom.com>
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>
---
Hi Dave,
This patch prevents a fatal error on newer bnx2x boards.
Please consider applying it to 'net'.
---
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 8 ++++++++
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 01611b3..101392b 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
@@ -11346,6 +11346,14 @@ static int __devinit bnx2x_init_dev(struct pci_dev *pdev,
goto err_out_disable;
}
+ pci_read_config_dword(pdev, PCICFG_REVISION_ID_OFFSET, &pci_cfg_dword);
+ if ((pci_cfg_dword & PCICFG_REVESION_ID_MASK) ==
+ PCICFG_REVESION_ID_ERROR_VAL) {
+ pr_err("PCI device error, probably due to fan failure, aborting\n");
+ rc = -ENODEV;
+ goto err_out_disable;
+ }
+
if (atomic_read(&pdev->enable_cnt) == 1) {
rc = pci_request_regions(pdev, DRV_MODULE_NAME);
if (rc) {
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_reg.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_reg.h
index 1b1999d..698cbf7 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_reg.h
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_reg.h
@@ -6130,7 +6130,9 @@
#define PCICFG_COMMAND_INT_DISABLE (1<<10)
#define PCICFG_COMMAND_RESERVED (0x1f<<11)
#define PCICFG_STATUS_OFFSET 0x06
-#define PCICFG_REVESION_ID_OFFSET 0x08
+#define PCICFG_REVISION_ID_OFFSET 0x08
+#define PCICFG_REVESION_ID_MASK 0xff
+#define PCICFG_REVESION_ID_ERROR_VAL 0xff
#define PCICFG_CACHE_LINE_SIZE 0x0c
#define PCICFG_LATENCY_TIMER 0x0d
#define PCICFG_BAR_1_LOW 0x10
--
1.7.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net 1/1] bnx2x: recognize fan failure
2012-12-03 9:56 [PATCH net 1/1] bnx2x: recognize fan failure Yuval Mintz
@ 2012-12-03 18:47 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2012-12-03 18:47 UTC (permalink / raw)
To: yuvalmin; +Cc: netdev, ariele, yaniv.rosner, eilong
From: "Yuval Mintz" <yuvalmin@broadcom.com>
Date: Mon, 3 Dec 2012 11:56:49 +0200
> From: Yaniv Rosner <yaniv.rosner@broadcom.com>
>
> 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>
> ---
> Hi Dave,
>
> This patch prevents a fatal error on newer bnx2x boards.
>
> Please consider applying it to 'net'.
Too late, I've applied it to net-next. I'm not asking Linus to hold back
an already delayed released for such a rarely triggering issue such as this
one.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-12-03 18:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-03 9:56 [PATCH net 1/1] bnx2x: recognize fan failure Yuval Mintz
2012-12-03 18:47 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).