aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2012-12-25 19:39:16 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2013-01-02 05:35:07 -0500
commit5ced33bc06e7e76cb8a236f15bff49eb6155b618 (patch)
treea82224b7e5350ceb6c6c184ec2aa1af690d1d6e5
parentf5565295892eb93c3191aa241405fe8b685542d6 (diff)
ARM: 7611/1: VIC: fix bug in VIC irqdomain code
The VIC irqdomain code added in commit 07c9249f1fa90cc8189bed44c0bcece664596a72 "ARM: 7554/1: VIC: use irq_domain_add_simple()" Had two bugs: 1) It didn't call irq_create_mapping() once on each valid irq source in the slowpath when registering the controller. 2) It passed a -1 as IRQ offset for the DT case, whereas 0 should be passed as invalid IRQ instead. Cc: Grant Likely <grant.likely@secretlab.ca> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r--arch/arm/common/vic.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/arch/arm/common/vic.c b/arch/arm/common/vic.c
index e4df17ca90c7..8f324b99416e 100644
--- a/arch/arm/common/vic.c
+++ b/arch/arm/common/vic.c
@@ -206,6 +206,7 @@ static void __init vic_register(void __iomem *base, unsigned int irq,
206 struct device_node *node) 206 struct device_node *node)
207{ 207{
208 struct vic_device *v; 208 struct vic_device *v;
209 int i;
209 210
210 if (vic_id >= ARRAY_SIZE(vic_devices)) { 211 if (vic_id >= ARRAY_SIZE(vic_devices)) {
211 printk(KERN_ERR "%s: too few VICs, increase CONFIG_ARM_VIC_NR\n", __func__); 212 printk(KERN_ERR "%s: too few VICs, increase CONFIG_ARM_VIC_NR\n", __func__);
@@ -220,6 +221,10 @@ static void __init vic_register(void __iomem *base, unsigned int irq,
220 vic_id++; 221 vic_id++;
221 v->domain = irq_domain_add_simple(node, fls(valid_sources), irq, 222 v->domain = irq_domain_add_simple(node, fls(valid_sources), irq,
222 &vic_irqdomain_ops, v); 223 &vic_irqdomain_ops, v);
224 /* create an IRQ mapping for each valid IRQ */
225 for (i = 0; i < fls(valid_sources); i++)
226 if (valid_sources & (1 << i))
227 irq_create_mapping(v->domain, i);
223} 228}
224 229
225static void vic_ack_irq(struct irq_data *d) 230static void vic_ack_irq(struct irq_data *d)
@@ -416,9 +421,9 @@ int __init vic_of_init(struct device_node *node, struct device_node *parent)
416 return -EIO; 421 return -EIO;
417 422
418 /* 423 /*
419 * Passing -1 as first IRQ makes the simple domain allocate descriptors 424 * Passing 0 as first IRQ makes the simple domain allocate descriptors
420 */ 425 */
421 __vic_init(regs, -1, ~0, ~0, node); 426 __vic_init(regs, 0, ~0, ~0, node);
422 427
423 return 0; 428 return 0;
424} 429}