Skip to content

Commit

Permalink
igb: Add support for pci-e Advanced Error Reporting
Browse files Browse the repository at this point in the history
Add the calls necessary to enable advanced error reporting for igb on
systems with AER enabled.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Alexander Duyck authored and David S. Miller committed Nov 27, 2008
1 parent f411303 commit 40a914f
Showing 1 changed file with 20 additions and 10 deletions.
30 changes: 20 additions & 10 deletions drivers/net/igb/igb_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/if_ether.h>
#include <linux/aer.h>
#ifdef CONFIG_IGB_DCA
#include <linux/dca.h>
#endif
Expand Down Expand Up @@ -1049,6 +1050,8 @@ static int __devinit igb_probe(struct pci_dev *pdev,
if (err)
goto err_pci_reg;

pci_enable_pcie_error_reporting(pdev);

pci_set_master(pdev);
pci_save_state(pdev);

Expand Down Expand Up @@ -1379,6 +1382,8 @@ static void __devexit igb_remove(struct pci_dev *pdev)

free_netdev(netdev);

pci_disable_pcie_error_reporting(pdev);

pci_disable_device(pdev);
}

Expand Down Expand Up @@ -4470,27 +4475,33 @@ static pci_ers_result_t igb_io_slot_reset(struct pci_dev *pdev)
struct net_device *netdev = pci_get_drvdata(pdev);
struct igb_adapter *adapter = netdev_priv(netdev);
struct e1000_hw *hw = &adapter->hw;
pci_ers_result_t result;
int err;

if (adapter->need_ioport)
err = pci_enable_device(pdev);
else
err = pci_enable_device_mem(pdev);

if (err) {
dev_err(&pdev->dev,
"Cannot re-enable PCI device after reset.\n");
return PCI_ERS_RESULT_DISCONNECT;
}
pci_set_master(pdev);
pci_restore_state(pdev);
result = PCI_ERS_RESULT_DISCONNECT;
} else {
pci_set_master(pdev);
pci_restore_state(pdev);

pci_enable_wake(pdev, PCI_D3hot, 0);
pci_enable_wake(pdev, PCI_D3cold, 0);
pci_enable_wake(pdev, PCI_D3hot, 0);
pci_enable_wake(pdev, PCI_D3cold, 0);

igb_reset(adapter);
wr32(E1000_WUS, ~0);
igb_reset(adapter);
wr32(E1000_WUS, ~0);
result = PCI_ERS_RESULT_RECOVERED;
}

return PCI_ERS_RESULT_RECOVERED;
pci_cleanup_aer_uncorrect_error_status(pdev);

return result;
}

/**
Expand Down Expand Up @@ -4518,7 +4529,6 @@ static void igb_io_resume(struct pci_dev *pdev)
/* let the f/w know that the h/w is now under the control of the
* driver. */
igb_get_hw_control(adapter);

}

/* igb_main.c */

0 comments on commit 40a914f

Please sign in to comment.