summaryrefslogtreecommitdiff
path: root/arch/xtensa/kernel
diff options
context:
space:
mode:
authorMax Filippov <jcmvbkbc@gmail.com>2023-06-07 08:59:38 -0700
committerMax Filippov <jcmvbkbc@gmail.com>2023-06-12 19:48:56 -0700
commit7561dfbf3b3451957c5d3fc52f53c78e78ed3034 (patch)
tree9888ce0b5feae5969c04ebc2aaba66dda600bc82 /arch/xtensa/kernel
parent11976fe2a47aa952b8fec54bc2bd54d57642f650 (diff)
xtensa: drop platform_halt and platform_power_off
Instead of using xtensa-specific platform_halt and platform_power_off callbacks use do_kernel_power_off in the machine_halt and machine_power_off and reimplement existing platform_halt and platform_power_off users with register_sys_off_handler. Drop platform_halt and platform_power_off declarations and default implementations. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Diffstat (limited to 'arch/xtensa/kernel')
-rw-r--r--arch/xtensa/kernel/platform.c2
-rw-r--r--arch/xtensa/kernel/setup.c14
2 files changed, 10 insertions, 6 deletions
diff --git a/arch/xtensa/kernel/platform.c b/arch/xtensa/kernel/platform.c
index 526ab744271f..29fa5d659274 100644
--- a/arch/xtensa/kernel/platform.c
+++ b/arch/xtensa/kernel/platform.c
@@ -28,8 +28,6 @@
_F(void, init, (bp_tag_t *first), { });
_F(void, setup, (char** cmd), { });
-_F(void, halt, (void), { while(1); });
-_F(void, power_off, (void), { while(1); });
_F(void, idle, (void), { __asm__ __volatile__ ("waiti 0" ::: "memory"); });
#ifdef CONFIG_XTENSA_CALIBRATE_CCOUNT
diff --git a/arch/xtensa/kernel/setup.c b/arch/xtensa/kernel/setup.c
index 8f72039335c2..5680391d7e35 100644
--- a/arch/xtensa/kernel/setup.c
+++ b/arch/xtensa/kernel/setup.c
@@ -533,14 +533,20 @@ void machine_restart(char * cmd)
void machine_halt(void)
{
- platform_halt();
- while (1);
+ local_irq_disable();
+ smp_send_stop();
+ do_kernel_power_off();
+ while (1)
+ cpu_relax();
}
void machine_power_off(void)
{
- platform_power_off();
- while (1);
+ local_irq_disable();
+ smp_send_stop();
+ do_kernel_power_off();
+ while (1)
+ cpu_relax();
}
#ifdef CONFIG_PROC_FS