summaryrefslogtreecommitdiffstats
path: root/drivers/xen/events.c
diff options
context:
space:
mode:
authorJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>2010-09-23 00:28:52 +0200
committerJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>2010-10-22 21:57:34 +0200
commita52521f149c42b35a28423ee30be9a7afa51dfbf (patch)
treeefbdbd6c297858df7a375b3deec110c432e0912a /drivers/xen/events.c
parentxen: ensure that all event channels start off bound to VCPU 0 (diff)
downloadlinux-a52521f149c42b35a28423ee30be9a7afa51dfbf.tar.xz
linux-a52521f149c42b35a28423ee30be9a7afa51dfbf.zip
xen: set up IRQ before binding virq to evtchn
Make sure the irq is set up before binding a virq event channel to it. Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Diffstat (limited to 'drivers/xen/events.c')
-rw-r--r--drivers/xen/events.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/xen/events.c b/drivers/xen/events.c
index b4e73011a80e..a3362479cfcf 100644
--- a/drivers/xen/events.c
+++ b/drivers/xen/events.c
@@ -436,6 +436,11 @@ static int bind_virq_to_irq(unsigned int virq, unsigned int cpu)
irq = per_cpu(virq_to_irq, cpu)[virq];
if (irq == -1) {
+ irq = find_unbound_irq();
+
+ set_irq_chip_and_handler_name(irq, &xen_percpu_chip,
+ handle_percpu_irq, "virq");
+
bind_virq.virq = virq;
bind_virq.vcpu = cpu;
if (HYPERVISOR_event_channel_op(EVTCHNOP_bind_virq,
@@ -443,11 +448,6 @@ static int bind_virq_to_irq(unsigned int virq, unsigned int cpu)
BUG();
evtchn = bind_virq.port;
- irq = find_unbound_irq();
-
- set_irq_chip_and_handler_name(irq, &xen_percpu_chip,
- handle_percpu_irq, "virq");
-
evtchn_to_irq[evtchn] = irq;
irq_info[irq] = mk_virq_info(evtchn, virq);