[lkml]   [2018]   [Mar]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH 4.4 01/43] MIPS: ralink: Remove ralink_halt()
4.4-stable review patch.  If anyone has any objections, please let me know.


From: NeilBrown <>

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")
Signed-off-by: NeilBrown <>
Cc: John Crispin <>
Cc: Ralf Baechle <>
Cc: <> # 3.9+
Signed-off-by: James Hogan <>
Signed-off-by: Greg Kroah-Hartman <>

arch/mips/ralink/reset.c | 7 -------
1 file changed, 7 deletions(-)

--- a/arch/mips/ralink/reset.c
+++ b/arch/mips/ralink/reset.c
@@ -96,16 +96,9 @@ static void ralink_restart(char *command

-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;

 \ /
  Last update: 2018-03-27 18:29    [W:0.230 / U:2.620 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site