diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-04-01 14:22:57 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-04-01 14:22:57 -0400 |
commit | 683b6c6f82a60fabf47012581c2cfbf1b037ab95 (patch) | |
tree | 6a3fdf26b98aebf4b0b9eca8d242ba89e0565d8b /drivers/xen/events/events_base.c | |
parent | 1ead65812486cda65093683a99b8907a7242fa93 (diff) | |
parent | 1b422ecd27866985b9f35d0d2b5ae6e9122dd4c0 (diff) |
Merge branch 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull irq code updates from Thomas Gleixner:
"The irq department proudly presents:
- Another tree wide sweep of irq infrastructure abuse. Clear winner
of the trainwreck engineering contest was:
#include "../../../kernel/irq/settings.h"
- Tree wide update of irq_set_affinity() callbacks which miss a cpu
online check when picking a single cpu out of the affinity mask.
- Tree wide consolidation of interrupt statistics.
- Updates to the threaded interrupt infrastructure to allow explicit
wakeup of the interrupt thread and a variant of synchronize_irq()
which synchronizes only the hard interrupt handler. Both are
needed to replace the homebrewn thread handling in the mmc/sdhci
code.
- New irq chip callbacks to allow proper support for GPIO based irqs.
The GPIO based interrupts need to request/release GPIO resources
from request/free_irq.
- A few new ARM interrupt chips. No revolutionary new hardware, just
differently wreckaged variations of the scheme.
- Small improvments, cleanups and updates all over the place"
I was hoping that that trainwreck engineering contest was a April Fools'
joke. But no.
* 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (68 commits)
irqchip: sun7i/sun6i: Disable NMI before registering the handler
ARM: sun7i/sun6i: dts: Fix IRQ number for sun6i NMI controller
ARM: sun7i/sun6i: irqchip: Update the documentation
ARM: sun7i/sun6i: dts: Add NMI irqchip support
ARM: sun7i/sun6i: irqchip: Add irqchip driver for NMI controller
genirq: Export symbol no_action()
arm: omap: Fix typo in ams-delta-fiq.c
m68k: atari: Fix the last kernel_stat.h fallout
irqchip: sun4i: Simplify sun4i_irq_ack
irqchip: sun4i: Use handle_fasteoi_irq for all interrupts
genirq: procfs: Make smp_affinity values go+r
softirq: Add linux/irq.h to make it compile again
m68k: amiga: Add linux/irq.h to make it compile again
irqchip: sun4i: Don't ack IRQs > 0, fix acking of IRQ 0
irqchip: sun4i: Fix a comment about mask register initialization
irqchip: sun4i: Fix irq 0 not working
genirq: Add a new IRQCHIP_EOI_THREADED flag
genirq: Document IRQCHIP_ONESHOT_SAFE flag
ARM: sunxi: dt: Convert to the new irq controller compatibles
irqchip: sunxi: Change compatibles
...
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 | } |