diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2019-03-05 15:21:47 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-03-05 15:21:47 -0500 |
| commit | 78f860135433a8bba406352fbdcea8e8980583bf (patch) | |
| tree | 0b7a9ba320e38b5d6eb0fb982bc2d9449aaf57f3 /kernel/irq/chip.c | |
| parent | 18483190e7a2a6761b67c6824a31adf5b2b7be51 (diff) | |
| parent | a324ca9cad4736252c33c1e28cffe1d87f262d03 (diff) | |
Merge branch 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull irq updates from Thomas Gleixner:
"The interrupt departement delivers this time:
- New infrastructure to manage NMIs on platforms which have a sane
NMI delivery, i.e. identifiable NMI vectors instead of a single
lump.
- Simplification of the interrupt affinity management so drivers
don't have to implement ugly loops around the PCI/MSI enablement.
- Speedup for interrupt statistics in /proc/stat
- Provide a function to retrieve the default irq domain
- A new interrupt controller for the Loongson LS1X platform
- Affinity support for the SiFive PLIC
- Better support for the iMX irqsteer driver
- NUMA aware memory allocations for GICv3
- The usual small fixes, improvements and cleanups all over the
place"
* 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (36 commits)
irqchip/imx-irqsteer: Add multi output interrupts support
irqchip/imx-irqsteer: Change to use reg_num instead of irq_group
dt-bindings: irq: imx-irqsteer: Add multi output interrupts support
dt-binding: irq: imx-irqsteer: Use irq number instead of group number
irqchip/brcmstb-l2: Use _irqsave locking variants in non-interrupt code
irqchip/gicv3-its: Use NUMA aware memory allocation for ITS tables
irqdomain: Allow the default irq domain to be retrieved
irqchip/sifive-plic: Implement irq_set_affinity() for SMP host
irqchip/sifive-plic: Differentiate between PLIC handler and context
irqchip/sifive-plic: Add warning in plic_init() if handler already present
irqchip/sifive-plic: Pre-compute context hart base and enable base
PCI/MSI: Remove obsolete sanity checks for multiple interrupt sets
genirq/affinity: Remove the leftovers of the original set support
nvme-pci: Simplify interrupt allocation
genirq/affinity: Add new callback for (re)calculating interrupt sets
genirq/affinity: Store interrupt sets size in struct irq_affinity
genirq/affinity: Code consolidation
irqchip/irq-sifive-plic: Check and continue in case of an invalid cpuid.
irqchip/i8259: Fix shutdown order by moving syscore_ops registration
dt-bindings: interrupt-controller: loongson ls1x intc
...
Diffstat (limited to 'kernel/irq/chip.c')
| -rw-r--r-- | kernel/irq/chip.c | 66 |
1 files changed, 64 insertions, 2 deletions
diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c index 34e969069488..99b7dd6982a4 100644 --- a/kernel/irq/chip.c +++ b/kernel/irq/chip.c | |||
| @@ -730,6 +730,37 @@ out: | |||
| 730 | EXPORT_SYMBOL_GPL(handle_fasteoi_irq); | 730 | EXPORT_SYMBOL_GPL(handle_fasteoi_irq); |
| 731 | 731 | ||
| 732 | /** | 732 | /** |
| 733 | * handle_fasteoi_nmi - irq handler for NMI interrupt lines | ||
| 734 | * @desc: the interrupt description structure for this irq | ||
| 735 | * | ||
| 736 | * A simple NMI-safe handler, considering the restrictions | ||
| 737 | * from request_nmi. | ||
| 738 | * | ||
| 739 | * Only a single callback will be issued to the chip: an ->eoi() | ||
| 740 | * call when the interrupt has been serviced. This enables support | ||
| 741 | * for modern forms of interrupt handlers, which handle the flow | ||
| 742 | * details in hardware, transparently. | ||
| 743 | */ | ||
| 744 | void handle_fasteoi_nmi(struct irq_desc *desc) | ||
| 745 | { | ||
| 746 | struct irq_chip *chip = irq_desc_get_chip(desc); | ||
| 747 | struct irqaction *action = desc->action; | ||
| 748 | unsigned int irq = irq_desc_get_irq(desc); | ||
| 749 | irqreturn_t res; | ||
| 750 | |||
| 751 | trace_irq_handler_entry(irq, action); | ||
| 752 | /* | ||
| 753 | * NMIs cannot be shared, there is only one action. | ||
| 754 | */ | ||
| 755 | res = action->handler(irq, action->dev_id); | ||
| 756 | trace_irq_handler_exit(irq, action, res); | ||
| 757 | |||
| 758 | if (chip->irq_eoi) | ||
| 759 | chip->irq_eoi(&desc->irq_data); | ||
| 760 | } | ||
| 761 | EXPORT_SYMBOL_GPL(handle_fasteoi_nmi); | ||
| 762 | |||
| 763 | /** | ||
| 733 | * handle_edge_irq - edge type IRQ handler | 764 | * handle_edge_irq - edge type IRQ handler |
| 734 | * @desc: the interrupt description structure for this irq | 765 | * @desc: the interrupt description structure for this irq |
| 735 | * | 766 | * |
| @@ -855,7 +886,11 @@ void handle_percpu_irq(struct irq_desc *desc) | |||
| 855 | { | 886 | { |
| 856 | struct irq_chip *chip = irq_desc_get_chip(desc); | 887 | struct irq_chip *chip = irq_desc_get_chip(desc); |
| 857 | 888 | ||
| 858 | kstat_incr_irqs_this_cpu(desc); | 889 | /* |
| 890 | * PER CPU interrupts are not serialized. Do not touch | ||
| 891 | * desc->tot_count. | ||
| 892 | */ | ||
| 893 | __kstat_incr_irqs_this_cpu(desc); | ||
| 859 | 894 | ||
| 860 | if (chip->irq_ack) | 895 | if (chip->irq_ack) |
| 861 | chip->irq_ack(&desc->irq_data); | 896 | chip->irq_ack(&desc->irq_data); |
| @@ -884,7 +919,11 @@ void handle_percpu_devid_irq(struct irq_desc *desc) | |||
| 884 | unsigned int irq = irq_desc_get_irq(desc); | 919 | unsigned int irq = irq_desc_get_irq(desc); |
| 885 | irqreturn_t res; | 920 | irqreturn_t res; |
| 886 | 921 | ||
| 887 | kstat_incr_irqs_this_cpu(desc); | 922 | /* |
| 923 | * PER CPU interrupts are not serialized. Do not touch | ||
| 924 | * desc->tot_count. | ||
| 925 | */ | ||
| 926 | __kstat_incr_irqs_this_cpu(desc); | ||
| 888 | 927 | ||
| 889 | if (chip->irq_ack) | 928 | if (chip->irq_ack) |
| 890 | chip->irq_ack(&desc->irq_data); | 929 | chip->irq_ack(&desc->irq_data); |
| @@ -908,6 +947,29 @@ void handle_percpu_devid_irq(struct irq_desc *desc) | |||
| 908 | chip->irq_eoi(&desc->irq_data); | 947 | chip->irq_eoi(&desc->irq_data); |
| 909 | } | 948 | } |
| 910 | 949 | ||
| 950 | /** | ||
| 951 | * handle_percpu_devid_fasteoi_nmi - Per CPU local NMI handler with per cpu | ||
| 952 | * dev ids | ||
| 953 | * @desc: the interrupt description structure for this irq | ||
| 954 | * | ||
| 955 | * Similar to handle_fasteoi_nmi, but handling the dev_id cookie | ||
| 956 | * as a percpu pointer. | ||
| 957 | */ | ||
| 958 | void handle_percpu_devid_fasteoi_nmi(struct irq_desc *desc) | ||
| 959 | { | ||
| 960 | struct irq_chip *chip = irq_desc_get_chip(desc); | ||
| 961 | struct irqaction *action = desc->action; | ||
| 962 | unsigned int irq = irq_desc_get_irq(desc); | ||
| 963 | irqreturn_t res; | ||
| 964 | |||
| 965 | trace_irq_handler_entry(irq, action); | ||
| 966 | res = action->handler(irq, raw_cpu_ptr(action->percpu_dev_id)); | ||
| 967 | trace_irq_handler_exit(irq, action, res); | ||
| 968 | |||
| 969 | if (chip->irq_eoi) | ||
| 970 | chip->irq_eoi(&desc->irq_data); | ||
| 971 | } | ||
| 972 | |||
| 911 | static void | 973 | static void |
| 912 | __irq_do_set_handler(struct irq_desc *desc, irq_flow_handler_t handle, | 974 | __irq_do_set_handler(struct irq_desc *desc, irq_flow_handler_t handle, |
| 913 | int is_chained, const char *name) | 975 | int is_chained, const char *name) |
