]> Git Repo - linux.git/commitdiff
irqchip/gic-v3-its: Fix LPI release for Multi-MSI devices
authorMarc Zyngier <[email protected]>
Thu, 5 Sep 2019 13:56:47 +0000 (14:56 +0100)
committerMarc Zyngier <[email protected]>
Thu, 5 Sep 2019 15:03:48 +0000 (16:03 +0100)
When allocating a range of LPIs for a Multi-MSI capable device,
this allocation extended to the closest power of 2.

But on the release path, the interrupts are released one by
one. This results in not releasing the "extra" range, leaking
the its_device. Trying to reprobe the device will then fail.

Fix it by releasing the LPIs the same way we allocate them.

Fixes: 8208d1708b88 ("irqchip/gic-v3-its: Align PCI Multi-MSI allocation on their size")
Reported-by: Jiaxing Luo <[email protected]>
Tested-by: John Garry <[email protected]>
Signed-off-by: Marc Zyngier <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
drivers/irqchip/irq-gic-v3-its.c

index 9380aa43493d77d84c3e5b3b05127c716124160a..62e54f1a248ba002942bc0bae0c6b97d52f9f857 100644 (file)
@@ -2641,14 +2641,13 @@ static void its_irq_domain_free(struct irq_domain *domain, unsigned int virq,
        struct its_node *its = its_dev->its;
        int i;
 
+       bitmap_release_region(its_dev->event_map.lpi_map,
+                             its_get_event_id(irq_domain_get_irq_data(domain, virq)),
+                             get_count_order(nr_irqs));
+
        for (i = 0; i < nr_irqs; i++) {
                struct irq_data *data = irq_domain_get_irq_data(domain,
                                                                virq + i);
-               u32 event = its_get_event_id(data);
-
-               /* Mark interrupt index as unused */
-               clear_bit(event, its_dev->event_map.lpi_map);
-
                /* Nuke the entry in the domain */
                irq_domain_reset_irq_data(data);
        }
This page took 0.062572 seconds and 4 git commands to generate.