History

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 ...

Linus Torvalds committed 7 years ago

Commit 78f86012 parents 1848319 a324ca930 files · +1177 −281Browse files

Showing the changes to include/linux (6 of 30 files). Show all

Unified · Split

6 files
  1. include/linux/interrupt.h +40 −11
  2. include/linux/irq.h +10 −0
  3. include/linux/irqdesc.h +7 −0
  4. include/linux/irqdomain.h +1 −0
  5. include/linux/kthread.h +1 −0
  6. include/linux/pci.h +2 −2
include/linux/interrupt.h+40−11
@@ -156,6 +156,10 @@ __request_percpu_irq(unsigned int irq, irq_handler_t handler, · 155 unmodified lines
156 unsigned long flags, const char *devname,156 unsigned long flags, const char *devname,
157 void __percpu *percpu_dev_id);157 void __percpu *percpu_dev_id);
158 158
159extern int __must_check
160request_nmi(unsigned int irq, irq_handler_t handler, unsigned long flags,
161 const char *name, void *dev);
162
159static inline int __must_check163static inline int __must_check
160request_percpu_irq(unsigned int irq, irq_handler_t handler,164request_percpu_irq(unsigned int irq, irq_handler_t handler,
161 const char *devname, void __percpu *percpu_dev_id)165 const char *devname, void __percpu *percpu_dev_id)
@@ -164,9 +168,16 @@ request_percpu_irq(unsigned int irq, irq_handler_t handler, · 2 unmodified lines
164 devname, percpu_dev_id);168 devname, percpu_dev_id);
165}169}
166 170
171extern int __must_check
172request_percpu_nmi(unsigned int irq, irq_handler_t handler,
173 const char *devname, void __percpu *dev);
174
167extern const void *free_irq(unsigned int, void *);175extern const void *free_irq(unsigned int, void *);
168extern void free_percpu_irq(unsigned int, void __percpu *);176extern void free_percpu_irq(unsigned int, void __percpu *);
169 177
178extern const void *free_nmi(unsigned int irq, void *dev_id);
179extern void free_percpu_nmi(unsigned int irq, void __percpu *percpu_dev_id);
180
170struct device;181struct device;
171 182
172extern int __must_check183extern int __must_check
@@ -217,6 +228,13 @@ extern void enable_percpu_irq(unsigned int irq, unsigned int type); · 44 unmodified lines
217extern bool irq_percpu_is_enabled(unsigned int irq);228extern bool irq_percpu_is_enabled(unsigned int irq);
218extern void irq_wake_thread(unsigned int irq, void *dev_id);229extern void irq_wake_thread(unsigned int irq, void *dev_id);
219 230
231extern void disable_nmi_nosync(unsigned int irq);
232extern void disable_percpu_nmi(unsigned int irq);
233extern void enable_nmi(unsigned int irq);
234extern void enable_percpu_nmi(unsigned int irq, unsigned int type);
235extern int prepare_percpu_nmi(unsigned int irq);
236extern void teardown_percpu_nmi(unsigned int irq);
237
220/* The following three functions are for the core kernel use only. */238/* The following three functions are for the core kernel use only. */
221extern void suspend_device_irqs(void);239extern void suspend_device_irqs(void);
222extern void resume_device_irqs(void);240extern void resume_device_irqs(void);
@@ -241,20 +259,29 @@ struct irq_affinity_notify { · 18 unmodified lines
241 void (*release)(struct kref *ref);259 void (*release)(struct kref *ref);
242};260};
243 261
262#define IRQ_AFFINITY_MAX_SETS 4
263
244/**264/**
245 * struct irq_affinity - Description for automatic irq affinity assignements265 * struct irq_affinity - Description for automatic irq affinity assignements
246 * @pre_vectors: Don't apply affinity to @pre_vectors at beginning of266 * @pre_vectors: Don't apply affinity to @pre_vectors at beginning of
247 * the MSI(-X) vector space267 * the MSI(-X) vector space
248 * @post_vectors: Don't apply affinity to @post_vectors at end of268 * @post_vectors: Don't apply affinity to @post_vectors at end of
249 * the MSI(-X) vector space269 * the MSI(-X) vector space
250 * @nr_sets: Length of passed in *sets array270 * @nr_sets: The number of interrupt sets for which affinity
251 * @sets: Number of affinitized sets271 * spreading is required
272 * @set_size: Array holding the size of each interrupt set
273 * @calc_sets: Callback for calculating the number and size
274 * of interrupt sets
275 * @priv: Private data for usage by @calc_sets, usually a
276 * pointer to driver/device specific data.
252 */277 */
253struct irq_affinity {278struct irq_affinity {
254 int pre_vectors;279 unsigned int pre_vectors;
255 int post_vectors;280 unsigned int post_vectors;
256 int nr_sets;281 unsigned int nr_sets;
257 int *sets;282 unsigned int set_size[IRQ_AFFINITY_MAX_SETS];
283 void (*calc_sets)(struct irq_affinity *, unsigned int nvecs);
284 void *priv;
258};285};
259 286
260/**287/**
@@ -314,9 +341,10 @@ extern int · 53 unmodified lines
314irq_set_affinity_notifier(unsigned int irq, struct irq_affinity_notify *notify);341irq_set_affinity_notifier(unsigned int irq, struct irq_affinity_notify *notify);
315 342
316struct irq_affinity_desc *343struct irq_affinity_desc *
317irq_create_affinity_masks(int nvec, const struct irq_affinity *affd);344irq_create_affinity_masks(unsigned int nvec, struct irq_affinity *affd);
318 345
319int irq_calc_affinity_vectors(int minvec, int maxvec, const struct irq_affinity *affd);346unsigned int irq_calc_affinity_vectors(unsigned int minvec, unsigned int maxvec,
347 const struct irq_affinity *affd);
320 348
321#else /* CONFIG_SMP */349#else /* CONFIG_SMP */
322 350
@@ -350,13 +378,14 @@ irq_set_affinity_notifier(unsigned int irq, struct irq_affinity_notify *notify) · 27 unmodified lines
350}378}
351 379
352static inline struct irq_affinity_desc *380static inline struct irq_affinity_desc *
353irq_create_affinity_masks(int nvec, const struct irq_affinity *affd)381irq_create_affinity_masks(unsigned int nvec, struct irq_affinity *affd)
354{382{
355 return NULL;383 return NULL;
356}384}
357 385
358static inline int386static inline unsigned int
359irq_calc_affinity_vectors(int minvec, int maxvec, const struct irq_affinity *affd)387irq_calc_affinity_vectors(unsigned int minvec, unsigned int maxvec,
388 const struct irq_affinity *affd)
360{389{
361 return maxvec;390 return maxvec;
362}391}
include/linux/irq.h+10−0
@@ -442,6 +442,8 @@ static inline irq_hw_number_t irqd_to_hwirq(struct irq_data *d) · 441 unmodified lines
442 * @irq_set_vcpu_affinity: optional to target a vCPU in a virtual machine442 * @irq_set_vcpu_affinity: optional to target a vCPU in a virtual machine
443 * @ipi_send_single: send a single IPI to destination cpus443 * @ipi_send_single: send a single IPI to destination cpus
444 * @ipi_send_mask: send an IPI to destination cpus in cpumask444 * @ipi_send_mask: send an IPI to destination cpus in cpumask
445 * @irq_nmi_setup: function called from core code before enabling an NMI
446 * @irq_nmi_teardown: function called from core code after disabling an NMI
445 * @flags: chip specific flags447 * @flags: chip specific flags
446 */448 */
447struct irq_chip {449struct irq_chip {
@@ -490,6 +492,9 @@ struct irq_chip { · 42 unmodified lines
490 void (*ipi_send_single)(struct irq_data *data, unsigned int cpu);492 void (*ipi_send_single)(struct irq_data *data, unsigned int cpu);
491 void (*ipi_send_mask)(struct irq_data *data, const struct cpumask *dest);493 void (*ipi_send_mask)(struct irq_data *data, const struct cpumask *dest);
492 494
495 int (*irq_nmi_setup)(struct irq_data *data);
496 void (*irq_nmi_teardown)(struct irq_data *data);
497
493 unsigned long flags;498 unsigned long flags;
494};499};
495 500
@@ -505,6 +510,7 @@ struct irq_chip { · 9 unmodified lines
505 * IRQCHIP_ONESHOT_SAFE: One shot does not require mask/unmask510 * IRQCHIP_ONESHOT_SAFE: One shot does not require mask/unmask
506 * IRQCHIP_EOI_THREADED: Chip requires eoi() on unmask in threaded mode511 * IRQCHIP_EOI_THREADED: Chip requires eoi() on unmask in threaded mode
507 * IRQCHIP_SUPPORTS_LEVEL_MSI Chip can provide two doorbells for Level MSIs512 * IRQCHIP_SUPPORTS_LEVEL_MSI Chip can provide two doorbells for Level MSIs
513 * IRQCHIP_SUPPORTS_NMI: Chip can deliver NMIs, only for root irqchips
508 */514 */
509enum {515enum {
510 IRQCHIP_SET_TYPE_MASKED = (1 << 0),516 IRQCHIP_SET_TYPE_MASKED = (1 << 0),
@@ -515,6 +521,7 @@ enum { · 4 unmodified lines
515 IRQCHIP_ONESHOT_SAFE = (1 << 5),521 IRQCHIP_ONESHOT_SAFE = (1 << 5),
516 IRQCHIP_EOI_THREADED = (1 << 6),522 IRQCHIP_EOI_THREADED = (1 << 6),
517 IRQCHIP_SUPPORTS_LEVEL_MSI = (1 << 7),523 IRQCHIP_SUPPORTS_LEVEL_MSI = (1 << 7),
524 IRQCHIP_SUPPORTS_NMI = (1 << 8),
518};525};
519 526
520#include <linux/irqdesc.h>527#include <linux/irqdesc.h>
@@ -594,6 +601,9 @@ extern void handle_percpu_devid_irq(struct irq_desc *desc); · 73 unmodified lines
594extern void handle_bad_irq(struct irq_desc *desc);601extern void handle_bad_irq(struct irq_desc *desc);
595extern void handle_nested_irq(unsigned int irq);602extern void handle_nested_irq(unsigned int irq);
596 603
604extern void handle_fasteoi_nmi(struct irq_desc *desc);
605extern void handle_percpu_devid_fasteoi_nmi(struct irq_desc *desc);
606
597extern int irq_chip_compose_msi_msg(struct irq_data *data, struct msi_msg *msg);607extern int irq_chip_compose_msi_msg(struct irq_data *data, struct msi_msg *msg);
598extern int irq_chip_pm_get(struct irq_data *data);608extern int irq_chip_pm_get(struct irq_data *data);
599extern int irq_chip_pm_put(struct irq_data *data);609extern int irq_chip_pm_put(struct irq_data *data);
include/linux/irqdesc.h+7−0
@@ -28,6 +28,7 @@ struct pt_regs; · 27 unmodified lines
28 * @core_internal_state__do_not_mess_with_it: core internal status information28 * @core_internal_state__do_not_mess_with_it: core internal status information
29 * @depth: disable-depth, for nested irq_disable() calls29 * @depth: disable-depth, for nested irq_disable() calls
30 * @wake_depth: enable depth, for multiple irq_set_irq_wake() callers30 * @wake_depth: enable depth, for multiple irq_set_irq_wake() callers
31 * @tot_count: stats field for non-percpu irqs
31 * @irq_count: stats field to detect stalled irqs32 * @irq_count: stats field to detect stalled irqs
32 * @last_unhandled: aging timer for unhandled count33 * @last_unhandled: aging timer for unhandled count
33 * @irqs_unhandled: stats field for spurious unhandled interrupts34 * @irqs_unhandled: stats field for spurious unhandled interrupts
@@ -65,6 +66,7 @@ struct irq_desc { · 31 unmodified lines
65 unsigned int core_internal_state__do_not_mess_with_it;66 unsigned int core_internal_state__do_not_mess_with_it;
66 unsigned int depth; /* nested irq disables */67 unsigned int depth; /* nested irq disables */
67 unsigned int wake_depth; /* nested wake enables */68 unsigned int wake_depth; /* nested wake enables */
69 unsigned int tot_count;
68 unsigned int irq_count; /* For detecting broken IRQs */70 unsigned int irq_count; /* For detecting broken IRQs */
69 unsigned long last_unhandled; /* Aging timer for unhandled count */71 unsigned long last_unhandled; /* Aging timer for unhandled count */
70 unsigned int irqs_unhandled;72 unsigned int irqs_unhandled;
@@ -171,6 +173,11 @@ static inline int handle_domain_irq(struct irq_domain *domain, · 100 unmodified lines
171{173{
172 return __handle_domain_irq(domain, hwirq, true, regs);174 return __handle_domain_irq(domain, hwirq, true, regs);
173}175}
176
177#ifdef CONFIG_IRQ_DOMAIN
178int handle_domain_nmi(struct irq_domain *domain, unsigned int hwirq,
179 struct pt_regs *regs);
180#endif
174#endif181#endif
175 182
176/* Test to see if a driver has successfully requested an irq */183/* Test to see if a driver has successfully requested an irq */
include/linux/irqdomain.h+1−0
@@ -265,6 +265,7 @@ extern struct irq_domain *irq_find_matching_fwspec(struct irq_fwspec *fwspec, · 264 unmodified lines
265 enum irq_domain_bus_token bus_token);265 enum irq_domain_bus_token bus_token);
266extern bool irq_domain_check_msi_remap(void);266extern bool irq_domain_check_msi_remap(void);
267extern void irq_set_default_host(struct irq_domain *host);267extern void irq_set_default_host(struct irq_domain *host);
268extern struct irq_domain *irq_get_default_host(void);
268extern int irq_domain_alloc_descs(int virq, unsigned int nr_irqs,269extern int irq_domain_alloc_descs(int virq, unsigned int nr_irqs,
269 irq_hw_number_t hwirq, int node,270 irq_hw_number_t hwirq, int node,
270 const struct irq_affinity_desc *affinity);271 const struct irq_affinity_desc *affinity);
include/linux/kthread.h+1−0
@@ -56,6 +56,7 @@ void kthread_bind_mask(struct task_struct *k, const struct cpumask *mask); · 55 unmodified lines
56int kthread_stop(struct task_struct *k);56int kthread_stop(struct task_struct *k);
57bool kthread_should_stop(void);57bool kthread_should_stop(void);
58bool kthread_should_park(void);58bool kthread_should_park(void);
59bool __kthread_should_park(struct task_struct *k);
59bool kthread_freezable_should_stop(bool *was_frozen);60bool kthread_freezable_should_stop(bool *was_frozen);
60void *kthread_data(struct task_struct *k);61void *kthread_data(struct task_struct *k);
61void *kthread_probe_data(struct task_struct *k);62void *kthread_probe_data(struct task_struct *k);
include/linux/pci.h+2−2
@@ -1393,7 +1393,7 @@ static inline int pci_enable_msix_exact(struct pci_dev *dev, · 1392 unmodified lines
1393}1393}
1394int pci_alloc_irq_vectors_affinity(struct pci_dev *dev, unsigned int min_vecs,1394int pci_alloc_irq_vectors_affinity(struct pci_dev *dev, unsigned int min_vecs,
1395 unsigned int max_vecs, unsigned int flags,1395 unsigned int max_vecs, unsigned int flags,
1396 const struct irq_affinity *affd);1396 struct irq_affinity *affd);
1397 1397
1398void pci_free_irq_vectors(struct pci_dev *dev);1398void pci_free_irq_vectors(struct pci_dev *dev);
1399int pci_irq_vector(struct pci_dev *dev, unsigned int nr);1399int pci_irq_vector(struct pci_dev *dev, unsigned int nr);
@@ -1419,7 +1419,7 @@ static inline int pci_enable_msix_exact(struct pci_dev *dev, · 19 unmodified lines
1419static inline int1419static inline int
1420pci_alloc_irq_vectors_affinity(struct pci_dev *dev, unsigned int min_vecs,1420pci_alloc_irq_vectors_affinity(struct pci_dev *dev, unsigned int min_vecs,
1421 unsigned int max_vecs, unsigned int flags,1421 unsigned int max_vecs, unsigned int flags,
1422 const struct irq_affinity *aff_desc)1422 struct irq_affinity *aff_desc)
1423{1423{
1424 if ((flags & PCI_IRQ_LEGACY) && min_vecs == 1 && dev->irq)1424 if ((flags & PCI_IRQ_LEGACY) && min_vecs == 1 && dev->irq)
1425 return 1;1425 return 1;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t