diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-07-02 19:14:35 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-07-02 19:14:35 -0400 |
| commit | a4883ef6af5e513a1e8c2ab9aab721604aa3a4f5 (patch) | |
| tree | e893f951d150c1d760f46040483193a3ac713a4e /kernel | |
| parent | ab3d681e9d41816f90836ea8fe235168d973207f (diff) | |
| parent | d2e08473f2488d53a71c2f53455f934ec6c44c53 (diff) | |
Merge branch 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull core irq changes from Ingo Molnar:
"The main changes:
- generic-irqchip driver additions, cleanups and fixes
- 3 new irqchip drivers: ARMv7-M NVIC, TB10x and Marvell Orion SoCs
- irq_get_trigger_type() simplification and cross-arch cleanup
- various cleanups, simplifications
- documentation updates"
* 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (26 commits)
softirq: Use _RET_IP_
genirq: Add the generic chip to the genirq docbook
genirq: generic-chip: Export some irq_gc_ functions
genirq: Fix can_request_irq() for IRQs without an action
irqchip: exynos-combiner: Staticize combiner_init
irqchip: Add support for ARMv7-M NVIC
irqchip: Add TB10x interrupt controller driver
irqdomain: Use irq_get_trigger_type() to get IRQ flags
MIPS: octeon: Use irq_get_trigger_type() to get IRQ flags
arm: orion: Use irq_get_trigger_type() to get IRQ flags
mfd: stmpe: use irq_get_trigger_type() to get IRQ flags
mfd: twl4030-irq: Use irq_get_trigger_type() to get IRQ flags
gpio: mvebu: Use irq_get_trigger_type() to get IRQ flags
genirq: Add irq_get_trigger_type() to get IRQ flags
genirq: Irqchip: document gcflags arg of irq_alloc_domain_generic_chips
genirq: Set irq thread to RT priority on creation
irqchip: Add support for Marvell Orion SoCs
genirq: Add kerneldoc for irq_disable.
genirq: irqchip: Add mask to block out invalid irqs
genirq: Generic chip: Add linear irq domain support
...
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/irq/chip.c | 13 | ||||
| -rw-r--r-- | kernel/irq/generic-chip.c | 314 | ||||
| -rw-r--r-- | kernel/irq/irqdomain.c | 8 | ||||
| -rw-r--r-- | kernel/irq/manage.c | 17 | ||||
| -rw-r--r-- | kernel/softirq.c | 10 |
5 files changed, 294 insertions, 68 deletions
diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c index cbd97ce0b000..a3bb14fbe5c6 100644 --- a/kernel/irq/chip.c +++ b/kernel/irq/chip.c | |||
| @@ -213,6 +213,19 @@ void irq_enable(struct irq_desc *desc) | |||
| 213 | irq_state_clr_masked(desc); | 213 | irq_state_clr_masked(desc); |
| 214 | } | 214 | } |
| 215 | 215 | ||
| 216 | /** | ||
| 217 | * irq_disable - Mark interupt disabled | ||
| 218 | * @desc: irq descriptor which should be disabled | ||
| 219 | * | ||
| 220 | * If the chip does not implement the irq_disable callback, we | ||
| 221 | * use a lazy disable approach. That means we mark the interrupt | ||
| 222 | * disabled, but leave the hardware unmasked. That's an | ||
| 223 | * optimization because we avoid the hardware access for the | ||
| 224 | * common case where no interrupt happens after we marked it | ||
| 225 | * disabled. If an interrupt happens, then the interrupt flow | ||
| 226 | * handler masks the line at the hardware level and marks it | ||
| 227 | * pending. | ||
| 228 | */ | ||
| 216 | void irq_disable(struct irq_desc *desc) | 229 | void irq_disable(struct irq_desc *desc) |
| 217 | { | 230 | { |
| 218 | irq_state_set_disabled(desc); | 231 | irq_state_set_disabled(desc); |
diff --git a/kernel/irq/generic-chip.c b/kernel/irq/generic-chip.c index c89295a8f668..1c39eccc1eaf 100644 --- a/kernel/irq/generic-chip.c +++ b/kernel/irq/generic-chip.c | |||
| @@ -7,6 +7,7 @@ | |||
| 7 | #include <linux/irq.h> | 7 | #include <linux/irq.h> |
| 8 | #include <linux/slab.h> | 8 | #include <linux/slab.h> |
| 9 | #include <linux/export.h> | 9 | #include <linux/export.h> |
| 10 | #include <linux/irqdomain.h> | ||
| 10 | #include <linux/interrupt.h> | 11 | #include <linux/interrupt.h> |
| 11 | #include <linux/kernel_stat.h> | 12 | #include <linux/kernel_stat.h> |
| 12 | #include <linux/syscore_ops.h> | 13 | #include <linux/syscore_ops.h> |
| @@ -16,11 +17,6 @@ | |||
| 16 | static LIST_HEAD(gc_list); | 17 | static LIST_HEAD(gc_list); |
| 17 | static DEFINE_RAW_SPINLOCK(gc_lock); | 18 | static DEFINE_RAW_SPINLOCK(gc_lock); |
| 18 | 19 | ||
| 19 | static inline struct irq_chip_regs *cur_regs(struct irq_data *d) | ||
| 20 | { | ||
| 21 | return &container_of(d->chip, struct irq_chip_type, chip)->regs; | ||
| 22 | } | ||
| 23 | |||
| 24 | /** | 20 | /** |
| 25 | * irq_gc_noop - NOOP function | 21 | * irq_gc_noop - NOOP function |
| 26 | * @d: irq_data | 22 | * @d: irq_data |
| @@ -39,16 +35,17 @@ void irq_gc_noop(struct irq_data *d) | |||
| 39 | void irq_gc_mask_disable_reg(struct irq_data *d) | 35 | void irq_gc_mask_disable_reg(struct irq_data *d) |
| 40 | { | 36 | { |
| 41 | struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d); | 37 | struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d); |
| 42 | u32 mask = 1 << (d->irq - gc->irq_base); | 38 | struct irq_chip_type *ct = irq_data_get_chip_type(d); |
| 39 | u32 mask = d->mask; | ||
| 43 | 40 | ||
| 44 | irq_gc_lock(gc); | 41 | irq_gc_lock(gc); |
| 45 | irq_reg_writel(mask, gc->reg_base + cur_regs(d)->disable); | 42 | irq_reg_writel(mask, gc->reg_base + ct->regs.disable); |
| 46 | gc->mask_cache &= ~mask; | 43 | *ct->mask_cache &= ~mask; |
| 47 | irq_gc_unlock(gc); | 44 | irq_gc_unlock(gc); |
| 48 | } | 45 | } |
| 49 | 46 | ||
| 50 | /** | 47 | /** |
| 51 | * irq_gc_mask_set_mask_bit - Mask chip via setting bit in mask register | 48 | * irq_gc_mask_set_bit - Mask chip via setting bit in mask register |
| 52 | * @d: irq_data | 49 | * @d: irq_data |
| 53 | * | 50 | * |
| 54 | * Chip has a single mask register. Values of this register are cached | 51 | * Chip has a single mask register. Values of this register are cached |
| @@ -57,16 +54,18 @@ void irq_gc_mask_disable_reg(struct irq_data *d) | |||
| 57 | void irq_gc_mask_set_bit(struct irq_data *d) | 54 | void irq_gc_mask_set_bit(struct irq_data *d) |
| 58 | { | 55 | { |
| 59 | struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d); | 56 | struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d); |
| 60 | u32 mask = 1 << (d->irq - gc->irq_base); | 57 | struct irq_chip_type *ct = irq_data_get_chip_type(d); |
| 58 | u32 mask = d->mask; | ||
| 61 | 59 | ||
| 62 | irq_gc_lock(gc); | 60 | irq_gc_lock(gc); |
| 63 | gc->mask_cache |= mask; | 61 | *ct->mask_cache |= mask; |
| 64 | irq_reg_writel(gc->mask_cache, gc->reg_base + cur_regs(d)->mask); | 62 | irq_reg_writel(*ct->mask_cache, gc->reg_base + ct->regs.mask); |
| 65 | irq_gc_unlock(gc); | 63 | irq_gc_unlock(gc); |
| 66 | } | 64 | } |
| 65 | EXPORT_SYMBOL_GPL(irq_gc_mask_set_bit); | ||
| 67 | 66 | ||
| 68 | /** | 67 | /** |
| 69 | * irq_gc_mask_set_mask_bit - Mask chip via clearing bit in mask register | 68 | * irq_gc_mask_clr_bit - Mask chip via clearing bit in mask register |
| 70 | * @d: irq_data | 69 | * @d: irq_data |
| 71 | * | 70 | * |
| 72 | * Chip has a single mask register. Values of this register are cached | 71 | * Chip has a single mask register. Values of this register are cached |
| @@ -75,13 +74,15 @@ void irq_gc_mask_set_bit(struct irq_data *d) | |||
| 75 | void irq_gc_mask_clr_bit(struct irq_data *d) | 74 | void irq_gc_mask_clr_bit(struct irq_data *d) |
| 76 | { | 75 | { |
| 77 | struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d); | 76 | struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d); |
| 78 | u32 mask = 1 << (d->irq - gc->irq_base); | 77 | struct irq_chip_type *ct = irq_data_get_chip_type(d); |
| 78 | u32 mask = d->mask; | ||
| 79 | 79 | ||
| 80 | irq_gc_lock(gc); | 80 | irq_gc_lock(gc); |
| 81 | gc->mask_cache &= ~mask; | 81 | *ct->mask_cache &= ~mask; |
| 82 | irq_reg_writel(gc->mask_cache, gc->reg_base + cur_regs(d)->mask); | 82 | irq_reg_writel(*ct->mask_cache, gc->reg_base + ct->regs.mask); |
| 83 | irq_gc_unlock(gc); | 83 | irq_gc_unlock(gc); |
| 84 | } | 84 | } |
| 85 | EXPORT_SYMBOL_GPL(irq_gc_mask_clr_bit); | ||
| 85 | 86 | ||
| 86 | /** | 87 | /** |
| 87 | * irq_gc_unmask_enable_reg - Unmask chip via enable register | 88 | * irq_gc_unmask_enable_reg - Unmask chip via enable register |
| @@ -93,11 +94,12 @@ void irq_gc_mask_clr_bit(struct irq_data *d) | |||
| 93 | void irq_gc_unmask_enable_reg(struct irq_data *d) | 94 | void irq_gc_unmask_enable_reg(struct irq_data *d) |
| 94 | { | 95 | { |
| 95 | struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d); | 96 | struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d); |
| 96 | u32 mask = 1 << (d->irq - gc->irq_base); | 97 | struct irq_chip_type *ct = irq_data_get_chip_type(d); |
| 98 | u32 mask = d->mask; | ||
| 97 | 99 | ||
| 98 | irq_gc_lock(gc); | 100 | irq_gc_lock(gc); |
| 99 | irq_reg_writel(mask, gc->reg_base + cur_regs(d)->enable); | 101 | irq_reg_writel(mask, gc->reg_base + ct->regs.enable); |
| 100 | gc->mask_cache |= mask; | 102 | *ct->mask_cache |= mask; |
| 101 | irq_gc_unlock(gc); | 103 | irq_gc_unlock(gc); |
| 102 | } | 104 | } |
| 103 | 105 | ||
| @@ -108,12 +110,14 @@ void irq_gc_unmask_enable_reg(struct irq_data *d) | |||
| 108 | void irq_gc_ack_set_bit(struct irq_data *d) | 110 | void irq_gc_ack_set_bit(struct irq_data *d) |
| 109 | { | 111 | { |
| 110 | struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d); | 112 | struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d); |
| 111 | u32 mask = 1 << (d->irq - gc->irq_base); | 113 | struct irq_chip_type *ct = irq_data_get_chip_type(d); |
| 114 | u32 mask = d->mask; | ||
| 112 | 115 | ||
| 113 | irq_gc_lock(gc); | 116 | irq_gc_lock(gc); |
| 114 | irq_reg_writel(mask, gc->reg_base + cur_regs(d)->ack); | 117 | irq_reg_writel(mask, gc->reg_base + ct->regs.ack); |
| 115 | irq_gc_unlock(gc); | 118 | irq_gc_unlock(gc); |
| 116 | } | 119 | } |
| 120 | EXPORT_SYMBOL_GPL(irq_gc_ack_set_bit); | ||
| 117 | 121 | ||
| 118 | /** | 122 | /** |
| 119 | * irq_gc_ack_clr_bit - Ack pending interrupt via clearing bit | 123 | * irq_gc_ack_clr_bit - Ack pending interrupt via clearing bit |
| @@ -122,10 +126,11 @@ void irq_gc_ack_set_bit(struct irq_data *d) | |||
| 122 | void irq_gc_ack_clr_bit(struct irq_data *d) | 126 | void irq_gc_ack_clr_bit(struct irq_data *d) |
| 123 | { | 127 | { |
| 124 | struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d); | 128 | struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d); |
| 125 | u32 mask = ~(1 << (d->irq - gc->irq_base)); | 129 | struct irq_chip_type *ct = irq_data_get_chip_type(d); |
| 130 | u32 mask = ~d->mask; | ||
| 126 | 131 | ||
| 127 | irq_gc_lock(gc); | 132 | irq_gc_lock(gc); |
| 128 | irq_reg_writel(mask, gc->reg_base + cur_regs(d)->ack); | 133 | irq_reg_writel(mask, gc->reg_base + ct->regs.ack); |
| 129 | irq_gc_unlock(gc); | 134 | irq_gc_unlock(gc); |
| 130 | } | 135 | } |
| 131 | 136 | ||
| @@ -136,11 +141,12 @@ void irq_gc_ack_clr_bit(struct irq_data *d) | |||
| 136 | void irq_gc_mask_disable_reg_and_ack(struct irq_data *d) | 141 | void irq_gc_mask_disable_reg_and_ack(struct irq_data *d) |
| 137 | { | 142 | { |
| 138 | struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d); | 143 | struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d); |
| 139 | u32 mask = 1 << (d->irq - gc->irq_base); | 144 | struct irq_chip_type *ct = irq_data_get_chip_type(d); |
| 145 | u32 mask = d->mask; | ||
| 140 | 146 | ||
| 141 | irq_gc_lock(gc); | ||
