All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] irqchip: gic: Allow setting affinity to offline CPUs
@ 2013-08-20 16:11 ` Tomasz Figa
  0 siblings, 0 replies; 18+ messages in thread
From: Tomasz Figa @ 2013-08-20 16:11 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: linux-samsung-soc, Thomas Gleixner, Stephen Boyd, Tomasz Figa,
	Kyungmin Park

Sometimes it is necessary to fix interrupt affinity to an offline CPU,
for example in initialization of local timers. This patch modifies
.set_affinity() operation of irq-gic driver to fall back to any possible
CPU if no online CPU can be found in requested CPU mask.

This fixes broken Exynos4210 support since commit
	ee98d27df6 ARM: EXYNOS4: Divorce mct from local timer API
caused by timer initialization code unable to set affinity for local
timer interrupts.

Signed-off-by: Tomasz Figa <t.figa@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
 drivers/irqchip/irq-gic.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c
index ee7c503..5f0797e 100644
--- a/drivers/irqchip/irq-gic.c
+++ b/drivers/irqchip/irq-gic.c
@@ -250,6 +250,15 @@ static int gic_set_affinity(struct irq_data *d, const struct cpumask *mask_val,
 	unsigned int cpu = cpumask_any_and(mask_val, cpu_online_mask);
 	u32 val, mask, bit;
 
+	/*
+	 * If no online CPU could be found, fall back to any possible CPU.
+	 *
+	 * This is to allow setting affinity of some interrupts to a CPU
+	 * before it is marked as online, i.e. local timer initialization.
+	 */
+	if (cpu >= nr_cpu_ids)
+		cpu = cpumask_any_and(mask_val, cpu_possible_mask);
+
 	if (cpu >= NR_GIC_CPU_IF || cpu >= nr_cpu_ids)
 		return -EINVAL;
 
-- 
1.8.3.2

^ permalink raw reply related	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2013-08-21 12:23 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-20 16:11 [PATCH] irqchip: gic: Allow setting affinity to offline CPUs Tomasz Figa
2013-08-20 16:11 ` Tomasz Figa
2013-08-20 16:33 ` Stephen Boyd
2013-08-20 16:33   ` Stephen Boyd
2013-08-20 16:41   ` Tomasz Figa
2013-08-20 16:41     ` Tomasz Figa
2013-08-20 16:48     ` Stephen Boyd
2013-08-20 16:48       ` Stephen Boyd
2013-08-20 16:57       ` Tomasz Figa
2013-08-20 16:57         ` Tomasz Figa
2013-08-20 21:14 ` Russell King - ARM Linux
2013-08-20 21:14   ` Russell King - ARM Linux
2013-08-20 22:11   ` Tomasz Figa
2013-08-20 22:11     ` Tomasz Figa
2013-08-20 22:39     ` Stephen Boyd
2013-08-20 22:39       ` Stephen Boyd
2013-08-21 12:23       ` Tomasz Figa
2013-08-21 12:23         ` Tomasz Figa

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.