summaryrefslogtreecommitdiff
path: root/drivers/irqchip
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2013-04-18 21:57:26 (GMT)
committerArnd Bergmann <arnd@arndb.de>2013-04-19 21:00:43 (GMT)
commit20adee8fa06ef69012bc277739e9e3762c78b7b7 (patch)
tree2dc5d7ca8c7b460eef5d6d7d4609203cf5615fc1 /drivers/irqchip
parent863a08dc8bc7ce32ecc9136671610a93a0dd68b1 (diff)
downloadlinux-fsl-qoriq-20adee8fa06ef69012bc277739e9e3762c78b7b7.tar.xz
irqchip: exynos: look up irq using irq_find_mapping
Since we want to move to using the linear IRQ domain in the future, we cannot rely on the irq numbers to be contiguous and need to look up the irq from the hwirq using the domain. This also turns the bogus comparison with NR_IRQ into a more meaningful check to see if the number has a valid mapping. Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'drivers/irqchip')
-rw-r--r--drivers/irqchip/exynos-combiner.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/irqchip/exynos-combiner.c b/drivers/irqchip/exynos-combiner.c
index 6855c92..494c2e2 100644
--- a/drivers/irqchip/exynos-combiner.c
+++ b/drivers/irqchip/exynos-combiner.c
@@ -33,7 +33,7 @@
static DEFINE_SPINLOCK(irq_controller_lock);
struct combiner_chip_data {
- unsigned int irq_offset;
+ unsigned int hwirq_offset;
unsigned int irq_mask;
void __iomem *base;
unsigned int parent_irq;
@@ -80,11 +80,11 @@ static void combiner_handle_cascade_irq(unsigned int irq, struct irq_desc *desc)
if (status == 0)
goto out;
- combiner_irq = __ffs(status);
+ combiner_irq = chip_data->hwirq_offset + __ffs(status);
+ cascade_irq = irq_find_mapping(combiner_irq_domain, combiner_irq);
- cascade_irq = combiner_irq + (chip_data->irq_offset & ~31);
- if (unlikely(cascade_irq >= NR_IRQS))
- do_bad_IRQ(cascade_irq, desc);
+ if (unlikely(!cascade_irq))
+ do_bad_IRQ(irq, desc);
else
generic_handle_irq(cascade_irq);
@@ -129,8 +129,7 @@ static void __init combiner_init_one(struct combiner_chip_data *combiner_data,
void __iomem *base, unsigned int irq)
{
combiner_data->base = base;
- combiner_data->irq_offset = irq_find_mapping(
- combiner_irq_domain, combiner_nr * IRQ_IN_COMBINER);
+ combiner_data->hwirq_offset = (combiner_nr & ~3) * IRQ_IN_COMBINER;
combiner_data->irq_mask = 0xff << ((combiner_nr % 4) << 3);
combiner_data->parent_irq = irq;