netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] bnx2: Add PCI Advanced Error Reporting support.
@ 2010-08-23  3:45 Benjamin Li
  2010-08-23  3:45 ` [PATCH net-next 1/1] " Benjamin Li
  0 siblings, 1 reply; 3+ messages in thread
From: Benjamin Li @ 2010-08-23  3:45 UTC (permalink / raw)
  To: 	netdev@vger.kernel.org; +Cc: Benjamin Li

Sorry, the patch to add PCI Advanced Error Reporting support to the bnx2 driver should goto the net-next tree.  I apologize for the confusion.  Please direct this patch to the net-next tree.

Thanks again.

-Ben

John Feeney (1):
  bnx2: Add PCI Advanced Error Reporting support.

 drivers/net/bnx2.c |   44 ++++++++++++++++++++++++++++++++++----------
 1 files changed, 34 insertions(+), 10 deletions(-)



^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH net-next 1/1] bnx2: Add PCI Advanced Error Reporting support.
  2010-08-23  3:45 [PATCH net-next] bnx2: Add PCI Advanced Error Reporting support Benjamin Li
@ 2010-08-23  3:45 ` Benjamin Li
  2010-08-23  4:14   ` David Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Benjamin Li @ 2010-08-23  3:45 UTC (permalink / raw)
  To: 	netdev@vger.kernel.org; +Cc: John Feeney, Michael Chan, Benjamin Li

From: John Feeney <jfeeney@redhat.com>

Signed-off-by: John Feeney <jfeeney@redhat.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: Benjamin Li <benli@broadcom.com>
---
 drivers/net/bnx2.c |   44 ++++++++++++++++++++++++++++++++++----------
 1 files changed, 34 insertions(+), 10 deletions(-)

diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
index e6a803f..a0e02aa 100644
--- a/drivers/net/bnx2.c
+++ b/drivers/net/bnx2.c
@@ -49,6 +49,7 @@
 #include <linux/cache.h>
 #include <linux/firmware.h>
 #include <linux/log2.h>
+#include <linux/aer.h>
 
 #if defined(CONFIG_CNIC) || defined(CONFIG_CNIC_MODULE)
 #define BCM_CNIC 1
@@ -7890,6 +7891,7 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev)
 	int rc, i, j;
 	u32 reg;
 	u64 dma_mask, persist_dma_mask;
+	int err;
 
 	SET_NETDEV_DEV(dev, &pdev->dev);
 	bp = netdev_priv(dev);
@@ -7925,6 +7927,14 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev)
 		goto err_out_disable;
 	}
 
+	/* AER (Advanced Error Reporting) hooks */
+	err = pci_enable_pcie_error_reporting(pdev);
+	if (err) {
+		dev_err(&pdev->dev, "pci_enable_pcie_error_reporting failed "
+				    "0x%x\n", err);
+		/* non-fatal, continue */
+	}
+
 	pci_set_master(pdev);
 	pci_save_state(pdev);
 
@@ -8246,6 +8256,7 @@ err_out_unmap:
 	}
 
 err_out_release:
+	pci_disable_pcie_error_reporting(pdev);
 	pci_release_regions(pdev);
 
 err_out_disable:
@@ -8436,6 +8447,9 @@ bnx2_remove_one(struct pci_dev *pdev)
 	kfree(bp->temp_stats_blk);
 
 	free_netdev(dev);
+
+	pci_disable_pcie_error_reporting(pdev);
+
 	pci_release_regions(pdev);
 	pci_disable_device(pdev);
 	pci_set_drvdata(pdev, NULL);
@@ -8527,25 +8541,35 @@ static pci_ers_result_t bnx2_io_slot_reset(struct pci_dev *pdev)
 {
 	struct net_device *dev = pci_get_drvdata(pdev);
 	struct bnx2 *bp = netdev_priv(dev);
+	pci_ers_result_t result;
+	int err;
 
 	rtnl_lock();
 	if (pci_enable_device(pdev)) {
 		dev_err(&pdev->dev,
 			"Cannot re-enable PCI device after reset\n");
-		rtnl_unlock();
-		return PCI_ERS_RESULT_DISCONNECT;
+		result = PCI_ERS_RESULT_DISCONNECT;
+	} else {
+		pci_set_master(pdev);
+		pci_restore_state(pdev);
+		pci_save_state(pdev);
+
+		if (netif_running(dev)) {
+			bnx2_set_power_state(bp, PCI_D0);
+			bnx2_init_nic(bp, 1);
+		}
+		result = PCI_ERS_RESULT_RECOVERED;
 	}
-	pci_set_master(pdev);
-	pci_restore_state(pdev);
-	pci_save_state(pdev);
+	rtnl_unlock();
 
-	if (netif_running(dev)) {
-		bnx2_set_power_state(bp, PCI_D0);
-		bnx2_init_nic(bp, 1);
+	err = pci_cleanup_aer_uncorrect_error_status(pdev);
+	if (err) {
+		dev_err(&pdev->dev,
+			"pci_cleanup_aer_uncorrect_error_status failed 0x%0x\n",
+			 err); /* non-fatal, continue */
 	}
 
-	rtnl_unlock();
-	return PCI_ERS_RESULT_RECOVERED;
+	return result;
 }
 
 /**
-- 
1.6.1.2



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next 1/1] bnx2: Add PCI Advanced Error Reporting support.
  2010-08-23  3:45 ` [PATCH net-next 1/1] " Benjamin Li
@ 2010-08-23  4:14   ` David Miller
  0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2010-08-23  4:14 UTC (permalink / raw)
  To: benli; +Cc: netdev, jfeeney, mchan

From: "Benjamin Li" <benli@broadcom.com>
Date: Sun, 22 Aug 2010 20:45:53 -0700

> From: John Feeney <jfeeney@redhat.com>
> 
> Signed-off-by: John Feeney <jfeeney@redhat.com>
> Signed-off-by: Michael Chan <mchan@broadcom.com>
> Signed-off-by: Benjamin Li <benli@broadcom.com>

Applied.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-08-23  4:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-23  3:45 [PATCH net-next] bnx2: Add PCI Advanced Error Reporting support Benjamin Li
2010-08-23  3:45 ` [PATCH net-next 1/1] " Benjamin Li
2010-08-23  4:14   ` 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).