Skip to contentSkip to conversation

Patch "MIPS: ralink: Remove ralink_halt()" has been added to the 4.9-stable tree

PATCH [email protected] 1 participant 1 message Mar 24, 2018

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

MIPS: ralink: Remove ralink_halt()

to the 4.9-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.9 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 891731f6a5dbe508d12443175a7e166a2fba616a Mon 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.

Fixes c06e836ada59 ("MIPS: ralink: adds reset code")
Cc John Crispin <[email protected]>
Cc Ralf Baechle <[email protected]>
Cc <[email protected]> # 3.9+

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 *command
 	unreachable();
 }
 
-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.9/mips-ralink-remove-ralink_halt.patch