Lines Matching +full:msi +full:- +full:ranges
2 * Copyright 2006-2008, Michael Ellerman, IBM Corporation.
21 spin_lock_irqsave(&bmp->lock, flags); in msi_bitmap_alloc_hwirqs()
26 offset = bitmap_find_free_region(bmp->bitmap, bmp->irq_count, order); in msi_bitmap_alloc_hwirqs()
27 spin_unlock_irqrestore(&bmp->lock, flags); in msi_bitmap_alloc_hwirqs()
44 spin_lock_irqsave(&bmp->lock, flags); in msi_bitmap_free_hwirqs()
45 bitmap_release_region(bmp->bitmap, offset, order); in msi_bitmap_free_hwirqs()
46 spin_unlock_irqrestore(&bmp->lock, flags); in msi_bitmap_free_hwirqs()
55 spin_lock_irqsave(&bmp->lock, flags); in msi_bitmap_reserve_hwirq()
56 bitmap_allocate_region(bmp->bitmap, hwirq, 0); in msi_bitmap_reserve_hwirq()
57 spin_unlock_irqrestore(&bmp->lock, flags); in msi_bitmap_reserve_hwirq()
61 * msi_bitmap_reserve_dt_hwirqs - Reserve irqs specified in the device tree.
62 * @bmp: pointer to the MSI bitmap.
65 * irqs can be used for MSI. If found those irqs reserved in the device tree
76 if (!bmp->of_node) in msi_bitmap_reserve_dt_hwirqs()
79 p = of_get_property(bmp->of_node, "msi-available-ranges", &len); in msi_bitmap_reserve_dt_hwirqs()
81 pr_debug("msi_bitmap: no msi-available-ranges property " \ in msi_bitmap_reserve_dt_hwirqs()
82 "found on %s\n", bmp->of_node->full_name); in msi_bitmap_reserve_dt_hwirqs()
87 printk(KERN_WARNING "msi_bitmap: Malformed msi-available-ranges" in msi_bitmap_reserve_dt_hwirqs()
88 " property on %s\n", bmp->of_node->full_name); in msi_bitmap_reserve_dt_hwirqs()
89 return -EINVAL; in msi_bitmap_reserve_dt_hwirqs()
92 bitmap_allocate_region(bmp->bitmap, 0, get_count_order(bmp->irq_count)); in msi_bitmap_reserve_dt_hwirqs()
94 spin_lock(&bmp->lock); in msi_bitmap_reserve_dt_hwirqs()
100 bitmap_release_region(bmp->bitmap, *p + j, 0); in msi_bitmap_reserve_dt_hwirqs()
103 spin_unlock(&bmp->lock); in msi_bitmap_reserve_dt_hwirqs()
114 return -EINVAL; in msi_bitmap_alloc()
119 bmp->bitmap = zalloc_maybe_bootmem(size, GFP_KERNEL); in msi_bitmap_alloc()
120 if (!bmp->bitmap) { in msi_bitmap_alloc()
122 return -ENOMEM; in msi_bitmap_alloc()
126 spin_lock_init(&bmp->lock); in msi_bitmap_alloc()
127 bmp->of_node = of_node_get(of_node); in msi_bitmap_alloc()
128 bmp->irq_count = irq_count; in msi_bitmap_alloc()
136 of_node_put(bmp->of_node); in msi_bitmap_free()
137 bmp->bitmap = NULL; in msi_bitmap_free()
161 /* With no node, there's no msi-available-ranges, so expect > 0 */ in test_basics()
184 /* Clients may check bitmap == NULL for "not-allocated" */ in test_basics()
193 const char *expected_str = "0-9,20-24,28-39,41-99,220-255"; in test_of_node()
194 char *prop_name = "msi-available-ranges"; in test_of_node()
209 /* No msi-available-ranges, so expect > 0 */ in test_of_node()
217 /* Now create a fake msi-available-ranges property */ in test_of_node()
227 /* msi-available-ranges, so expect == 0 */ in test_of_node()
240 printk(KERN_DEBUG "Running MSI bitmap self-tests ...\n"); in msi_bitmap_selftest()