summaryrefslogtreecommitdiff
path: root/arch/arm/common/gic.c
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2011-07-25 17:22:29 +0900
committerPaul Mundt <lethal@linux-sh.org>2011-07-25 17:22:29 +0900
commitb79b3e05b1229d5b2fc2af71dc29701642577eba (patch)
treebcdf728ccfab02d66e129cacaa106bf8cc60f2d6 /arch/arm/common/gic.c
parentb8e513a2ecafb5bb068c00be98d584871afcd4c3 (diff)
parentc5ad48f3117c4aae379b536f3270fc1efae945c0 (diff)
Merge branch 'rmobile/sdio' into rmobile-latest
Diffstat (limited to 'arch/arm/common/gic.c')
-rw-r--r--arch/arm/common/gic.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/arch/arm/common/gic.c b/arch/arm/common/gic.c
index 4ddd0a6ac7ff..7bdd91766d65 100644
--- a/arch/arm/common/gic.c
+++ b/arch/arm/common/gic.c
@@ -179,22 +179,21 @@ static int gic_set_affinity(struct irq_data *d, const struct cpumask *mask_val,
{
void __iomem *reg = gic_dist_base(d) + GIC_DIST_TARGET + (gic_irq(d) & ~3);
unsigned int shift = (d->irq % 4) * 8;
- unsigned int cpu = cpumask_first(mask_val);
+ unsigned int cpu = cpumask_any_and(mask_val, cpu_online_mask);
u32 val, mask, bit;
- if (cpu >= 8)
+ if (cpu >= 8 || cpu >= nr_cpu_ids)
return -EINVAL;
mask = 0xff << shift;
bit = 1 << (cpu + shift);
spin_lock(&irq_controller_lock);
- d->node = cpu;
val = readl_relaxed(reg) & ~mask;
writel_relaxed(val | bit, reg);
spin_unlock(&irq_controller_lock);
- return 0;
+ return IRQ_SET_MASK_OK;
}
#endif