diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2019-01-27 14:25:38 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-01-27 14:25:38 -0500 |
| commit | 0d484375d73ad2ec39a395365449a70c200645b1 (patch) | |
| tree | c3392a2d8c2df9503b70db9bf43db70bc760b2f8 | |
| parent | 983542434e6beef911d5ae4488c49080a177e5e4 (diff) | |
| parent | 37b144df8099465bf8d08296d8b424c77fd9b0ac (diff) | |
Merge branch 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull irq fixes from Thomas Gleixner:
"A small set of fixes for the interrupt subsystem:
- Fix a double increment in the irq descriptor allocator which
resulted in a sanity check only being done for every second
affinity mask
- Add a missing device tree translation in the stm32-exti driver.
Without that the interrupt association is completely wrong.
- Initialize the mutex in the GIC-V3 MBI driver
- Fix the alignment for aliasing devices in the GIC-V3-ITS driver so
multi MSI allocations work correctly
- Ensure that the initial affinity of a interrupt is not empty at
startup time.
- Drop bogus include in the madera irq chip driver
- Fix KernelDoc regression"
* 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
irqchip/gic-v3-its: Align PCI Multi-MSI allocation on their size
genirq/irqdesc: Fix double increment in alloc_descs()
genirq: Fix the kerneldoc comment for struct irq_affinity_desc
irqchip/madera: Drop GPIO includes
irqchip/gic-v3-mbi: Fix uninitialized mbi_lock
irqchip/stm32-exti: Add domain translate function
genirq: Make sure the initial affinity is not empty
| -rw-r--r-- | drivers/irqchip/irq-gic-v3-its.c | 25 | ||||
| -rw-r--r-- | drivers/irqchip/irq-gic-v3-mbi.c | 2 | ||||
| -rw-r--r-- | drivers/irqchip/irq-madera.c | 2 | ||||
| -rw-r--r-- | drivers/irqchip/irq-stm32-exti.c | 1 | ||||
| -rw-r--r-- | include/linux/interrupt.h | 1 | ||||
| -rw-r--r-- | kernel/irq/irqdesc.c | 2 | ||||
| -rw-r--r-- | kernel/irq/manage.c | 3 |
7 files changed, 20 insertions, 16 deletions
diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c index db20e992a40f..7f2a45445b00 100644 --- a/drivers/irqchip/irq-gic-v3-its.c +++ b/drivers/irqchip/irq-gic-v3-its.c | |||
| @@ -2399,13 +2399,14 @@ static void its_free_device(struct its_device *its_dev) | |||
| 2399 | kfree(its_dev); | 2399 | kfree(its_dev); |
| 2400 | } | 2400 | } |
| 2401 | 2401 | ||
| 2402 | static int its_alloc_device_irq(struct its_device *dev, irq_hw_number_t *hwirq) | 2402 | static int its_alloc_device_irq(struct its_device *dev, int nvecs, irq_hw_number_t *hwirq) |
| 2403 | { | 2403 | { |
| 2404 | int idx; | 2404 | int idx; |
| 2405 | 2405 | ||
| 2406 | idx = find_first_zero_bit(dev->event_map.lpi_map, | 2406 | idx = bitmap_find_free_region(dev->event_map.lpi_map, |
| 2407 | dev->event_map.nr_lpis); | 2407 | dev->event_map.nr_lpis, |
| 2408 | if (idx == dev->event_map.nr_lpis) | 2408 | get_count_order(nvecs)); |
| 2409 | if (idx < 0) | ||
| 2409 | return -ENOSPC; | 2410 | return -ENOSPC; |
| 2410 | 2411 | ||
| 2411 | *hwirq = dev->event_map.lpi_base + idx; | 2412 | *hwirq = dev->event_map.lpi_base + idx; |
| @@ -2501,21 +2502,21 @@ static int its_irq_domain_alloc(struct irq_domain *domain, unsigned int virq, | |||
| 2501 | int err; | 2502 | int err; |
| 2502 | int i; | 2503 | int i; |
| 2503 | 2504 | ||
| 2504 | for (i = 0; i < nr_irqs; i++) { | 2505 | err = its_alloc_device_irq(its_dev, nr_irqs, &hwirq); |
| 2505 | err = its_alloc_device_irq(its_dev, &hwirq); | 2506 | if (err) |
| 2506 | if (err) | 2507 | return err; |
| 2507 | return err; | ||
| 2508 | 2508 | ||
| 2509 | err = its_irq_gic_domain_alloc(domain, virq + i, hwirq); | 2509 | for (i = 0; i < nr_irqs; i++) { |
| 2510 | err = its_irq_gic_domain_alloc(domain, virq + i, hwirq + i); | ||
| 2510 | if (err) | 2511 | if (err) |
| 2511 | return err; | 2512 | return err; |
| 2512 | 2513 | ||
| 2513 | irq_domain_set_hwirq_and_chip(domain, virq + i, | 2514 | irq_domain_set_hwirq_and_chip(domain, virq + i, |
| 2514 | hwirq, &its_irq_chip, its_dev); | 2515 | hwirq + i, &its_irq_chip, its_dev); |
| 2515 | irqd_set_single_target(irq_desc_get_irq_data(irq_to_desc(virq + i))); | 2516 | irqd_set_single_target(irq_desc_get_irq_data(irq_to_desc(virq + i))); |
| 2516 | pr_debug("ID:%d pID:%d vID:%d\n", | 2517 | pr_debug("ID:%d pID:%d vID:%d\n", |
| 2517 | (int)(hwirq - its_dev->event_map.lpi_base), | 2518 | (int)(hwirq + i - its_dev->event_map.lpi_base), |
| 2518 | (int) hwirq, virq + i); | 2519 | (int)(hwirq + i), virq + i); |
| 2519 | } | 2520 | } |
| 2520 | 2521 | ||
| 2521 | return 0; | 2522 | return 0; |
diff --git a/drivers/irqchip/irq-gic-v3-mbi.c b/drivers/irqchip/irq-gic-v3-mbi.c index ad70e7c416e3..fbfa7ff6deb1 100644 --- a/drivers/irqchip/irq-gic-v3-mbi.c +++ b/drivers/irqchip/irq-gic-v3-mbi.c | |||
| @@ -24,7 +24,7 @@ struct mbi_range { | |||
| 24 | unsigned long *bm; | 24 | unsigned long *bm; |
| 25 | }; | 25 | }; |
| 26 | 26 | ||
| 27 | static struct mutex mbi_lock; | 27 | static DEFINE_MUTEX(mbi_lock); |
| 28 | static phys_addr_t mbi_phys_base; | 28 | static phys_addr_t mbi_phys_base; |
| 29 | static struct mbi_range *mbi_ranges; | 29 | static struct mbi_range *mbi_ranges; |
| 30 | static unsigned int mbi_range_nr; | 30 | static unsigned int mbi_range_nr; |
diff --git a/drivers/irqchip/irq-madera.c b/drivers/irqchip/irq-madera.c index e9256dee1a45..8b81271c823c 100644 --- a/drivers/irqchip/irq-madera.c +++ b/drivers/irqchip/irq-madera.c | |||
| @@ -7,7 +7,6 @@ | |||
| 7 | */ | 7 | */ |
| 8 | 8 | ||
| 9 | #include <linux/module.h> | 9 | #include <linux/module.h> |
| 10 | #include <linux/gpio.h> | ||
| 11 | #include <linux/interrupt.h> | 10 | #include <linux/interrupt.h> |
| 12 | #include <linux/irq.h> | 11 | #include <linux/irq.h> |
| 13 | #include <linux/irqdomain.h> | 12 | #include <linux/irqdomain.h> |
| @@ -16,7 +15,6 @@ | |||
| 16 | #include <linux/slab.h> | 15 | #include <linux/slab.h> |
| 17 | #include <linux/of.h> | 16 | #include <linux/of.h> |
| 18 | #include <linux/of_device.h> | 17 | #include <linux/of_device.h> |
| 19 | #include <linux/of_gpio.h> | ||
| 20 | #include <linux/of_irq.h> | 18 | #include <linux/of_irq.h> |
| 21 | #include <linux/irqchip/irq-madera.h> | 19 | #include <linux/irqchip/irq-madera.h> |
| 22 | #include <linux/mfd/madera/core.h> | 20 | #include <linux/mfd/madera/core.h> |
diff --git a/drivers/irqchip/irq-stm32-exti.c b/drivers/irqchip/irq-stm32-exti.c index 6edfd4bfa169..a93296b9b45d 100644 --- a/drivers/irqchip/irq-stm32-exti.c +++ b/drivers/irqchip/irq-stm32-exti.c | |||
| @@ -822,6 +822,7 @@ out_unmap: | |||
| 822 | static const struct irq_domain_ops stm32_exti_h_domain_ops = { | 822 | static const struct irq_domain_ops stm32_exti_h_domain_ops = { |
| 823 | .alloc = stm32_exti_h_domain_alloc, | 823 | .alloc = stm32_exti_h_domain_alloc, |
| 824 | .free = irq_domain_free_irqs_common, | 824 | .free = irq_domain_free_irqs_common, |
| 825 | .xlate = irq_domain_xlate_twocell, | ||
| 825 | }; | 826 | }; |
| 826 | 827 | ||
| 827 | static int | 828 | static int |
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index c672f34235e7..4a728dba02e2 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h | |||
| @@ -260,6 +260,7 @@ struct irq_affinity { | |||
| 260 | /** | 260 | /** |
| 261 | * struct irq_affinity_desc - Interrupt affinity descriptor | 261 | * struct irq_affinity_desc - Interrupt affinity descriptor |
| 262 | * @mask: cpumask to hold the affinity assignment | 262 | * @mask: cpumask to hold the affinity assignment |
| 263 | * @is_managed: 1 if the interrupt is managed internally | ||
| 263 | */ | 264 | */ |
| 264 | struct irq_affinity_desc { | 265 | struct irq_affinity_desc { |
| 265 | struct cpumask mask; | 266 | struct cpumask mask; |
diff --git a/kernel/irq/irqdesc.c b/kernel/irq/irqdesc.c index ee062b7939d3..ef8ad36cadcf 100644 --- a/kernel/irq/irqdesc.c +++ b/kernel/irq/irqdesc.c | |||
| @@ -457,7 +457,7 @@ static int alloc_descs(unsigned int start, unsigned int cnt, int node, | |||
| 457 | 457 | ||
| 458 | /* Validate affinity mask(s) */ | 458 | /* Validate affinity mask(s) */ |
| 459 | if (affinity) { | 459 | if (affinity) { |
| 460 | for (i = 0; i < cnt; i++, i++) { | 460 | for (i = 0; i < cnt; i++) { |
| 461 | if (cpumask_empty(&affinity[i].mask)) | 461 | if (cpumask_empty(&affinity[i].mask)) |
| 462 | return -EINVAL; | 462 | return -EINVAL; |
| 463 | } | 463 | } |
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c index a4888ce4667a..84b54a17b95d 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c | |||
| @@ -393,6 +393,9 @@ int irq_setup_affinity(struct irq_desc *desc) | |||
| 393 | } | 393 | } |
| 394 | 394 | ||
| 395 | cpumask_and(&mask, cpu_online_mask, set); | 395 | cpumask_and(&mask, cpu_online_mask, set); |
| 396 | if (cpumask_empty(&mask)) | ||
| 397 | cpumask_copy(&mask, cpu_online_mask); | ||
| 398 | |||
| 396 | if (node != NUMA_NO_NODE) { | 399 | if (node != NUMA_NO_NODE) { |
| 397 | const struct cpumask *nodemask = cpumask_of_node(node); | 400 | const struct cpumask *nodemask = cpumask_of_node(node); |
| 398 | 401 | ||
