Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

uio_hv_generic: Enable interrupt for low speed VMBus devices

Hyper-V is adding some "specialty" synthetic devices. Instead of writing
new kernel-level VMBus drivers for these devices, the devices will be
presented to user space via this existing Hyper-V generic UIO driver, so
that a user space driver can handle the device. Since these new synthetic
devices are low speed devices, they don't support monitor bits and we must
use vmbus_setevent() to enable interrupts from the host.

Signed-off-by: Saurabh Sengar <ssengar@linux.microsoft.com>
Reviewed-by: Long Li <longli@microsoft.com>
Link: https://lore.kernel.org/r/1711788723-8593-4-git-send-email-ssengar@linux.microsoft.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Saurabh Sengar and committed by
Greg Kroah-Hartman
547fa4ff e566ed5b

+3 -6
+3 -6
drivers/uio/uio_hv_generic.c
··· 84 84 dev->channel->inbound.ring_buffer->interrupt_mask = !irq_state; 85 85 virt_mb(); 86 86 87 + if (!dev->channel->offermsg.monitor_allocated && irq_state) 88 + vmbus_setevent(dev->channel); 89 + 87 90 return 0; 88 91 } 89 92 ··· 242 239 void *ring_buffer; 243 240 int ret; 244 241 size_t ring_size = hv_dev_ring_size(channel); 245 - 246 - /* Communicating with host has to be via shared memory not hypercall */ 247 - if (!channel->offermsg.monitor_allocated) { 248 - dev_err(&dev->device, "vmbus channel requires hypercall\n"); 249 - return -ENOTSUPP; 250 - } 251 242 252 243 if (!ring_size) 253 244 ring_size = HV_RING_SIZE * PAGE_SIZE;