diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2012-12-26 01:39:16 +0100 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2013-01-02 10:35:07 +0000 |
commit | 5ced33bc06e7e76cb8a236f15bff49eb6155b618 (patch) | |
tree | a82224b7e5350ceb6c6c184ec2aa1af690d1d6e5 | |
parent | f5565295892eb93c3191aa241405fe8b685542d6 (diff) | |
download | kernel_goldelico_gta04-5ced33bc06e7e76cb8a236f15bff49eb6155b618.zip kernel_goldelico_gta04-5ced33bc06e7e76cb8a236f15bff49eb6155b618.tar.gz kernel_goldelico_gta04-5ced33bc06e7e76cb8a236f15bff49eb6155b618.tar.bz2 |
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.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/arch/arm/common/vic.c b/arch/arm/common/vic.c index e4df17c..8f324b9 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, struct device_node *node) { struct vic_device *v; + int i; if (vic_id >= ARRAY_SIZE(vic_devices)) { 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, vic_id++; v->domain = irq_domain_add_simple(node, fls(valid_sources), irq, &vic_irqdomain_ops, v); + /* create an IRQ mapping for each valid IRQ */ + for (i = 0; i < fls(valid_sources); i++) + if (valid_sources & (1 << i)) + irq_create_mapping(v->domain, i); } static 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) return -EIO; /* - * Passing -1 as first IRQ makes the simple domain allocate descriptors + * Passing 0 as first IRQ makes the simple domain allocate descriptors */ - __vic_init(regs, -1, ~0, ~0, node); + __vic_init(regs, 0, ~0, ~0, node); return 0; } |