Commit bc86fcba authored by Amit Kumar Salecha's avatar Amit Kumar Salecha Committed by David S. Miller

netxen: minor suspend resume fixes

o pci device should be disable at the end and it should be enable first.
o Interface should be attached(netif_device_attach()) irrespective
  of its state.
Signed-off-by: default avatarAmit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b4de921a
...@@ -1448,14 +1448,14 @@ static int __netxen_nic_shutdown(struct pci_dev *pdev) ...@@ -1448,14 +1448,14 @@ static int __netxen_nic_shutdown(struct pci_dev *pdev)
pci_enable_wake(pdev, PCI_D3hot, 1); pci_enable_wake(pdev, PCI_D3hot, 1);
} }
pci_disable_device(pdev);
return 0; return 0;
} }
static void netxen_nic_shutdown(struct pci_dev *pdev) static void netxen_nic_shutdown(struct pci_dev *pdev)
{ {
if (__netxen_nic_shutdown(pdev)) if (__netxen_nic_shutdown(pdev))
return; return;
pci_disable_device(pdev);
} }
#ifdef CONFIG_PM #ifdef CONFIG_PM
static int static int
...@@ -1468,6 +1468,8 @@ netxen_nic_suspend(struct pci_dev *pdev, pm_message_t state) ...@@ -1468,6 +1468,8 @@ netxen_nic_suspend(struct pci_dev *pdev, pm_message_t state)
return retval; return retval;
pci_set_power_state(pdev, pci_choose_state(pdev, state)); pci_set_power_state(pdev, pci_choose_state(pdev, state));
pci_disable_device(pdev);
return 0; return 0;
} }
...@@ -1478,13 +1480,14 @@ netxen_nic_resume(struct pci_dev *pdev) ...@@ -1478,13 +1480,14 @@ netxen_nic_resume(struct pci_dev *pdev)
struct net_device *netdev = adapter->netdev; struct net_device *netdev = adapter->netdev;
int err; int err;
pci_set_power_state(pdev, PCI_D0);
pci_restore_state(pdev);
err = pci_enable_device(pdev); err = pci_enable_device(pdev);
if (err) if (err)
return err; return err;
pci_set_power_state(pdev, PCI_D0);
pci_set_master(pdev);
pci_restore_state(pdev);
adapter->ahw.crb_win = -1; adapter->ahw.crb_win = -1;
adapter->ahw.ocm_win = -1; adapter->ahw.ocm_win = -1;
...@@ -1503,11 +1506,10 @@ netxen_nic_resume(struct pci_dev *pdev) ...@@ -1503,11 +1506,10 @@ netxen_nic_resume(struct pci_dev *pdev)
if (err) if (err)
goto err_out_detach; goto err_out_detach;
netif_device_attach(netdev);
netxen_config_indev_addr(netdev, NETDEV_UP); netxen_config_indev_addr(netdev, NETDEV_UP);
} }
netif_device_attach(netdev);
netxen_schedule_work(adapter, netxen_fw_poll_work, FW_POLL_DELAY); netxen_schedule_work(adapter, netxen_fw_poll_work, FW_POLL_DELAY);
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment