From d6443127d7f44199849148afd476a1dbc955214d Mon Sep 17 00:00:00 2001 From: "K. Y. Srinivasan" Date: Sat, 27 Aug 2011 11:31:15 -0700 Subject: [PATCH] --- yaml --- r: 268046 b: refs/heads/master c: 124f506dc1bbfc79c32dd17566f09ef51f7cf863 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/staging/hv/netvsc.c | 24 ++---------------------- 2 files changed, 3 insertions(+), 23 deletions(-) diff --git a/[refs] b/[refs] index f3d921417203..0d33e58c49f2 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 3852409b88e8ec2a8abb28db5be25a7503297208 +refs/heads/master: 124f506dc1bbfc79c32dd17566f09ef51f7cf863 diff --git a/trunk/drivers/staging/hv/netvsc.c b/trunk/drivers/staging/hv/netvsc.c index e46161d05e6e..388f08380d47 100644 --- a/trunk/drivers/staging/hv/netvsc.c +++ b/trunk/drivers/staging/hv/netvsc.c @@ -88,23 +88,6 @@ static void put_net_device(struct hv_device *device) atomic_dec(&net_device->refcnt); } -static struct netvsc_device *release_inbound_net_device( - struct hv_device *device) -{ - struct netvsc_device *net_device; - - net_device = device->ext; - if (net_device == NULL) - return NULL; - - /* Busy wait until the ref drop to 1, then set it to 0 */ - while (atomic_cmpxchg(&net_device->refcnt, 1, 0) != 1) - udelay(100); - - device->ext = NULL; - return net_device; -} - static int netvsc_destroy_recv_buf(struct netvsc_device *net_device) { struct nvsp_message *revoke_packet; @@ -400,9 +383,8 @@ int netvsc_device_remove(struct hv_device *device) netvsc_disconnect_vsp(net_device); - /* Stop inbound traffic ie receives and sends completions */ - net_device = release_inbound_net_device(device); - + atomic_dec(&net_device->refcnt); + device->ext = NULL; /* * Wait until the ref cnt falls to 0. * We have already stopped any new references @@ -967,8 +949,6 @@ int netvsc_device_add(struct hv_device *device, void *additional_info) kfree(packet); } - release_inbound_net_device(device); - kfree(net_device); }