summaryrefslogtreecommitdiffstats
path: root/kernel/irq/manage.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-11-13 20:33:11 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2017-11-13 20:33:11 -0500
commit670310dfbae0eefe7318ff6a61e29e67a7a7bbce (patch)
treeeb3ce3aa3e6786a64fec93d410bb6f0b9a56be77 /kernel/irq/manage.c
parent43ff2f4db9d0f76452b77cfa645f02b471143b24 (diff)
parentffc661c99f621152d5fdcf53f9df0d48c326318b (diff)
Merge branch 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull irq core updates from Thomas Gleixner: "A rather large update for the interrupt core code and the irq chip drivers: - Add a new bitmap matrix allocator and supporting changes, which is used to replace the x86 vector allocator which comes with separate pull request. This allows to replace the convoluted nested loop allocation function in x86 with a facility which supports the recently added property of managed interrupts proper and allows to switch to a best effort vector reservation scheme, which addresses problems with vector exhaustion. - A large update to the ARM GIC-V3-ITS driver adding support for range selectors. - New interrupt controllers: - Meson and Meson8 GPIO - BCM7271 L2 - Socionext EXIU If you expected that this will stop at some point, I have to disappoint you. There are new ones posted already. Sigh! - STM32 interrupt controller support for new platforms. - A pile of fixes, cleanups and updates to the MIPS GIC driver - The usual small fixes, cleanups and updates all over the place. Most visible one is to move the irq chip drivers Kconfig switches into a separate Kconfig menu" * 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (70 commits) genirq: Fix type of shifting literal 1 in __setup_irq() irqdomain: Drop pointless NULL check in virq_debug_show_one genirq/proc: Return proper error code when irq_set_affinity() fails irq/work: Use llist_for_each_entry_safe irqchip: mips-gic: Print warning if inherited GIC base is used irqchip/mips-gic: Add pr_fmt and reword pr_* messages irqchip/stm32: Move the wakeup on interrupt mask irqchip/stm32: Fix initial values irqchip/stm32: Add stm32h7 support dt-bindings/interrupt-controllers: Add compatible string for stm32h7 irqchip/stm32: Add multi-bank management irqchip/stm32: Select GENERIC_IRQ_CHIP irqchip/exiu: Add support for Socionext Synquacer EXIU controller dt-bindings: Add description of Socionext EXIU interrupt controller irqchip/gic-v3-its: Fix VPE activate callback return value irqchip: mips-gic: Make IPI bitmaps static irqchip: mips-gic: Share register writes in gic_set_type() irqchip: mips-gic: Remove gic_vpes variable irqchip: mips-gic: Use num_possible_cpus() to reserve IPIs irqchip: mips-gic: Configure EIC when CPUs come online ...
Diffstat (limited to 'kernel/irq/manage.c')
-rw-r--r--kernel/irq/manage.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index 4bff6a10ae8e..2ff1c0c82fc9 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -398,7 +398,8 @@ int irq_select_affinity_usr(unsigned int irq)
398/** 398/**
399 * irq_set_vcpu_affinity - Set vcpu affinity for the interrupt 399 * irq_set_vcpu_affinity - Set vcpu affinity for the interrupt
400 * @irq: interrupt number to set affinity 400 * @irq: interrupt number to set affinity
401 * @vcpu_info: vCPU specific data 401 * @vcpu_info: vCPU specific data or pointer to a percpu array of vCPU
402 * specific data for percpu_devid interrupts
402 * 403 *
403 * This function uses the vCPU specific data to set the vCPU 404 * This function uses the vCPU specific data to set the vCPU
404 * affinity for an irq. The vCPU specific data is passed from 405 * affinity for an irq. The vCPU specific data is passed from
@@ -536,7 +537,7 @@ void __enable_irq(struct irq_desc *desc)
536 * time. If it was already started up, then irq_startup() 537 * time. If it was already started up, then irq_startup()
537 * will invoke irq_enable() under the hood. 538 * will invoke irq_enable() under the hood.
538 */ 539 */
539 irq_startup(desc, IRQ_RESEND, IRQ_START_COND); 540 irq_startup(desc, IRQ_RESEND, IRQ_START_FORCE);
540 break; 541 break;
541 } 542 }
542 default: 543 default:
@@ -1305,7 +1306,7 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new)
1305 * thread_mask assigned. See the loop above which or's 1306 * thread_mask assigned. See the loop above which or's
1306 * all existing action->thread_mask bits. 1307 * all existing action->thread_mask bits.
1307 */ 1308 */
1308 new->thread_mask = 1 << ffz(thread_mask); 1309 new->thread_mask = 1UL << ffz(thread_mask);
1309 1310
1310 } else if (new->handler == irq_default_primary_handler && 1311 } else if (new->handler == irq_default_primary_handler &&
1311 !(desc->irq_data.chip->flags & IRQCHIP_ONESHOT_SAFE)) { 1312 !(desc->irq_data.chip->flags & IRQCHIP_ONESHOT_SAFE)) {
@@ -1342,6 +1343,21 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new)
1342 goto out_unlock; 1343 goto out_unlock;
1343 } 1344 }
1344 1345
1346 /*
1347 * Activate the interrupt. That activation must happen
1348 * independently of IRQ_NOAUTOEN. request_irq() can fail
1349 * and the callers are supposed to handle
1350 * that. enable_irq() of an interrupt requested with
1351 * IRQ_NOAUTOEN is not supposed to fail. The activation
1352 * keeps it in shutdown mode, it merily associates
1353 * resources if necessary and if that's not possible it
1354 * fails. Interrupts which are in managed shutdown mode
1355 * will simply ignore that activation request.
1356 */
1357 ret = irq_activate(desc);
1358 if (ret)
1359 goto out_unlock;
1360
1345 desc->istate &= ~(IRQS_AUTODETECT | IRQS_SPURIOUS_DISABLED | \ 1361 desc->istate &= ~(IRQS_AUTODETECT | IRQS_SPURIOUS_DISABLED | \
1346 IRQS_ONESHOT | IRQS_WAITING); 1362 IRQS_ONESHOT | IRQS_WAITING);
1347 irqd_clear(&desc->irq_data, IRQD_IRQ_INPROGRESS); 1363 irqd_clear(&desc->irq_data, IRQD_IRQ_INPROGRESS);
@@ -1417,7 +1433,6 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new)
1417 wake_up_process(new->secondary->thread); 1433 wake_up_process(new->secondary->thread);
1418 1434
1419 register_irq_proc(irq, desc); 1435 register_irq_proc(irq, desc);
1420 irq_add_debugfs_entry(irq, desc);
1421 new->dir = NULL; 1436 new->dir = NULL;
1422 register_handler_proc(irq, new); 1437 register_handler_proc(irq, new);
1423 return 0; 1438 return 0;