]> Pileus Git - ~andy/linux/commitdiff
Drivers: hv: Handle vmbus interrupts concurrently on all cpus
authorK. Y. Srinivasan <kys@microsoft.com>
Sat, 1 Dec 2012 14:46:54 +0000 (06:46 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 17 Jan 2013 19:39:15 +0000 (11:39 -0800)
Vmbus interrupts are unique in that while the interrupt is delivered on a
given vector, these can be handled concurrently on different CPUs. Handle the
vmbus interrupts concurrently on all the CPUs.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hv/hv.c
drivers/hv/vmbus_drv.c

index 363532add4c754ee76826d69a2c8a58899057852..03e6a1eb114548059a806e74418029c59505a365 100644 (file)
@@ -335,7 +335,7 @@ void hv_synic_init(void *irqarg)
        shared_sint.as_uint64 = 0;
        shared_sint.vector = irq_vector; /* HV_SHARED_SINT_IDT_VECTOR + 0x20; */
        shared_sint.masked = false;
-       shared_sint.auto_eoi = false;
+       shared_sint.auto_eoi = true;
 
        wrmsrl(HV_X64_MSR_SINT0 + VMBUS_MESSAGE_SINT, shared_sint.as_uint64);
 
index 6e4f85720f263dc207fdff0c6ac0d58f27437188..e066d418be97b6df5c68866c1b215ee91379ebc2 100644 (file)
@@ -33,6 +33,7 @@
 #include <acpi/acpi_bus.h>
 #include <linux/completion.h>
 #include <linux/hyperv.h>
+#include <linux/kernel_stat.h>
 #include <asm/hyperv.h>
 #include <asm/hypervisor.h>
 #include "hyperv_vmbus.h"
@@ -500,6 +501,19 @@ static irqreturn_t vmbus_isr(int irq, void *dev_id)
                return IRQ_NONE;
 }
 
+/*
+ * vmbus interrupt flow handler:
+ * vmbus interrupts can concurrently occur on multiple CPUs and
+ * can be handled concurrently.
+ */
+
+void vmbus_flow_handler(unsigned int irq, struct irq_desc *desc)
+{
+       kstat_incr_irqs_this_cpu(irq, desc);
+
+       desc->action->handler(irq, desc->action->dev_id);
+}
+
 /*
  * vmbus_bus_init -Main vmbus driver initialization routine.
  *
@@ -535,6 +549,13 @@ static int vmbus_bus_init(int irq)
                goto err_unregister;
        }
 
+       /*
+        * Vmbus interrupts can be handled concurrently on
+        * different CPUs. Establish an appropriate interrupt flow
+        * handler that can support this model.
+        */
+       irq_set_handler(irq, vmbus_flow_handler);
+
        vector = IRQ0_VECTOR + irq;
 
        /*