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 | |
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')
-rw-r--r-- | drivers/xen/events/events_2l.c | 15 | ||||
-rw-r--r-- | drivers/xen/events/events_base.c | 25 | ||||
-rw-r--r-- | drivers/xen/events/events_fifo.c | 8 |
3 files changed, 11 insertions, 37 deletions
diff --git a/drivers/xen/events/events_2l.c b/drivers/xen/events/events_2l.c index d7ff91757307..5db43fc100a4 100644 --- a/drivers/xen/events/events_2l.c +++ b/drivers/xen/events/events_2l.c | |||
@@ -166,7 +166,6 @@ static void evtchn_2l_handle_events(unsigned cpu) | |||
166 | int start_word_idx, start_bit_idx; | 166 | int start_word_idx, start_bit_idx; |
167 | int word_idx, bit_idx; | 167 | int word_idx, bit_idx; |
168 | int i; | 168 | int i; |
169 | struct irq_desc *desc; | ||
170 | struct shared_info *s = HYPERVISOR_shared_info; | 169 | struct shared_info *s = HYPERVISOR_shared_info; |
171 | struct vcpu_info *vcpu_info = __this_cpu_read(xen_vcpu); | 170 | struct vcpu_info *vcpu_info = __this_cpu_read(xen_vcpu); |
172 | 171 | ||
@@ -176,11 +175,8 @@ static void evtchn_2l_handle_events(unsigned cpu) | |||
176 | unsigned int evtchn = evtchn_from_irq(irq); | 175 | unsigned int evtchn = evtchn_from_irq(irq); |
177 | word_idx = evtchn / BITS_PER_LONG; | 176 | word_idx = evtchn / BITS_PER_LONG; |
178 | bit_idx = evtchn % BITS_PER_LONG; | 177 | bit_idx = evtchn % BITS_PER_LONG; |
179 | if (active_evtchns(cpu, s, word_idx) & (1ULL << bit_idx)) { | 178 | if (active_evtchns(cpu, s, word_idx) & (1ULL << bit_idx)) |
180 | desc = irq_to_desc(irq); | 179 | generic_handle_irq(irq); |
181 | if (desc) | ||
182 | generic_handle_irq_desc(irq, desc); | ||
183 | } | ||
184 | } | 180 | } |
185 | 181 | ||
186 | /* | 182 | /* |
@@ -245,11 +241,8 @@ static void evtchn_2l_handle_events(unsigned cpu) | |||
245 | port = (word_idx * BITS_PER_EVTCHN_WORD) + bit_idx; | 241 | port = (word_idx * BITS_PER_EVTCHN_WORD) + bit_idx; |
246 | irq = get_evtchn_to_irq(port); | 242 | irq = get_evtchn_to_irq(port); |
247 | 243 | ||
248 | if (irq != -1) { | 244 | if (irq != -1) |
249 | desc = irq_to_desc(irq); | 245 | generic_handle_irq(irq); |
250 | if (desc) | ||
251 | generic_handle_irq_desc(irq, desc); | ||
252 | } | ||
253 | 246 | ||
254 | bit_idx = (bit_idx + 1) % BITS_PER_EVTCHN_WORD; | 247 | bit_idx = (bit_idx + 1) % BITS_PER_EVTCHN_WORD; |
255 | 248 | ||
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 | } |
diff --git a/drivers/xen/events/events_fifo.c b/drivers/xen/events/events_fifo.c index 1de2a191b395..96109a9972b6 100644 --- a/drivers/xen/events/events_fifo.c +++ b/drivers/xen/events/events_fifo.c | |||
@@ -235,14 +235,10 @@ static uint32_t clear_linked(volatile event_word_t *word) | |||
235 | static void handle_irq_for_port(unsigned port) | 235 | static void handle_irq_for_port(unsigned port) |
236 | { | 236 | { |
237 | int irq; | 237 | int irq; |
238 | struct irq_desc *desc; | ||
239 | 238 | ||
240 | irq = get_evtchn_to_irq(port); | 239 | irq = get_evtchn_to_irq(port); |
241 | if (irq != -1) { | 240 | if (irq != -1) |
242 | desc = irq_to_desc(irq); | 241 | generic_handle_irq(irq); |
243 | if (desc) | ||
244 | generic_handle_irq_desc(irq, desc); | ||
245 | } | ||
246 | } | 242 | } |
247 | 243 | ||
248 | static void consume_one_event(unsigned cpu, | 244 | static void consume_one_event(unsigned cpu, |