From: Chao Xie Date: Mon, 6 Dec 2010 06:01:10 +0000 (+0100) Subject: ARM: 6524/1: GIC irq desciptor bug fix X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=87507500b7fc3620e467abb617a3452f0cccc72d;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git ARM: 6524/1: GIC irq desciptor bug fix gic_set_cpu will directly use irq_desc[]. If CONFIG_SPARSE_IRQ is enabled, there is no irq_desc[]. So we need use irq_to_desc(irq) to get the descriptor for irq. Signed-off-by: Chao Xie Acked-by: Kyungmin Park Signed-off-by: Russell King --- diff --git a/arch/arm/common/gic.c b/arch/arm/common/gic.c index fea1bd7249b..e6388dcd8cf 100644 --- a/arch/arm/common/gic.c +++ b/arch/arm/common/gic.c @@ -146,9 +146,15 @@ static int gic_set_cpu(unsigned int irq, const struct cpumask *mask_val) unsigned int shift = (irq % 4) * 8; unsigned int cpu = cpumask_first(mask_val); u32 val; + struct irq_desc *desc; spin_lock(&irq_controller_lock); - irq_desc[irq].node = cpu; + desc = irq_to_desc(irq); + if (desc == NULL) { + spin_unlock(&irq_controller_lock); + return -EINVAL; + } + desc->node = cpu; val = readl(reg) & ~(0xff << shift); val |= 1 << (cpu + shift); writel(val, reg);