uio_hv_generic: Set event for all channels on the device
commitd062463edfupstream. Hyper-V may offer a non latency sensitive device with subchannels without monitor bit enabled. The decision is entirely on the Hyper-V host not configurable within guest. When a device has subchannels, also signal events for the subchannel if its monitor bit is disabled. This patch also removes the memory barrier when monitor bit is enabled as it is not necessary. The memory barrier is only needed between setting up interrupt mask and calling vmbus_set_event() when monitor bit is disabled. Signed-off-by: Long Li <longli@microsoft.com> Reviewed-by: Michael Kelley <mhklinux@outlook.com> Reviewed-by: Saurabh Sengar <ssengar@linux.microsoft.com> Link: https://lore.kernel.org/r/1741644721-20389-1-git-send-email-longli@linuxonhyperv.com Fixes:b15b7d2a1b("uio_hv_generic: Let userspace take care of interrupt mask") Closes: https://bugs.debian.org/1120602 Signed-off-by: Naman Jain <namjain@linux.microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
af6b10a13f
commit
3d2e0711ec
@@ -80,9 +80,15 @@ hv_uio_irqcontrol(struct uio_info *info, s32 irq_state)
|
||||
{
|
||||
struct hv_uio_private_data *pdata = info->priv;
|
||||
struct hv_device *dev = pdata->device;
|
||||
struct vmbus_channel *primary, *sc;
|
||||
|
||||
dev->channel->inbound.ring_buffer->interrupt_mask = !irq_state;
|
||||
virt_mb();
|
||||
primary = dev->channel;
|
||||
primary->inbound.ring_buffer->interrupt_mask = !irq_state;
|
||||
|
||||
mutex_lock(&vmbus_connection.channel_mutex);
|
||||
list_for_each_entry(sc, &primary->sc_list, sc_list)
|
||||
sc->inbound.ring_buffer->interrupt_mask = !irq_state;
|
||||
mutex_unlock(&vmbus_connection.channel_mutex);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -93,11 +99,18 @@ hv_uio_irqcontrol(struct uio_info *info, s32 irq_state)
|
||||
static void hv_uio_channel_cb(void *context)
|
||||
{
|
||||
struct vmbus_channel *chan = context;
|
||||
struct hv_device *hv_dev = chan->device_obj;
|
||||
struct hv_uio_private_data *pdata = hv_get_drvdata(hv_dev);
|
||||
struct hv_device *hv_dev;
|
||||
struct hv_uio_private_data *pdata;
|
||||
|
||||
virt_mb();
|
||||
|
||||
/*
|
||||
* The callback may come from a subchannel, in which case look
|
||||
* for the hv device in the primary channel
|
||||
*/
|
||||
hv_dev = chan->primary_channel ?
|
||||
chan->primary_channel->device_obj : chan->device_obj;
|
||||
pdata = hv_get_drvdata(hv_dev);
|
||||
uio_event_notify(&pdata->info);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user