aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorPeter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>2008-12-10 04:13:08 -0500
committerDavid S. Miller <davem@davemloft.net>2008-12-10 04:13:08 -0500
commit6fabd715e6d8e1b37c0c66d9bfda2c19643e3f77 (patch)
tree93c082c53fc4035285f111f87df974e85eed51aa /drivers/net
parent5e8427e5e25e3f844113cf67d07e7806bbe8c0e2 (diff)
ixgbe: Implement PCIe AER support
This patch implements the PCIe Advanced Error Reporting callbacks in ixgbe. The 82598 hardware supports AER, so we enable it. Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/ixgbe/ixgbe.h1
-rw-r--r--drivers/net/ixgbe/ixgbe_main.c41
2 files changed, 34 insertions, 8 deletions
diff --git a/drivers/net/ixgbe/ixgbe.h b/drivers/net/ixgbe/ixgbe.h
index 6cbf26e3db80..e112008f39c1 100644
--- a/drivers/net/ixgbe/ixgbe.h
+++ b/drivers/net/ixgbe/ixgbe.h
@@ -32,6 +32,7 @@
32#include <linux/pci.h> 32#include <linux/pci.h>
33#include <linux/netdevice.h> 33#include <linux/netdevice.h>
34#include <linux/inet_lro.h> 34#include <linux/inet_lro.h>
35#include <linux/aer.h>
35 36
36#include "ixgbe_type.h" 37#include "ixgbe_type.h"
37#include "ixgbe_common.h" 38#include "ixgbe_common.h"
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index a7aa892fee3f..d6f666ae38d3 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -4020,6 +4020,13 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev,
4020 goto err_pci_reg; 4020 goto err_pci_reg;
4021 } 4021 }
4022 4022
4023 err = pci_enable_pcie_error_reporting(pdev);
4024 if (err) {
4025 dev_err(&pdev->dev, "pci_enable_pcie_error_reporting failed "
4026 "0x%x\n", err);
4027 /* non-fatal, continue */
4028 }
4029
4023 pci_set_master(pdev); 4030 pci_set_master(pdev);
4024 pci_save_state(pdev); 4031 pci_save_state(pdev);
4025 4032
@@ -4257,6 +4264,7 @@ static void __devexit ixgbe_remove(struct pci_dev *pdev)
4257{ 4264{
4258 struct net_device *netdev = pci_get_drvdata(pdev); 4265 struct net_device *netdev = pci_get_drvdata(pdev);
4259 struct ixgbe_adapter *adapter = netdev_priv(netdev); 4266 struct ixgbe_adapter *adapter = netdev_priv(netdev);
4267 int err;
4260 4268
4261 set_bit(__IXGBE_DOWN, &adapter->state); 4269 set_bit(__IXGBE_DOWN, &adapter->state);
4262 /* clear the module not found bit to make sure the worker won't 4270 /* clear the module not found bit to make sure the worker won't
@@ -4295,6 +4303,11 @@ static void __devexit ixgbe_remove(struct pci_dev *pdev)
4295 4303
4296 free_netdev(netdev); 4304 free_netdev(netdev);
4297 4305
4306 err = pci_disable_pcie_error_reporting(pdev);
4307 if (err)
4308 dev_err(&pdev->dev,
4309 "pci_disable_pcie_error_reporting failed 0x%x\n", err);
4310
4298 pci_disable_device(pdev); 4311 pci_disable_device(pdev);
4299} 4312}
4300 4313
@@ -4332,21 +4345,33 @@ static pci_ers_result_t ixgbe_io_slot_reset(struct pci_dev *pdev)
4332{ 4345{
4333 struct net_device *netdev = pci_get_drvdata(pdev); 4346 struct net_device *netdev = pci_get_drvdata(pdev);
4334 struct ixgbe_adapter *adapter = netdev_priv(netdev); 4347 struct ixgbe_adapter *adapter = netdev_priv(netdev);
4348 pci_ers_result_t result;
4349 int err;
4335 4350
4336 if (pci_enable_device(pdev)) { 4351 if (pci_enable_device(pdev)) {
4337 DPRINTK(PROBE, ERR, 4352 DPRINTK(PROBE, ERR,
4338 "Cannot re-enable PCI device after reset.\n"); 4353 "Cannot re-enable PCI device after reset.\n");
4339 return PCI_ERS_RESULT_DISCONNECT; 4354 result = PCI_ERS_RESULT_DISCONNECT;
4340 } 4355 } else {
4341 pci_set_master(pdev); 4356 pci_set_master(pdev);
4342 pci_restore_state(pdev); 4357 pci_restore_state(pdev);
4343 4358
4344 pci_enable_wake(pdev, PCI_D3hot, 0); 4359 pci_enable_wake(pdev, PCI_D3hot, 0);
4345 pci_enable_wake(pdev, PCI_D3cold, 0); 4360 pci_enable_wake(pdev, PCI_D3cold, 0);
4346 4361
4347 ixgbe_reset(adapter); 4362 ixgbe_reset(adapter);
4363
4364 result = PCI_ERS_RESULT_RECOVERED;
4365 }
4366
4367 err = pci_cleanup_aer_uncorrect_error_status(pdev);
4368 if (err) {
4369 dev_err(&pdev->dev,
4370 "pci_cleanup_aer_uncorrect_error_status failed 0x%0x\n", err);
4371 /* non-fatal, continue */
4372 }
4348 4373
4349 return PCI_ERS_RESULT_RECOVERED; 4374 return result;
4350} 4375}
4351 4376
4352/** 4377/**