diff options
author | Jesse Brandeburg <jesse.brandeburg@intel.com> | 2009-02-10 07:51:20 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-02-10 20:00:27 -0500 |
commit | 111b9dc5c981ba608b4afede37237cfeb67b07f2 (patch) | |
tree | a07fd7f540f0b5617c96a16b270c1900fae204e3 /drivers/net/e1000e | |
parent | b4ac530fc3af02a004729043dacf6b6330b46892 (diff) |
e1000e: add aer support
most if not all of the devices supported by e1000e support
AER (Advanced Error Reporting) so we attempt to register
with the OS that we know how to reset ourselves after
a fatal error.
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@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/e1000e')
-rw-r--r-- | drivers/net/e1000e/netdev.c | 39 |
1 files changed, 30 insertions, 9 deletions
diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c index c425b19e3362..00e19e93bb93 100644 --- a/drivers/net/e1000e/netdev.c +++ b/drivers/net/e1000e/netdev.c | |||
@@ -44,6 +44,7 @@ | |||
44 | #include <linux/cpu.h> | 44 | #include <linux/cpu.h> |
45 | #include <linux/smp.h> | 45 | #include <linux/smp.h> |
46 | #include <linux/pm_qos_params.h> | 46 | #include <linux/pm_qos_params.h> |
47 | #include <linux/aer.h> | ||
47 | 48 | ||
48 | #include "e1000.h" | 49 | #include "e1000.h" |
49 | 50 | ||
@@ -4521,6 +4522,14 @@ static int e1000_resume(struct pci_dev *pdev) | |||
4521 | return err; | 4522 | return err; |
4522 | } | 4523 | } |
4523 | 4524 | ||
4525 | /* AER (Advanced Error Reporting) hooks */ | ||
4526 | err = pci_enable_pcie_error_reporting(pdev); | ||
4527 | if (err) { | ||
4528 | dev_err(&pdev->dev, "pci_enable_pcie_error_reporting failed " | ||
4529 | "0x%x\n", err); | ||
4530 | /* non-fatal, continue */ | ||
4531 | } | ||
4532 | |||
4524 | pci_set_master(pdev); | 4533 | pci_set_master(pdev); |
4525 | 4534 | ||
4526 | pci_enable_wake(pdev, PCI_D3hot, 0); | 4535 | pci_enable_wake(pdev, PCI_D3hot, 0); |
@@ -4615,24 +4624,29 @@ static pci_ers_result_t e1000_io_slot_reset(struct pci_dev *pdev) | |||
4615 | struct e1000_adapter *adapter = netdev_priv(netdev); | 4624 | struct e1000_adapter *adapter = netdev_priv(netdev); |
4616 | struct e1000_hw *hw = &adapter->hw; | 4625 | struct e1000_hw *hw = &adapter->hw; |
4617 | int err; | 4626 | int err; |
4627 | pci_ers_result_t result; | ||
4618 | 4628 | ||
4619 | e1000e_disable_l1aspm(pdev); | 4629 | e1000e_disable_l1aspm(pdev); |
4620 | err = pci_enable_device_mem(pdev); | 4630 | err = pci_enable_device_mem(pdev); |
4621 | if (err) { | 4631 | if (err) { |
4622 | dev_err(&pdev->dev, | 4632 | dev_err(&pdev->dev, |
4623 | "Cannot re-enable PCI device after reset.\n"); | 4633 | "Cannot re-enable PCI device after reset.\n"); |
4624 | return PCI_ERS_RESULT_DISCONNECT; | 4634 | result = PCI_ERS_RESULT_DISCONNECT; |
4625 | } | 4635 | } else { |
4626 | pci_set_master(pdev); | 4636 | pci_set_master(pdev); |
4627 | pci_restore_state(pdev); | 4637 | pci_restore_state(pdev); |
4628 | 4638 | ||
4629 | pci_enable_wake(pdev, PCI_D3hot, 0); | 4639 | pci_enable_wake(pdev, PCI_D3hot, 0); |
4630 | pci_enable_wake(pdev, PCI_D3cold, 0); | 4640 | pci_enable_wake(pdev, PCI_D3cold, 0); |
4631 | 4641 | ||
4632 | e1000e_reset(adapter); | 4642 | e1000e_reset(adapter); |
4633 | ew32(WUS, ~0); | 4643 | ew32(WUS, ~0); |
4644 | result = PCI_ERS_RESULT_RECOVERED; | ||
4645 | } | ||
4634 | 4646 | ||
4635 | return PCI_ERS_RESULT_RECOVERED; | 4647 | pci_cleanup_aer_uncorrect_error_status(pdev); |
4648 | |||
4649 | return result; | ||
4636 | } | 4650 | } |
4637 | 4651 | ||
4638 | /** | 4652 | /** |
@@ -5063,6 +5077,7 @@ static void __devexit e1000_remove(struct pci_dev *pdev) | |||
5063 | { | 5077 | { |
5064 | struct net_device *netdev = pci_get_drvdata(pdev); | 5078 | struct net_device *netdev = pci_get_drvdata(pdev); |
5065 | struct e1000_adapter *adapter = netdev_priv(netdev); | 5079 | struct e1000_adapter *adapter = netdev_priv(netdev); |
5080 | int err; | ||
5066 | 5081 | ||
5067 | /* | 5082 | /* |
5068 | * flush_scheduled work may reschedule our watchdog task, so | 5083 | * flush_scheduled work may reschedule our watchdog task, so |
@@ -5097,6 +5112,12 @@ static void __devexit e1000_remove(struct pci_dev *pdev) | |||
5097 | 5112 | ||
5098 | free_netdev(netdev); | 5113 | free_netdev(netdev); |
5099 | 5114 | ||
5115 | /* AER disable */ | ||
5116 | err = pci_disable_pcie_error_reporting(pdev); | ||
5117 | if (err) | ||
5118 | dev_err(&pdev->dev, | ||
5119 | "pci_disable_pcie_error_reporting failed 0x%x\n", err); | ||
5120 | |||
5100 | pci_disable_device(pdev); | 5121 | pci_disable_device(pdev); |
5101 | } | 5122 | } |
5102 | 5123 | ||