fate#314663 hyper-v memory ballooning support
[opensuse:kernel-source.git] / patches.suse / suse-hv-fate314665-0024-Drivers-hv-Add-a-check-to-deal-with-spurious-interru.patch
1 Patch-mainline: submitted
2 From: <ohering@suse.de>
3 Date: Sat, 1 Dec 2012 06:46:55 -0800
4 Subject: [PATCH 24/28] Drivers: hv: Add a check to deal with spurious
5  interrupts
6
7 We establish the handler before we have fully initialized the VMBUS state.
8 Deal with spurious interrupts.
9
10 Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
11 Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
12 ---
13  drivers/hv/vmbus_drv.c | 10 ++++++----
14  1 file changed, 6 insertions(+), 4 deletions(-)
15
16 diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c
17 index e066d41..797142c 100644
18 --- a/drivers/hv/vmbus_drv.c
19 +++ b/drivers/hv/vmbus_drv.c
20 @@ -454,6 +454,12 @@ static irqreturn_t vmbus_isr(int irq, void *dev_id)
21         union hv_synic_event_flags *event;
22         bool handled = false;
23  
24 +       page_addr = hv_context.synic_event_page[cpu];
25 +       if (page_addr == NULL)
26 +               return IRQ_NONE;
27 +
28 +       event = (union hv_synic_event_flags *)page_addr +
29 +                                        VMBUS_MESSAGE_SINT;
30         /*
31          * Check for events before checking for messages. This is the order
32          * in which events and messages are checked in Windows guests on
33 @@ -463,10 +469,6 @@ static irqreturn_t vmbus_isr(int irq, void *dev_id)
34         if ((vmbus_proto_version == VERSION_WS2008) ||
35                 (vmbus_proto_version == VERSION_WIN7)) {
36  
37 -               page_addr = hv_context.synic_event_page[cpu];
38 -               event = (union hv_synic_event_flags *)page_addr +
39 -                                        VMBUS_MESSAGE_SINT;
40 -
41                 /* Since we are a child, we only need to check bit 0 */
42                 if (sync_test_and_clear_bit(0,
43                         (unsigned long *) &event->flags32[0])) {
44 -- 
45 1.8.0.1
46