Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ARM: irq migration: update GIC migration code

This cleans up after the conversion to irq_data. Rename the function
to match the method, and remove the now useless lookup of the irq
descriptor which is never used. Move the bitmask calculation out of
the irq_controller_lock region.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>

+12 -13
+12 -13
arch/arm/common/gic.c
··· 142 142 } 143 143 144 144 #ifdef CONFIG_SMP 145 - static int 146 - gic_set_cpu(struct irq_data *d, const struct cpumask *mask_val, bool force) 145 + static int gic_set_affinity(struct irq_data *d, const struct cpumask *mask_val, 146 + bool force) 147 147 { 148 148 void __iomem *reg = gic_dist_base(d) + GIC_DIST_TARGET + (gic_irq(d) & ~3); 149 149 unsigned int shift = (d->irq % 4) * 8; 150 150 unsigned int cpu = cpumask_first(mask_val); 151 - u32 val; 152 - struct irq_desc *desc; 151 + u32 val, mask, bit; 152 + 153 + if (cpu >= 8) 154 + return -EINVAL; 155 + 156 + mask = 0xff << shift; 157 + bit = 1 << (cpu + shift); 153 158 154 159 spin_lock(&irq_controller_lock); 155 - desc = irq_to_desc(d->irq); 156 - if (desc == NULL) { 157 - spin_unlock(&irq_controller_lock); 158 - return -EINVAL; 159 - } 160 160 d->node = cpu; 161 - val = readl(reg) & ~(0xff << shift); 162 - val |= 1 << (cpu + shift); 163 - writel(val, reg); 161 + val = readl(reg) & ~mask; 162 + writel(val | bit, reg); 164 163 spin_unlock(&irq_controller_lock); 165 164 166 165 return 0; ··· 202 203 .irq_unmask = gic_unmask_irq, 203 204 .irq_set_type = gic_set_type, 204 205 #ifdef CONFIG_SMP 205 - .irq_set_affinity = gic_set_cpu, 206 + .irq_set_affinity = gic_set_affinity, 206 207 #endif 207 208 }; 208 209