]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - drivers/irqchip/irq-gic-v3-its.c
davinci_cpdma: make cpdma_chan_split_pool static
[linux.git] / drivers / irqchip / irq-gic-v3-its.c
index 1b5c3672aea277925b57d0e5e9162d7f31dde386..62e54f1a248ba002942bc0bae0c6b97d52f9f857 100644 (file)
@@ -2464,6 +2464,7 @@ static int its_alloc_device_irq(struct its_device *dev, int nvecs, irq_hw_number
 {
        int idx;
 
+       /* Find a free LPI region in lpi_map and allocate them. */
        idx = bitmap_find_free_region(dev->event_map.lpi_map,
                                      dev->event_map.nr_lpis,
                                      get_count_order(nvecs));
@@ -2471,7 +2472,6 @@ static int its_alloc_device_irq(struct its_device *dev, int nvecs, irq_hw_number
                return -ENOSPC;
 
        *hwirq = dev->event_map.lpi_base + idx;
-       set_bit(idx, dev->event_map.lpi_map);
 
        return 0;
 }
@@ -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);
        }
@@ -3921,7 +3920,7 @@ static int __init gic_acpi_parse_madt_its(union acpi_subtable_headers *header,
        res.end = its_entry->base_address + ACPI_GICV3_ITS_MEM_SIZE - 1;
        res.flags = IORESOURCE_MEM;
 
-       dom_handle = irq_domain_alloc_fwnode((void *)its_entry->base_address);
+       dom_handle = irq_domain_alloc_fwnode(&res.start);
        if (!dom_handle) {
                pr_err("ITS@%pa: Unable to allocate GICv3 ITS domain token\n",
                       &res.start);