Skip to content

Commit bc86fcb

Browse files
Amit Kumar Salechadavem330
authored andcommitted
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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent b4de921 commit bc86fcb

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

drivers/net/netxen/netxen_nic_main.c

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1448,14 +1448,14 @@ static int __netxen_nic_shutdown(struct pci_dev *pdev)
14481448
pci_enable_wake(pdev, PCI_D3hot, 1);
14491449
}
14501450

1451-
pci_disable_device(pdev);
1452-
14531451
return 0;
14541452
}
14551453
static void netxen_nic_shutdown(struct pci_dev *pdev)
14561454
{
14571455
if (__netxen_nic_shutdown(pdev))
14581456
return;
1457+
1458+
pci_disable_device(pdev);
14591459
}
14601460
#ifdef CONFIG_PM
14611461
static int
@@ -1468,6 +1468,8 @@ netxen_nic_suspend(struct pci_dev *pdev, pm_message_t state)
14681468
return retval;
14691469

14701470
pci_set_power_state(pdev, pci_choose_state(pdev, state));
1471+
1472+
pci_disable_device(pdev);
14711473
return 0;
14721474
}
14731475

@@ -1478,13 +1480,14 @@ netxen_nic_resume(struct pci_dev *pdev)
14781480
struct net_device *netdev = adapter->netdev;
14791481
int err;
14801482

1481-
pci_set_power_state(pdev, PCI_D0);
1482-
pci_restore_state(pdev);
1483-
14841483
err = pci_enable_device(pdev);
14851484
if (err)
14861485
return err;
14871486

1487+
pci_set_power_state(pdev, PCI_D0);
1488+
pci_set_master(pdev);
1489+
pci_restore_state(pdev);
1490+
14881491
adapter->ahw.crb_win = -1;
14891492
adapter->ahw.ocm_win = -1;
14901493

@@ -1503,11 +1506,10 @@ netxen_nic_resume(struct pci_dev *pdev)
15031506
if (err)
15041507
goto err_out_detach;
15051508

1506-
netif_device_attach(netdev);
1507-
15081509
netxen_config_indev_addr(netdev, NETDEV_UP);
15091510
}
15101511

1512+
netif_device_attach(netdev);
15111513
netxen_schedule_work(adapter, netxen_fw_poll_work, FW_POLL_DELAY);
15121514
return 0;
15131515

0 commit comments

Comments
 (0)