]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
MIPS: ralink: Remove ralink_halt()
authorNeilBrown <neil@brown.name>
Tue, 20 Mar 2018 08:29:51 +0000 (19:29 +1100)
committerSeth Forshee <seth.forshee@canonical.com>
Wed, 28 Mar 2018 19:04:32 +0000 (14:04 -0500)
commitde0611da6f392f9dbe04eed89bdf40db013b689f
tree61a3d762ab42aec9f449b2381b578b1db9b4d13a
parentd1d8b2634cd1719edb09e070abd8923bb1bfbf34
MIPS: ralink: Remove ralink_halt()

BugLink: http://bugs.launchpad.net/bugs/1759655
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 <neil@brown.name>
Cc: John Crispin <john@phrozen.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-mips@linux-mips.org
Cc: <stable@vger.kernel.org> # 3.9+
Patchwork: https://patchwork.linux-mips.org/patch/18851/
Signed-off-by: James Hogan <jhogan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
arch/mips/ralink/reset.c