[PATCH v2] arm: GIC: Do not try to register more then NR_IRQS interrupts

Russell King - ARM Linux linux at arm.linux.org.uk
Tue Nov 23 14:50:26 EST 2010


On Tue, Nov 23, 2010 at 07:45:42PM +0000, Pawel Moll wrote:
> @@ -227,46 +227,45 @@ void __init gic_dist_init(unsigned int gic_nr, void __iomem *base,
>  	/*
>  	 * Find out how many interrupts are supported.
>  	 */
> -	max_irq = readl(base + GIC_DIST_CTR) & 0x1f;
> -	max_irq = (max_irq + 1) * 32;
> -
> -	/*
> -	 * The GIC only supports up to 1020 interrupt sources.
> -	 * Limit this to either the architected maximum, or the
> -	 * platform maximum.
> -	 */
> -	if (max_irq > max(1020, NR_IRQS))
> -		max_irq = max(1020, NR_IRQS);
> +	gic_irqs = readl(base + GIC_DIST_CTR) & 0x1f;
> +	gic_irqs = (gic_irqs + 1) * 32;

I think this should still be limited to 1020 IRQs.  Note that 1020 is not
divisible by 32, so gic_irqs ends up being 1024 which is wrong.



More information about the linux-arm-kernel mailing list