Patch "MIPS: ralink: Remove ralink_halt()" has been added to the 4.4-stable tree
Subsystems (3)
This is a note to let you know that I've just added the patch titled
MIPS: ralink: Remove ralink_halt()
to the 4.4-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
mips-ralink-remove-ralink_halt.patch
and it can be found in the queue-4.4 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From
891731f6a5dbe508d12443175a7e166a2fba616aMon Sep 17 00:00:00 2001
From: NeilBrown <[email protected]>
Date: Tue, 20 Mar 2018 19:29:51 +1100
Subject: MIPS: ralink: Remove ralink_halt()
From: NeilBrown <[email protected]>
commit 891731f6a5dbe508d12443175a7e166a2fba616a upstream.
ralink_halt() does nothing that machine_halt() doesn't already do, so it adds no value.
It actually causes incorrect behaviour due to the "unreachable()" at the end. This tells the compiler that the end of the function will never be reached, which isn't true. The compiler responds by not adding a 'return' instruction, so control simply moves on to whatever bytes come afterwards in memory. In my tested, that was the ralink_restart() function. This means that an attempt to 'halt' the machine would actually cause a reboot.
So remove ralink_halt() so that a 'halt' really does halt.
Patchwork: https://patchwork.linux-mips.org/patch/18851/
--- arch/mips/ralink/reset.c | 7 ------- 1 file changed, 7 deletions(-)
arch/mips/ralink/reset.c +0 -7
@@ -96,16 +96,9 @@ static void ralink_restart(char *commandunreachable (); } -static void ralink_halt (void ) -{ -local_irq_disable (); -unreachable (); -} -static int __init mips_reboot_setup (void ) { _machine_restart = ralink_restart; - _machine_halt = ralink_halt;return 0 ; }
Patches currently in stable-queue which might be from [email protected] are
queue-4.4/mips-ralink-remove-ralink_halt.patch