linux/arch/riscv/kernel
Dimitri John Ledkov f2928e224d
riscv: set default pm_power_off to NULL
Set pm_power_off to NULL like on all other architectures, check if it
is set in machine_halt() and machine_power_off() and fallback to
default_power_off if no other power driver got registered.

This brings riscv architecture inline with all other architectures,
and allows to reuse exiting power drivers unmodified.

Kernels without legacy SBI v0.1 extensions (CONFIG_RISCV_SBI_V01 is
not set), do not set pm_power_off to sbi_shutdown(). There is no
support for SBI v0.3 system reset extension either. This prevents
using gpio_poweroff on SiFive HiFive Unmatched.

Tested on SiFive HiFive unmatched, with a dtb specifying gpio-poweroff
node and kernel complied without CONFIG_RISCV_SBI_V01.

BugLink: https://bugs.launchpad.net/bugs/1942806
Signed-off-by: Dimitri John Ledkov <dimitri.ledkov@canonical.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
Tested-by: Ron Economos <w6rz@comcast.net>
Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
2021-10-04 14:16:57 -07:00
..
probes riscv: kprobes: implement the branch instructions 2021-07-21 23:22:34 -07:00
vdso riscv/vdso: Add support for time namespaces 2021-10-04 14:16:43 -07:00
.gitignore
asm-offsets.c
cacheinfo.c drivers: base: cacheinfo: Get rid of DEFINE_SMP_CALL_CACHE_FUNCTION() 2021-09-01 10:29:10 +02:00
cpu-hotplug.c
cpu.c
cpu_ops.c
cpu_ops_sbi.c
cpu_ops_spinwait.c
cpufeature.c
crash_dump.c
crash_save_regs.S
efi-header.S
efi.c
entry.S
fpu.S
ftrace.c
head.h
head.S
image-vars.h
irq.c
jump_label.c
kexec_relocate.S
kgdb.c
machine_kexec.c RISC-V Patches for the 5.14 Merge Window, Part 1 2021-07-09 10:36:29 -07:00
Makefile riscv: kexec: do not add '-mno-relax' flag if compiler doesn't support it 2021-08-12 07:16:52 -07:00
mcount-dyn.S
mcount.S
module-sections.c
module.c
patch.c
perf_callchain.c
perf_event.c
perf_regs.c
process.c
ptrace.c riscv: Ensure the value of FP registers in the core dump file is up to date 2021-08-24 20:54:10 -07:00
reset.c riscv: set default pm_power_off to NULL 2021-10-04 14:16:57 -07:00
riscv_ksyms.c
sbi.c
setup.c RISC-V Patches for the 5.15 Merge Window, Part 1 2021-09-05 11:31:23 -07:00
signal.c
smp.c
smpboot.c
soc.c
stacktrace.c riscv: stacktrace: Fix NULL pointer dereference 2021-07-24 12:58:51 -07:00
sys_riscv.c
syscall_table.c riscv/vdso: Refactor asm/vdso.h 2021-10-02 13:42:23 -07:00
time.c
traps.c trap: cleanup trap_init() 2021-09-08 11:50:27 -07:00
traps_misaligned.c
vdso.c riscv/vdso: Add support for time namespaces 2021-10-04 14:16:43 -07:00
vmlinux-xip.lds.S riscv: Move EXCEPTION_TABLE to RO_DATA segment 2021-09-10 23:59:48 -07:00
vmlinux.lds.S riscv: Move EXCEPTION_TABLE to RO_DATA segment 2021-09-10 23:59:48 -07:00