aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorMichael Chan <mchan@broadcom.com>2007-08-03 23:57:25 -0400
committerDavid S. Miller <davem@davemloft.net>2007-08-03 23:57:25 -0400
commit6caebb02294b503c5eced4a3f90e6166548ce879 (patch)
tree6917658242f8c2da95ffdc1817a5944a07f53213 /drivers/net
parent3e0c95fd648c0d3175b9ff2232597d0b02eb7d46 (diff)
[BNX2]: Fix suspend/resume problem.
The device would not resume properly if it was shutdown before the system was suspended. In such scenario where the netif_running state is 0, bnx2_suspend() would not save the PCI state and so the memory enable bit and bus master enable bit would be lost. We fix this by always saving and restoring the PCI state in bnx2_suspend() and bnx2_resume() regardless of netif_running() state. Update version to 1.6.4. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/bnx2.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
index d53dfc5bbae0..24e7f9ab3f5a 100644
--- a/drivers/net/bnx2.c
+++ b/drivers/net/bnx2.c
@@ -54,8 +54,8 @@
54 54
55#define DRV_MODULE_NAME "bnx2" 55#define DRV_MODULE_NAME "bnx2"
56#define PFX DRV_MODULE_NAME ": " 56#define PFX DRV_MODULE_NAME ": "
57#define DRV_MODULE_VERSION "1.6.3" 57#define DRV_MODULE_VERSION "1.6.4"
58#define DRV_MODULE_RELDATE "July 16, 2007" 58#define DRV_MODULE_RELDATE "August 3, 2007"
59 59
60#define RUN_AT(x) (jiffies + (x)) 60#define RUN_AT(x) (jiffies + (x))
61 61
@@ -6937,6 +6937,11 @@ bnx2_suspend(struct pci_dev *pdev, pm_message_t state)
6937 struct bnx2 *bp = netdev_priv(dev); 6937 struct bnx2 *bp = netdev_priv(dev);
6938 u32 reset_code; 6938 u32 reset_code;
6939 6939
6940 /* PCI register 4 needs to be saved whether netif_running() or not.
6941 * MSI address and data need to be saved if using MSI and
6942 * netif_running().
6943 */
6944 pci_save_state(pdev);
6940 if (!netif_running(dev)) 6945 if (!netif_running(dev))
6941 return 0; 6946 return 0;
6942 6947
@@ -6952,7 +6957,6 @@ bnx2_suspend(struct pci_dev *pdev, pm_message_t state)
6952 reset_code = BNX2_DRV_MSG_CODE_SUSPEND_NO_WOL; 6957 reset_code = BNX2_DRV_MSG_CODE_SUSPEND_NO_WOL;
6953 bnx2_reset_chip(bp, reset_code); 6958 bnx2_reset_chip(bp, reset_code);
6954 bnx2_free_skbs(bp); 6959 bnx2_free_skbs(bp);
6955 pci_save_state(pdev);
6956 bnx2_set_power_state(bp, pci_choose_state(pdev, state)); 6960 bnx2_set_power_state(bp, pci_choose_state(pdev, state));
6957 return 0; 6961 return 0;
6958} 6962}
@@ -6963,10 +6967,10 @@ bnx2_resume(struct pci_dev *pdev)
6963 struct net_device *dev = pci_get_drvdata(pdev); 6967 struct net_device *dev = pci_get_drvdata(pdev);
6964 struct bnx2 *bp = netdev_priv(dev); 6968 struct bnx2 *bp = netdev_priv(dev);
6965 6969
6970 pci_restore_state(pdev);
6966 if (!netif_running(dev)) 6971 if (!netif_running(dev))
6967 return 0; 6972 return 0;
6968 6973
6969 pci_restore_state(pdev);
6970 bnx2_set_power_state(bp, PCI_D0); 6974 bnx2_set_power_state(bp, PCI_D0);
6971 netif_device_attach(dev); 6975 netif_device_attach(dev);
6972 bnx2_init_nic(bp); 6976 bnx2_init_nic(bp);