mips/cpu: Make sure play_dead() doesn't return
authorJosh Poimboeuf <jpoimboe@kernel.org>
Tue, 14 Feb 2023 07:05:44 +0000 (23:05 -0800)
committerJosh Poimboeuf <jpoimboe@kernel.org>
Wed, 8 Mar 2023 16:44:23 +0000 (08:44 -0800)
play_dead() doesn't return.  Make that more explicit with a BUG().

BUG() is preferable to unreachable() because BUG() is a more explicit
failure mode and avoids undefined behavior like falling off the edge of
the function into whatever code happens to be next.

Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Link: https://lore.kernel.org/r/b195e4da190bb06b7d4af15d66ce6129e2347630.1676358308.git.jpoimboe@kernel.org
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
arch/mips/kernel/smp-bmips.c
arch/mips/loongson64/smp.c

index 51d5dae1d2f050862f70577937a9dc7fc8555705..15466d4cf4a0e567256bb37afde1546ec46fb243 100644 (file)
@@ -415,6 +415,8 @@ void __ref play_dead(void)
        "       wait\n"
        "       j       bmips_secondary_reentry\n"
        : : : "memory");
+
+       BUG();
 }
 
 #endif /* CONFIG_HOTPLUG_CPU */
index 4e24b317e7cbbb9d087f428f3d4763830c0f30db..df8d789ede3c3278476b7e2b7a785b0900cb8b01 100644 (file)
@@ -823,6 +823,7 @@ out:
        state_addr = &per_cpu(cpu_state, cpu);
        mb();
        play_dead_at_ckseg1(state_addr);
+       BUG();
 }
 
 static int loongson3_disable_clock(unsigned int cpu)