Skip to content

Commit

Permalink
ixgbe: Use pci_wake_from_d3() instead of multiple pci_enable_wake()
Browse files Browse the repository at this point in the history
We were calling pci_enable_wake() twice in a row for both D3_hot
and D3_cold.  This replaces those calls with a call to pci_wake_from_d3()
to avoid issues with PCI PM vs ordering constraints.

Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Don Skidmore authored and David S. Miller committed Apr 29, 2009
1 parent f7185c7 commit dd4d8ca
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions drivers/net/ixgbe/ixgbe_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -3738,8 +3738,7 @@ static int ixgbe_resume(struct pci_dev *pdev)
}
pci_set_master(pdev);

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

err = ixgbe_init_interrupt_scheme(adapter);
if (err) {
Expand Down Expand Up @@ -3813,13 +3812,10 @@ static int __ixgbe_shutdown(struct pci_dev *pdev, bool *enable_wake)
IXGBE_WRITE_REG(hw, IXGBE_WUFC, 0);
}

if (wufc && hw->mac.type == ixgbe_mac_82599EB) {
pci_enable_wake(pdev, PCI_D3hot, 1);
pci_enable_wake(pdev, PCI_D3cold, 1);
} else {
pci_enable_wake(pdev, PCI_D3hot, 0);
pci_enable_wake(pdev, PCI_D3cold, 0);
}
if (wufc && hw->mac.type == ixgbe_mac_82599EB)
pci_wake_from_d3(pdev, true);
else
pci_wake_from_d3(pdev, false);

*enable_wake = !!wufc;

Expand Down Expand Up @@ -5101,8 +5097,7 @@ static pci_ers_result_t ixgbe_io_slot_reset(struct pci_dev *pdev)
pci_set_master(pdev);
pci_restore_state(pdev);

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

ixgbe_reset(adapter);
IXGBE_WRITE_REG(&adapter->hw, IXGBE_WUS, ~0);
Expand Down

0 comments on commit dd4d8ca

Please sign in to comment.