Commit f229006e authored by James Hogan's avatar James Hogan

irq-metag*: stop set_affinity vectoring to offline cpus

Fix irq_set_affinity callbacks in the Meta IRQ chip drivers to AND
cpu_online_mask into the cpumask when picking a CPU to vector the
interrupt to.

As Thomas pointed out, the /proc/irq/$N/smp_affinity interface doesn't
filter out offline CPUs, so without this patch if you offline CPU0 and
set an IRQ affinity to 0x3 it vectors the interrupt onto CPU0 even
though it is offline.
Reported-by: default avatarThomas Gleixner <tglx@linutronix.de>
Signed-off-by: default avatarJames Hogan <james.hogan@imgtec.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-metag@vger.kernel.org
Cc: stable@vger.kernel.org
parent e6cfc029
...@@ -515,7 +515,7 @@ static int meta_intc_set_affinity(struct irq_data *data, ...@@ -515,7 +515,7 @@ static int meta_intc_set_affinity(struct irq_data *data,
* one cpu (the interrupt code doesn't support it), so we just * one cpu (the interrupt code doesn't support it), so we just
* pick the first cpu we find in 'cpumask'. * pick the first cpu we find in 'cpumask'.
*/ */
cpu = cpumask_any(cpumask); cpu = cpumask_any_and(cpumask, cpu_online_mask);
thread = cpu_2_hwthread_id[cpu]; thread = cpu_2_hwthread_id[cpu];
metag_out32(TBI_TRIG_VEC(TBID_SIGNUM_TR2(thread)), vec_addr); metag_out32(TBI_TRIG_VEC(TBID_SIGNUM_TR2(thread)), vec_addr);
......
...@@ -201,7 +201,7 @@ static int metag_internal_irq_set_affinity(struct irq_data *data, ...@@ -201,7 +201,7 @@ static int metag_internal_irq_set_affinity(struct irq_data *data,
* one cpu (the interrupt code doesn't support it), so we just * one cpu (the interrupt code doesn't support it), so we just
* pick the first cpu we find in 'cpumask'. * pick the first cpu we find in 'cpumask'.
*/ */
cpu = cpumask_any(cpumask); cpu = cpumask_any_and(cpumask, cpu_online_mask);
thread = cpu_2_hwthread_id[cpu]; thread = cpu_2_hwthread_id[cpu];
metag_out32(TBI_TRIG_VEC(TBID_SIGNUM_TR1(thread)), metag_out32(TBI_TRIG_VEC(TBID_SIGNUM_TR1(thread)),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment