Skip to content

Commit fe41db7

Browse files
wildea01Russell King
authored andcommitted
ARM: 7177/1: GIC: avoid skipping non-existent PPIs in irq_start calculation
Commit 4294f8b ("ARM: gic: add irq_domain support") defines irq_start as irq_start = (irq_start & ~31) + 16; On a platform with a GIC and a CPU without PPIs, this results in irq_start being off by 16. This patch fixes gic_init so that we only carve out a PPI space when PPIs exist for the GIC being initialised. Cc: Rob Herring <[email protected]> Signed-off-by: Will Deacon <[email protected]> Signed-off-by: Russell King <[email protected]>
1 parent abdd7b9 commit fe41db7

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

arch/arm/common/gic.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -582,13 +582,16 @@ void __init gic_init(unsigned int gic_nr, int irq_start,
582582
* For primary GICs, skip over SGIs.
583583
* For secondary GICs, skip over PPIs, too.
584584
*/
585+
domain->hwirq_base = 32;
585586
if (gic_nr == 0) {
586587
gic_cpu_base_addr = cpu_base;
587-
domain->hwirq_base = 16;
588-
if (irq_start > 0)
589-
irq_start = (irq_start & ~31) + 16;
590-
} else
591-
domain->hwirq_base = 32;
588+
589+
if ((irq_start & 31) > 0) {
590+
domain->hwirq_base = 16;
591+
if (irq_start != -1)
592+
irq_start = (irq_start & ~31) + 16;
593+
}
594+
}
592595

593596
/*
594597
* Find out how many interrupts are supported.

0 commit comments

Comments
 (0)