Re: [PATCH 1/2] MIPS: OCTEON: fix kernel crash when offlining a CPU

From: David Daney
Date: Thu Jan 15 2015 - 14:36:22 EST


On 01/15/2015 10:49 AM, Aaro Koskinen wrote:
octeon_cpu_disable() will unconditionally enable interrupts when called
with interrupts disabled. Fix that.

interrupts are always disabled here, so...

[...]

Reported-by: Hemmo Nieminen <hemmo.nieminen@xxxxxx>
Signed-off-by: Aaro Koskinen <aaro.koskinen@xxxxxx>
Cc: stable@xxxxxxxxxxxxxxx

NACK!

---
arch/mips/cavium-octeon/smp.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/mips/cavium-octeon/smp.c b/arch/mips/cavium-octeon/smp.c
index ecd903d..9673c5b 100644
--- a/arch/mips/cavium-octeon/smp.c
+++ b/arch/mips/cavium-octeon/smp.c
@@ -231,6 +231,7 @@ DEFINE_PER_CPU(int, cpu_state);
static int octeon_cpu_disable(void)
{
unsigned int cpu = smp_processor_id();
+ unsigned long flags;

if (cpu == 0)
return -EBUSY;
@@ -240,9 +241,9 @@ static int octeon_cpu_disable(void)

set_cpu_online(cpu, false);
cpu_clear(cpu, cpu_callin_map);
- local_irq_disable();
+ local_irq_save(flags);

Just remove this...

octeon_fixup_irqs();
- local_irq_enable();
+ local_irq_restore(flags);

... and this.


flush_cache_all();
local_flush_tlb_all();


You can add an Acked-by me if you do that.

David Daney.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/