From: Steve Hodgson <steve@purestorage.com>
To: "Shreyas Bhatewara" <sbhatewara@vmware.com>,
pv-drivers@vmware.com, netdev@vger.kernel.org,
"David S. Miller" <davem@davemloft.net>
Cc: Steve Hodgson <steve@purestorage.com>
Subject: [PATCH] vmxnet3: Fix race between dev_open() and register_netdev()
Date: Tue, 14 Aug 2012 17:13:36 +0100 [thread overview]
Message-ID: <1344960816-12022-1-git-send-email-steve@purestorage.com> (raw)
dev_open() can complete before register_netdev() returns.
Fix vmxnet3_probe_device() to support this.
Signed-off-by: Steve Hodgson <steve@purestorage.com>
---
drivers/net/vmxnet3/vmxnet3_drv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/vmxnet3/vmxnet3_drv.c b/drivers/net/vmxnet3/vmxnet3_drv.c
index 93e0cfb..ce9d4f2 100644
--- a/drivers/net/vmxnet3/vmxnet3_drv.c
+++ b/drivers/net/vmxnet3/vmxnet3_drv.c
@@ -3019,6 +3019,7 @@ vmxnet3_probe_device(struct pci_dev *pdev,
netdev->watchdog_timeo = 5 * HZ;
INIT_WORK(&adapter->work, vmxnet3_reset_work);
+ set_bit(VMXNET3_STATE_BIT_QUIESCED, &adapter->state);
if (adapter->intr.type == VMXNET3_IT_MSIX) {
int i;
@@ -3043,7 +3044,6 @@ vmxnet3_probe_device(struct pci_dev *pdev,
goto err_register;
}
- set_bit(VMXNET3_STATE_BIT_QUIESCED, &adapter->state);
vmxnet3_check_link(adapter, false);
atomic_inc(&devices_found);
return 0;
--
1.7.9.5
next reply other threads:[~2012-08-14 16:21 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-14 16:13 Steve Hodgson [this message]
2012-08-15 22:10 ` [PATCH] vmxnet3: Fix race between dev_open() and register_netdev() David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1344960816-12022-1-git-send-email-steve@purestorage.com \
--to=steve@purestorage.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=pv-drivers@vmware.com \
--cc=sbhatewara@vmware.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).