diff options
Diffstat (limited to 'drivers/xen/events/events_base.c')
-rw-r--r-- | drivers/xen/events/events_base.c | 25 |
1 files changed, 5 insertions, 20 deletions
diff --git a/drivers/xen/events/events_base.c b/drivers/xen/events/events_base.c index f4a9e3311297..c3458f58de90 100644 --- a/drivers/xen/events/events_base.c +++ b/drivers/xen/events/events_base.c | |||
@@ -336,9 +336,8 @@ static void bind_evtchn_to_cpu(unsigned int chn, unsigned int cpu) | |||
336 | 336 | ||
337 | BUG_ON(irq == -1); | 337 | BUG_ON(irq == -1); |
338 | #ifdef CONFIG_SMP | 338 | #ifdef CONFIG_SMP |
339 | cpumask_copy(irq_to_desc(irq)->irq_data.affinity, cpumask_of(cpu)); | 339 | cpumask_copy(irq_get_irq_data(irq)->affinity, cpumask_of(cpu)); |
340 | #endif | 340 | #endif |
341 | |||
342 | xen_evtchn_port_bind_to_cpu(info, cpu); | 341 | xen_evtchn_port_bind_to_cpu(info, cpu); |
343 | 342 | ||
344 | info->cpu = cpu; | 343 | info->cpu = cpu; |
@@ -373,10 +372,8 @@ static void xen_irq_init(unsigned irq) | |||
373 | { | 372 | { |
374 | struct irq_info *info; | 373 | struct irq_info *info; |
375 | #ifdef CONFIG_SMP | 374 | #ifdef CONFIG_SMP |
376 | struct irq_desc *desc = irq_to_desc(irq); | ||
377 | |||
378 | /* By default all event channels notify CPU#0. */ | 375 | /* By default all event channels notify CPU#0. */ |
379 | cpumask_copy(desc->irq_data.affinity, cpumask_of(0)); | 376 | cpumask_copy(irq_get_irq_data(irq)->affinity, cpumask_of(0)); |
380 | #endif | 377 | #endif |
381 | 378 | ||
382 | info = kzalloc(sizeof(*info), GFP_KERNEL); | 379 | info = kzalloc(sizeof(*info), GFP_KERNEL); |
@@ -490,13 +487,6 @@ static void pirq_query_unmask(int irq) | |||
490 | info->u.pirq.flags |= PIRQ_NEEDS_EOI; | 487 | info->u.pirq.flags |= PIRQ_NEEDS_EOI; |
491 | } | 488 | } |
492 | 489 | ||
493 | static bool probing_irq(int irq) | ||
494 | { | ||
495 | struct irq_desc *desc = irq_to_desc(irq); | ||
496 | |||
497 | return desc && desc->action == NULL; | ||
498 | } | ||
499 | |||
500 | static void eoi_pirq(struct irq_data *data) | 490 | static void eoi_pirq(struct irq_data *data) |
501 | { | 491 | { |
502 | int evtchn = evtchn_from_irq(data->irq); | 492 | int evtchn = evtchn_from_irq(data->irq); |
@@ -538,8 +528,7 @@ static unsigned int __startup_pirq(unsigned int irq) | |||
538 | BIND_PIRQ__WILL_SHARE : 0; | 528 | BIND_PIRQ__WILL_SHARE : 0; |
539 | rc = HYPERVISOR_event_channel_op(EVTCHNOP_bind_pirq, &bind_pirq); | 529 | rc = HYPERVISOR_event_channel_op(EVTCHNOP_bind_pirq, &bind_pirq); |
540 | if (rc != 0) { | 530 | if (rc != 0) { |
541 | if (!probing_irq(irq)) | 531 | pr_warn("Failed to obtain physical IRQ %d\n", irq); |
542 | pr_info("Failed to obtain physical IRQ %d\n", irq); | ||
543 | return 0; | 532 | return 0; |
544 | } | 533 | } |
545 | evtchn = bind_pirq.port; | 534 | evtchn = bind_pirq.port; |
@@ -772,17 +761,12 @@ error_irq: | |||
772 | 761 | ||
773 | int xen_destroy_irq(int irq) | 762 | int xen_destroy_irq(int irq) |
774 | { | 763 | { |
775 | struct irq_desc *desc; | ||
776 | struct physdev_unmap_pirq unmap_irq; | 764 | struct physdev_unmap_pirq unmap_irq; |
777 | struct irq_info *info = info_for_irq(irq); | 765 | struct irq_info *info = info_for_irq(irq); |
778 | int rc = -ENOENT; | 766 | int rc = -ENOENT; |
779 | 767 | ||
780 | mutex_lock(&irq_mapping_update_lock); | 768 | mutex_lock(&irq_mapping_update_lock); |
781 | 769 | ||
782 | desc = irq_to_desc(irq); | ||
783 | if (!desc) | ||
784 | goto out; | ||
785 | |||
786 | if (xen_initial_domain()) { | 770 | if (xen_initial_domain()) { |
787 | unmap_irq.pirq = info->u.pirq.pirq; | 771 | unmap_irq.pirq = info->u.pirq.pirq; |
788 | unmap_irq.domid = info->u.pirq.domid; | 772 | unmap_irq.domid = info->u.pirq.domid; |
@@ -1251,6 +1235,7 @@ void xen_evtchn_do_upcall(struct pt_regs *regs) | |||
1251 | #ifdef CONFIG_X86 | 1235 | #ifdef CONFIG_X86 |
1252 | exit_idle(); | 1236 | exit_idle(); |
1253 | #endif | 1237 | #endif |
1238 | inc_irq_stat(irq_hv_callback_count); | ||
1254 | 1239 | ||
1255 | __xen_evtchn_do_upcall(); | 1240 | __xen_evtchn_do_upcall(); |
1256 | 1241 | ||
@@ -1339,7 +1324,7 @@ static int rebind_irq_to_cpu(unsigned irq, unsigned tcpu) | |||
1339 | static int set_affinity_irq(struct irq_data *data, const struct cpumask *dest, | 1324 | static int set_affinity_irq(struct irq_data *data, const struct cpumask *dest, |
1340 | bool force) | 1325 | bool force) |
1341 | { | 1326 | { |
1342 | unsigned tcpu = cpumask_first(dest); | 1327 | unsigned tcpu = cpumask_first_and(dest, cpu_online_mask); |
1343 | 1328 | ||
1344 | return rebind_irq_to_cpu(data->irq, tcpu); | 1329 | return rebind_irq_to_cpu(data->irq, tcpu); |
1345 | } | 1330 | } |