From mboxrd@z Thu Jan 1 00:00:00 1970 From: jslaby@suse.cz (Jiri Slaby) Date: Fri, 6 Jun 2014 14:49:19 +0200 Subject: [patch added to the 3.12 stable tree] irqchip: Gic: Support forced affinity setting In-Reply-To: <1402059090-31277-1-git-send-email-jslaby@suse.cz> References: <1402059090-31277-1-git-send-email-jslaby@suse.cz> Message-ID: <1402059090-31277-15-git-send-email-jslaby@suse.cz> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org From: Thomas Gleixner This patch has been added to the 3.12 stable tree. If you have any objections, please let us know. =============== commit ffde1de64012c406dfdda8690918248b472f24e4 upstream. To support the affinity setting of per cpu timers in the early startup of a not yet online cpu, implement the force logic, which disables the cpu online check. Tagged for stable to allow a simple fix of the affected SoC clock event drivers. Signed-off-by: Thomas Gleixner Tested-by: Krzysztof Kozlowski Cc: Kyungmin Park Cc: Marek Szyprowski Cc: Bartlomiej Zolnierkiewicz Cc: Tomasz Figa , Cc: Daniel Lezcano , Cc: Kukjin Kim Cc: linux-arm-kernel at lists.infradead.org, Link: http://lkml.kernel.org/r/20140416143315.916984416 at linutronix.de Signed-off-by: Thomas Gleixner Signed-off-by: Jiri Slaby --- drivers/irqchip/irq-gic.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c index d0e948084eaf..86df97f6fd27 100644 --- a/drivers/irqchip/irq-gic.c +++ b/drivers/irqchip/irq-gic.c @@ -246,10 +246,14 @@ static int gic_set_affinity(struct irq_data *d, const struct cpumask *mask_val, bool force) { void __iomem *reg = gic_dist_base(d) + GIC_DIST_TARGET + (gic_irq(d) & ~3); - unsigned int shift = (gic_irq(d) % 4) * 8; - unsigned int cpu = cpumask_any_and(mask_val, cpu_online_mask); + unsigned int cpu, shift = (gic_irq(d) % 4) * 8; u32 val, mask, bit; + if (!force) + cpu = cpumask_any_and(mask_val, cpu_online_mask); + else + cpu = cpumask_first(mask_val); + if (cpu >= NR_GIC_CPU_IF || cpu >= nr_cpu_ids) return -EINVAL; -- 1.9.3