lkml.org 
[lkml]   [2014]   [Mar]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[patch 2/5] mips: Validate online cpus in irq_set_affinity() callbacks
The [user space] interface does not filter out offline cpus. It merily
guarantees that the mask contains at least one online cpu.

So the selector in the irq chip implementation needs to make sure to
pick only an online cpu because otherwise:

Offline Core 1
Set affinity to 0xe (is valid due to online mask 0xd)
cpumask_first will pick core 1, which is offline

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-mips@linux-mips.org
---
arch/mips/sibyte/bcm1480/irq.c | 2 +-
arch/mips/sibyte/sb1250/irq.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

Index: tip/arch/mips/sibyte/bcm1480/irq.c
===================================================================
--- tip.orig/arch/mips/sibyte/bcm1480/irq.c
+++ tip/arch/mips/sibyte/bcm1480/irq.c
@@ -95,7 +95,7 @@ static int bcm1480_set_affinity(struct i
u64 cur_ints;
unsigned long flags;

- i = cpumask_first(mask);
+ i = cpumask_first_and(mask< cpu_online_mask);

/* Convert logical CPU to physical CPU */
cpu = cpu_logical_map(i);
Index: tip/arch/mips/sibyte/sb1250/irq.c
===================================================================
--- tip.orig/arch/mips/sibyte/sb1250/irq.c
+++ tip/arch/mips/sibyte/sb1250/irq.c
@@ -88,7 +88,7 @@ static int sb1250_set_affinity(struct ir
u64 cur_ints;
unsigned long flags;

- i = cpumask_first(mask);
+ i = cpumask_first_and(mask< cpu_online_mask);

/* Convert logical CPU to physical CPU */
cpu = cpu_logical_map(i);



\
 
 \ /
  Last update: 2014-03-04 22:21    [W:0.172 / U:0.084 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site