summaryrefslogtreecommitdiff
path: root/arch/mips/kernel/reset.c
AgeCommit message (Collapse)Author
2018-03-09MIPS: Hang more efficiently on halt/powerdown/restartPaul Burton
The generic MIPS implementations of halting, powering down or restarting the system all hang using a busy loop as a last resort. We have many platforms which avoid this loop by implementing their own, many using some variation upon executing a wait instruction to lower CPU power usage if we reach this point. In order to prepare for cleaning up these various custom implementations of the same thing, this patch makes the generic machine_halt(), machine_power_off() & machine_restart() functions each make use of the wait instruction to lower CPU power usage in cases where we know that the wait instruction is available. If wait isn't known to be supported then we fall back to calling cpu_wait(), and if we don't have a cpu_wait() callback then we effectively continue using a busy loop. In effect the new machine_hang() function provides a superset of the functionality that the various platforms currently provide differing subsets of. Signed-off-by: Paul Burton <paul.burton@mips.com> Cc: Ralf Baechle <ralf@linux-mips.org> Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/17178/ Signed-off-by: James Hogan <jhogan@kernel.org>
2015-04-01MIPS: Provide fallback reboot/poweroff/halt implementationsAndrew Bresticker
If a machine-specific hook is not implemented for restart, poweroff, or halt, fall back to halting secondary CPUs, disabling interrupts, and spinning. In the case of restart, attempt to restart the system via do_kernel_restart() (which will call any registered restart handlers) before halting. Signed-off-by: Andrew Bresticker <abrestic@chromium.org> Cc: James Hogan <james.hogan@imgtec.com> Cc: Maciej W. Rozycki <macro@linux-mips.org> Cc: linux-mips@linux-mips.org Cc: linux-kernel@vger.kernel.org Patchwork: https://patchwork.linux-mips.org/patch/9600/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2011-10-31mips: migrate core kernel file from module.h --> export.hPaul Gortmaker
These files are not modules, but were including module.h only for EXPORT_SYMBOL and/or THIS_MODULE. Now that we have the lightweight export.h, use it in these kinds of cases. Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2006-12-10[MIPS] Export pm_power_offRalf Baechle
This is required for ipmi_poweroff.c to work as a module. Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2006-02-07[MIPS] Rename _machine_power_off to pm_power_off so the kernel builds again.Ralf Baechle
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2006-02-07[MIPS] Check function pointers are non-zero before calling.Ralf Baechle
Several boards don't initialize the pointers, so let's play safe. Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2006-02-07[MIPS] Revert "mips: add pm_power_off"Ralf Baechle
pm_power_off duplicates the functionality of _machine_restart. This reverts b142159fa5ffbad73b6927fafa5440148030f3f1 commit.
2006-01-16[PATCH] mips: add pm_power_offYoichi Yuasa
Adds pm_power_off() to MIPS. Signed-off-by: Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> Cc: Ralf Baechle <ralf@linux-mips.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-07-26[PATCH] Don't export machine_restart, machine_halt, or machine_power_off.Eric W. Biederman
machine_restart, machine_halt and machine_power_off are machine specific hooks deep into the reboot logic, that modules have no business messing with. Usually code should be calling kernel_restart, kernel_halt, kernel_power_off, or emergency_restart. So don't export machine_restart, machine_halt, and machine_power_off so we can catch buggy users. Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-04-16Linux-2.6.12-rc2Linus Torvalds
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!