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
This commit is contained in:
commit
0d484375d7
|
@ -2399,13 +2399,14 @@ static void its_free_device(struct its_device *its_dev)
|
|||
kfree(its_dev);
|
||||
}
|
||||
|
||||
static int its_alloc_device_irq(struct its_device *dev, irq_hw_number_t *hwirq)
|
||||
static int its_alloc_device_irq(struct its_device *dev, int nvecs, irq_hw_number_t *hwirq)
|
||||
{
|
||||
int idx;
|
||||
|
||||
idx = find_first_zero_bit(dev->event_map.lpi_map,
|
||||
dev->event_map.nr_lpis);
|
||||
if (idx == dev->event_map.nr_lpis)
|
||||
idx = bitmap_find_free_region(dev->event_map.lpi_map,
|
||||
dev->event_map.nr_lpis,
|
||||
get_count_order(nvecs));
|
||||
if (idx < 0)
|
||||
return -ENOSPC;
|
||||
|
||||
*hwirq = dev->event_map.lpi_base + idx;
|
||||
|
@ -2501,21 +2502,21 @@ static int its_irq_domain_alloc(struct irq_domain *domain, unsigned int virq,
|
|||
int err;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < nr_irqs; i++) {
|
||||
err = its_alloc_device_irq(its_dev, &hwirq);
|
||||
if (err)
|
||||
return err;
|
||||
err = its_alloc_device_irq(its_dev, nr_irqs, &hwirq);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
err = its_irq_gic_domain_alloc(domain, virq + i, hwirq);
|
||||
for (i = 0; i < nr_irqs; i++) {
|
||||
err = its_irq_gic_domain_alloc(domain, virq + i, hwirq + i);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
irq_domain_set_hwirq_and_chip(domain, virq + i,
|
||||
hwirq, &its_irq_chip, its_dev);
|
||||
hwirq + i, &its_irq_chip, its_dev);
|
||||
irqd_set_single_target(irq_desc_get_irq_data(irq_to_desc(virq + i)));
|
||||
pr_debug("ID:%d pID:%d vID:%d\n",
|
||||
(int)(hwirq - its_dev->event_map.lpi_base),
|
||||
(int) hwirq, virq + i);
|
||||
(int)(hwirq + i - its_dev->event_map.lpi_base),
|
||||
(int)(hwirq + i), virq + i);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -24,7 +24,7 @@ struct mbi_range {
|
|||
unsigned long *bm;
|
||||
};
|
||||
|
||||
static struct mutex mbi_lock;
|
||||
static DEFINE_MUTEX(mbi_lock);
|
||||
static phys_addr_t mbi_phys_base;
|
||||
static struct mbi_range *mbi_ranges;
|
||||
static unsigned int mbi_range_nr;
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
#include <linux/gpio.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/irq.h>
|
||||
#include <linux/irqdomain.h>
|
||||
|
@ -16,7 +15,6 @@
|
|||
#include <linux/slab.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/of_device.h>
|
||||
#include <linux/of_gpio.h>
|
||||
#include <linux/of_irq.h>
|
||||
#include <linux/irqchip/irq-madera.h>
|
||||
#include <linux/mfd/madera/core.h>
|
||||
|
|
|
@ -822,6 +822,7 @@ static int __init stm32_exti_init(const struct stm32_exti_drv_data *drv_data,
|
|||
static const struct irq_domain_ops stm32_exti_h_domain_ops = {
|
||||
.alloc = stm32_exti_h_domain_alloc,
|
||||
.free = irq_domain_free_irqs_common,
|
||||
.xlate = irq_domain_xlate_twocell,
|
||||
};
|
||||
|
||||
static int
|
||||
|
|
|
@ -260,6 +260,7 @@ struct irq_affinity {
|
|||
/**
|
||||
* struct irq_affinity_desc - Interrupt affinity descriptor
|
||||
* @mask: cpumask to hold the affinity assignment
|
||||
* @is_managed: 1 if the interrupt is managed internally
|
||||
*/
|
||||
struct irq_affinity_desc {
|
||||
struct cpumask mask;
|
||||
|
|
|
@ -457,7 +457,7 @@ static int alloc_descs(unsigned int start, unsigned int cnt, int node,
|
|||
|
||||
/* Validate affinity mask(s) */
|
||||
if (affinity) {
|
||||
for (i = 0; i < cnt; i++, i++) {
|
||||
for (i = 0; i < cnt; i++) {
|
||||
if (cpumask_empty(&affinity[i].mask))
|
||||
return -EINVAL;
|
||||
}
|
||||
|
|
|
@ -393,6 +393,9 @@ int irq_setup_affinity(struct irq_desc *desc)
|
|||
}
|
||||
|
||||
cpumask_and(&mask, cpu_online_mask, set);
|
||||
if (cpumask_empty(&mask))
|
||||
cpumask_copy(&mask, cpu_online_mask);
|
||||
|
||||
if (node != NUMA_NO_NODE) {
|
||||
const struct cpumask *nodemask = cpumask_of_node(node);
|
||||
|
||||
|
|
Loading…
Reference in New Issue