Skip to content

Commit c9c96e3

Browse files
author
Marc Zyngier
committed
irqchip/gic-v3-its: Fix LPI release for Multi-MSI devices
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: 8208d17 ("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]
1 parent e89327f commit c9c96e3

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2641,14 +2641,13 @@ static void its_irq_domain_free(struct irq_domain *domain, unsigned int virq,
26412641
struct its_node *its = its_dev->its;
26422642
int i;
26432643

2644+
bitmap_release_region(its_dev->event_map.lpi_map,
2645+
its_get_event_id(irq_domain_get_irq_data(domain, virq)),
2646+
get_count_order(nr_irqs));
2647+
26442648
for (i = 0; i < nr_irqs; i++) {
26452649
struct irq_data *data = irq_domain_get_irq_data(domain,
26462650
virq + i);
2647-
u32 event = its_get_event_id(data);
2648-
2649-
/* Mark interrupt index as unused */
2650-
clear_bit(event, its_dev->event_map.lpi_map);
2651-
26522651
/* Nuke the entry in the domain */
26532652
irq_domain_reset_irq_data(data);
26542653
}

0 commit comments

Comments
 (0)