From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161539AbaDPOgf (ORCPT ); Wed, 16 Apr 2014 10:36:35 -0400 Received: from www.linutronix.de ([62.245.132.108]:39619 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1161485AbaDPOgb (ORCPT ); Wed, 16 Apr 2014 10:36:31 -0400 Message-Id: <20140416143315.916984416@linutronix.de> User-Agent: quilt/0.60-1 Date: Wed, 16 Apr 2014 14:36:44 -0000 From: Thomas Gleixner To: LKML Cc: Krzysztof Kozlowski Cc: Kyungmin Park Cc: Marek Szyprowski Cc: Bartlomiej Zolnierkiewicz Cc: Tomasz Figa Cc: Daniel Lezcano Cc: Kukjin Kim Cc: linux-arm-kernel@lists.infradead.org Cc: stable@vger.kernel.org Subject: [patch 2/4] irqchip: gic: Support forced affinity setting References: <20140416142106.537575971@linutronix.de> Content-Disposition: inline; filename=irqchip-gic-allow-force-affinity.patch X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/irqchip/irq-gic.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) Index: tip/drivers/irqchip/irq-gic.c =================================================================== --- tip.orig/drivers/irqchip/irq-gic.c +++ tip/drivers/irqchip/irq-gic.c @@ -246,10 +246,14 @@ static int gic_set_affinity(struct irq_d 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;