Skip to content

Commit de12e4f

Browse files
committed
Merge branch 'netvsc-fix-module-removal-hangs'
Stephen Hemminger says: ==================== netvsc: fix module removal hangs A couple of patches are necessary to make netvsc driver module removable again. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2 parents 115a731 + 79cd874 commit de12e4f

File tree

1 file changed

+4
-16
lines changed

1 file changed

+4
-16
lines changed

drivers/net/hyperv/netvsc.c

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -91,15 +91,6 @@ static void free_netvsc_device(struct netvsc_device *nvdev)
9191
}
9292

9393

94-
static inline bool netvsc_channel_idle(const struct netvsc_device *net_device,
95-
u16 q_idx)
96-
{
97-
const struct netvsc_channel *nvchan = &net_device->chan_table[q_idx];
98-
99-
return atomic_read(&net_device->num_outstanding_recvs) == 0 &&
100-
atomic_read(&nvchan->queue_sends) == 0;
101-
}
102-
10394
static struct netvsc_device *get_outbound_net_device(struct hv_device *device)
10495
{
10596
struct netvsc_device *net_device = hv_device_to_netvsc_device(device);
@@ -571,8 +562,8 @@ void netvsc_device_remove(struct hv_device *device)
571562
/* Now, we can close the channel safely */
572563
vmbus_close(device->channel);
573564

574-
for (i = 0; i < VRSS_CHANNEL_MAX; i++)
575-
napi_disable(&net_device->chan_table[0].napi);
565+
for (i = 0; i < net_device->num_chn; i++)
566+
napi_disable(&net_device->chan_table[i].napi);
576567

577568
/* Release all resources */
578569
free_netvsc_device(net_device);
@@ -1273,13 +1264,10 @@ void netvsc_channel_cb(void *context)
12731264
if (unlikely(!ndev))
12741265
return;
12751266

1276-
net_device = net_device_to_netvsc_device(ndev);
1277-
if (unlikely(net_device->destroy) &&
1278-
netvsc_channel_idle(net_device, q_idx))
1279-
return;
1280-
12811267
/* disable interupts from host */
12821268
hv_begin_read(&channel->inbound);
1269+
1270+
net_device = net_device_to_netvsc_device(ndev);
12831271
napi_schedule(&net_device->chan_table[q_idx].napi);
12841272
}
12851273

0 commit comments

Comments
 (0)