diff options
author | Amit Kumar Salecha <amit.salecha@qlogic.com> | 2009-12-08 15:40:54 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-12-23 17:13:26 -0500 |
commit | bc86fcbac0a86a93ee65cc31769c4e83e6ff2295 (patch) | |
tree | 8be1785bdebded3c125af8797a4e7dd0d9d9d39a /drivers/net/netxen | |
parent | b4de921ae6f7bb211868be4f7d56e80ac6da676c (diff) |
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: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/netxen')
-rw-r--r-- | drivers/net/netxen/netxen_nic_main.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c index 6cae26a5bd67..41cb0af4b556 100644 --- a/drivers/net/netxen/netxen_nic_main.c +++ b/drivers/net/netxen/netxen_nic_main.c | |||
@@ -1448,14 +1448,14 @@ static int __netxen_nic_shutdown(struct pci_dev *pdev) | |||
1448 | pci_enable_wake(pdev, PCI_D3hot, 1); | 1448 | pci_enable_wake(pdev, PCI_D3hot, 1); |
1449 | } | 1449 | } |
1450 | 1450 | ||
1451 | pci_disable_device(pdev); | ||
1452 | |||
1453 | return 0; | 1451 | return 0; |
1454 | } | 1452 | } |
1455 | static void netxen_nic_shutdown(struct pci_dev *pdev) | 1453 | static void netxen_nic_shutdown(struct pci_dev *pdev) |
1456 | { | 1454 | { |
1457 | if (__netxen_nic_shutdown(pdev)) | 1455 | if (__netxen_nic_shutdown(pdev)) |
1458 | return; | 1456 | return; |
1457 | |||
1458 | pci_disable_device(pdev); | ||
1459 | } | 1459 | } |
1460 | #ifdef CONFIG_PM | 1460 | #ifdef CONFIG_PM |
1461 | static int | 1461 | static int |
@@ -1468,6 +1468,8 @@ netxen_nic_suspend(struct pci_dev *pdev, pm_message_t state) | |||
1468 | return retval; | 1468 | return retval; |
1469 | 1469 | ||
1470 | pci_set_power_state(pdev, pci_choose_state(pdev, state)); | 1470 | pci_set_power_state(pdev, pci_choose_state(pdev, state)); |
1471 | |||
1472 | pci_disable_device(pdev); | ||
1471 | return 0; | 1473 | return 0; |
1472 | } | 1474 | } |
1473 | 1475 | ||
@@ -1478,13 +1480,14 @@ netxen_nic_resume(struct pci_dev *pdev) | |||
1478 | struct net_device *netdev = adapter->netdev; | 1480 | struct net_device *netdev = adapter->netdev; |
1479 | int err; | 1481 | int err; |
1480 | 1482 | ||
1481 | pci_set_power_state(pdev, PCI_D0); | ||
1482 | pci_restore_state(pdev); | ||
1483 | |||
1484 | err = pci_enable_device(pdev); | 1483 | err = pci_enable_device(pdev); |
1485 | if (err) | 1484 | if (err) |
1486 | return err; | 1485 | return err; |
1487 | 1486 | ||
1487 | pci_set_power_state(pdev, PCI_D0); | ||
1488 | pci_set_master(pdev); | ||
1489 | pci_restore_state(pdev); | ||
1490 | |||
1488 | adapter->ahw.crb_win = -1; | 1491 | adapter->ahw.crb_win = -1; |
1489 | adapter->ahw.ocm_win = -1; | 1492 | adapter->ahw.ocm_win = -1; |
1490 | 1493 | ||
@@ -1503,11 +1506,10 @@ netxen_nic_resume(struct pci_dev *pdev) | |||
1503 | if (err) | 1506 | if (err) |
1504 | goto err_out_detach; | 1507 | goto err_out_detach; |
1505 | 1508 | ||
1506 | netif_device_attach(netdev); | ||
1507 | |||
1508 | netxen_config_indev_addr(netdev, NETDEV_UP); | 1509 | netxen_config_indev_addr(netdev, NETDEV_UP); |
1509 | } | 1510 | } |
1510 | 1511 | ||
1512 | netif_device_attach(netdev); | ||
1511 | netxen_schedule_work(adapter, netxen_fw_poll_work, FW_POLL_DELAY); | 1513 | netxen_schedule_work(adapter, netxen_fw_poll_work, FW_POLL_DELAY); |
1512 | return 0; | 1514 | return 0; |
1513 | 1515 | ||