Skip to content

Commit 0d48437

Browse files
committed
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
2 parents 9835424 + 37b144d commit 0d48437

File tree

7 files changed

+20
-16
lines changed

7 files changed

+20
-16
lines changed

drivers/irqchip/irq-gic-v3-its.c

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2399,13 +2399,14 @@ static void its_free_device(struct its_device *its_dev)
23992399
kfree(its_dev);
24002400
}
24012401

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)
24032403
{
24042404
int idx;
24052405

2406-
idx = find_first_zero_bit(dev->event_map.lpi_map,
2407-
dev->event_map.nr_lpis);
2408-
if (idx == dev->event_map.nr_lpis)
2406+
idx = bitmap_find_free_region(dev->event_map.lpi_map,
2407+
dev->event_map.nr_lpis,
2408+
get_count_order(nvecs));
2409+
if (idx < 0)
24092410
return -ENOSPC;
24102411

24112412
*hwirq = dev->event_map.lpi_base + idx;
@@ -2501,21 +2502,21 @@ static int its_irq_domain_alloc(struct irq_domain *domain, unsigned int virq,
25012502
int err;
25022503
int i;
25032504

2504-
for (i = 0; i < nr_irqs; i++) {
2505-
err = its_alloc_device_irq(its_dev, &hwirq);
2506-
if (err)
2507-
return err;
2505+
err = its_alloc_device_irq(its_dev, nr_irqs, &hwirq);
2506+
if (err)
2507+
return err;
25082508

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);
25102511
if (err)
25112512
return err;
25122513

25132514
irq_domain_set_hwirq_and_chip(domain, virq + i,
2514-
hwirq, &its_irq_chip, its_dev);
2515+
hwirq + i, &its_irq_chip, its_dev);
25152516
irqd_set_single_target(irq_desc_get_irq_data(irq_to_desc(virq + i)));
25162517
pr_debug("ID:%d pID:%d vID:%d\n",
2517-
(int)(hwirq - its_dev->event_map.lpi_base),
2518-
(int) hwirq, virq + i);
2518+
(int)(hwirq + i - its_dev->event_map.lpi_base),
2519+
(int)(hwirq + i), virq + i);
25192520
}
25202521

25212522
return 0;

drivers/irqchip/irq-gic-v3-mbi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ struct mbi_range {
2424
unsigned long *bm;
2525
};
2626

27-
static struct mutex mbi_lock;
27+
static DEFINE_MUTEX(mbi_lock);
2828
static phys_addr_t mbi_phys_base;
2929
static struct mbi_range *mbi_ranges;
3030
static unsigned int mbi_range_nr;

drivers/irqchip/irq-madera.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
*/
88

99
#include <linux/module.h>
10-
#include <linux/gpio.h>
1110
#include <linux/interrupt.h>
1211
#include <linux/irq.h>
1312
#include <linux/irqdomain.h>
@@ -16,7 +15,6 @@
1615
#include <linux/slab.h>
1716
#include <linux/of.h>
1817
#include <linux/of_device.h>
19-
#include <linux/of_gpio.h>
2018
#include <linux/of_irq.h>
2119
#include <linux/irqchip/irq-madera.h>
2220
#include <linux/mfd/madera/core.h>

drivers/irqchip/irq-stm32-exti.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -822,6 +822,7 @@ static int __init stm32_exti_init(const struct stm32_exti_drv_data *drv_data,
822822
static const struct irq_domain_ops stm32_exti_h_domain_ops = {
823823
.alloc = stm32_exti_h_domain_alloc,
824824
.free = irq_domain_free_irqs_common,
825+
.xlate = irq_domain_xlate_twocell,
825826
};
826827

827828
static int

include/linux/interrupt.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,7 @@ struct irq_affinity {
260260
/**
261261
* struct irq_affinity_desc - Interrupt affinity descriptor
262262
* @mask: cpumask to hold the affinity assignment
263+
* @is_managed: 1 if the interrupt is managed internally
263264
*/
264265
struct irq_affinity_desc {
265266
struct cpumask mask;

kernel/irq/irqdesc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ static int alloc_descs(unsigned int start, unsigned int cnt, int node,
457457

458458
/* Validate affinity mask(s) */
459459
if (affinity) {
460-
for (i = 0; i < cnt; i++, i++) {
460+
for (i = 0; i < cnt; i++) {
461461
if (cpumask_empty(&affinity[i].mask))
462462
return -EINVAL;
463463
}

kernel/irq/manage.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,9 @@ int irq_setup_affinity(struct irq_desc *desc)
393393
}
394394

395395
cpumask_and(&mask, cpu_online_mask, set);
396+
if (cpumask_empty(&mask))
397+
cpumask_copy(&mask, cpu_online_mask);
398+
396399
if (node != NUMA_NO_NODE) {
397400
const struct cpumask *nodemask = cpumask_of_node(node);
398401

0 commit comments

Comments
 (0)