Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ARM: 7394/1: VIC: respect list of valid sources

The current IRQ domain implementation in the VIC allocates 32
interrupts for each VIC instance no matter whether the
controller actually use all the IRQs or not. Alter this so
we only allocate a domain up until the last IRQ marked valid.

Cc: Will Deacon <will.deacon@arm.com>
Cc: Grant Likely <grant.likely@secretlab.ca>
Cc: Rob Herring <rob.herring@calxeda.com>
Acked-by: Jamie Iles <jamie@jamieiles.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>

authored by

Linus Walleij and committed by
Russell King
fa943bed 98fab064

+7 -5
+7 -5
arch/arm/common/vic.c
··· 168 168 * vic_register() - Register a VIC. 169 169 * @base: The base address of the VIC. 170 170 * @irq: The base IRQ for the VIC. 171 + * @valid_sources: bitmask of valid interrupts 171 172 * @resume_sources: bitmask of interrupts allowed for resume sources. 172 173 * @node: The device tree node associated with the VIC. 173 174 * ··· 179 178 * This also configures the IRQ domain for the VIC. 180 179 */ 181 180 static void __init vic_register(void __iomem *base, unsigned int irq, 182 - u32 resume_sources, struct device_node *node) 181 + u32 valid_sources, u32 resume_sources, 182 + struct device_node *node) 183 183 { 184 184 struct vic_device *v; 185 185 ··· 194 192 v->resume_sources = resume_sources; 195 193 v->irq = irq; 196 194 vic_id++; 197 - v->domain = irq_domain_add_legacy(node, 32, irq, 0, 198 - &irq_domain_simple_ops, v); 195 + v->domain = irq_domain_add_legacy(node, fls(valid_sources), irq, 0, 196 + &vic_irqdomain_ops, v); 199 197 } 200 198 201 199 static void vic_ack_irq(struct irq_data *d) ··· 341 339 } 342 340 343 341 vic_set_irq_sources(base, irq_start, vic_sources); 344 - vic_register(base, irq_start, 0, node); 342 + vic_register(base, irq_start, vic_sources, 0, node); 345 343 } 346 344 347 345 void __init __vic_init(void __iomem *base, unsigned int irq_start, ··· 383 381 384 382 vic_set_irq_sources(base, irq_start, vic_sources); 385 383 386 - vic_register(base, irq_start, resume_sources, node); 384 + vic_register(base, irq_start, vic_sources, resume_sources, node); 387 385 } 388 386 389 387 /**