aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShreyas Bhatewara <sbhatewara@vmware.com>2011-01-14 09:59:52 -0500
committerDavid S. Miller <davem@davemloft.net>2011-01-16 00:21:13 -0500
commit51956cd68b0c3039968485317b77a89dfec95eab (patch)
treeea605942bc10305777223a31eb86eca8016535f1
parent76d39dae0ad47f51291b4dd146b10d71e8ae02f7 (diff)
vmxnet3: Disable napi in suspend, reenable in resume.
There is a small possibility of a race where the suspend routine gets called, while a napi callback is still pending and when that comes up, it enables interrupts which just got disabled in the suspend routine. This change adds napi disable call in suspend and enable in resume to avoid race. Signed-off-by: Shreyas N Bhatewara <sbhatewara@vmware.com> Acked-by: Dmitry Torokhov <dtor@vmware.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/vmxnet3/vmxnet3_drv.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/net/vmxnet3/vmxnet3_drv.c b/drivers/net/vmxnet3/vmxnet3_drv.c
index a1632a995380..20ef4f36ea2e 100644
--- a/drivers/net/vmxnet3/vmxnet3_drv.c
+++ b/drivers/net/vmxnet3/vmxnet3_drv.c
@@ -3101,6 +3101,9 @@ vmxnet3_suspend(struct device *device)
3101 if (!netif_running(netdev)) 3101 if (!netif_running(netdev))
3102 return 0; 3102 return 0;
3103 3103
3104 for (i = 0; i < adapter->num_rx_queues; i++)
3105 napi_disable(&adapter->rx_queue[i].napi);
3106
3104 vmxnet3_disable_all_intrs(adapter); 3107 vmxnet3_disable_all_intrs(adapter);
3105 vmxnet3_free_irqs(adapter); 3108 vmxnet3_free_irqs(adapter);
3106 vmxnet3_free_intr_resources(adapter); 3109 vmxnet3_free_intr_resources(adapter);
@@ -3192,7 +3195,7 @@ skip_arp:
3192static int 3195static int
3193vmxnet3_resume(struct device *device) 3196vmxnet3_resume(struct device *device)
3194{ 3197{
3195 int err; 3198 int err, i = 0;
3196 struct pci_dev *pdev = to_pci_dev(device); 3199 struct pci_dev *pdev = to_pci_dev(device);
3197 struct net_device *netdev = pci_get_drvdata(pdev); 3200 struct net_device *netdev = pci_get_drvdata(pdev);
3198 struct vmxnet3_adapter *adapter = netdev_priv(netdev); 3201 struct vmxnet3_adapter *adapter = netdev_priv(netdev);
@@ -3224,6 +3227,8 @@ vmxnet3_resume(struct device *device)
3224 VMXNET3_CMD_UPDATE_PMCFG); 3227 VMXNET3_CMD_UPDATE_PMCFG);
3225 vmxnet3_alloc_intr_resources(adapter); 3228 vmxnet3_alloc_intr_resources(adapter);
3226 vmxnet3_request_irqs(adapter); 3229 vmxnet3_request_irqs(adapter);
3230 for (i = 0; i < adapter->num_rx_queues; i++)
3231 napi_enable(&adapter->rx_queue[i].napi);
3227 vmxnet3_enable_all_intrs(adapter); 3232 vmxnet3_enable_all_intrs(adapter);
3228 3233
3229 return 0; 3234 return 0;