Skip to content

Commit 5e3c420

Browse files
shemmingergregkh
authored andcommitted
uio_hv_generic: set callbacks on open
This fixes the problem where uio application was unable to use multple queues on restart. The root cause is that the callbacks are cleared on disconnect. Change to setting up callbacks everytime in open. Fixes: cdfa835 ("uio_hv_generic: defer opening vmbus until first use") Reported-by: Mohammed Gamal <mgamal@redhat.com> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 40e020c commit 5e3c420

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

drivers/uio/uio_hv_generic.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -204,9 +204,11 @@ hv_uio_open(struct uio_info *info, struct inode *inode)
204204
if (atomic_inc_return(&pdata->refcnt) != 1)
205205
return 0;
206206

207+
vmbus_set_chn_rescind_callback(dev->channel, hv_uio_rescind);
208+
vmbus_set_sc_create_callback(dev->channel, hv_uio_new_channel);
209+
207210
ret = vmbus_connect_ring(dev->channel,
208211
hv_uio_channel_cb, dev->channel);
209-
210212
if (ret == 0)
211213
dev->channel->inbound.ring_buffer->interrupt_mask = 1;
212214
else
@@ -334,9 +336,6 @@ hv_uio_probe(struct hv_device *dev,
334336
goto fail_close;
335337
}
336338

337-
vmbus_set_chn_rescind_callback(channel, hv_uio_rescind);
338-
vmbus_set_sc_create_callback(channel, hv_uio_new_channel);
339-
340339
ret = sysfs_create_bin_file(&channel->kobj, &ring_buffer_bin_attr);
341340
if (ret)
342341
dev_notice(&dev->device,

0 commit comments

Comments
 (0)