summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorYu Chien Peter Lin <peterlin@andestech.com>2023-01-20 06:05:08 +0300
committerAnup Patel <anup@brainfault.org>2023-01-22 15:02:09 +0300
commit8ecbe6d3fba6a655b5b5d8e39381187826ac750f (patch)
tree87ca9efbec3276ee7ea1fe930e4e5b8445d5f72e /include
parentce2a834c989043895d339df4d61221eca2b428e9 (diff)
downloadopensbi-8ecbe6d3fba6a655b5b5d8e39381187826ac750f.tar.xz
lib: sbi_hsm: handle failure when hart_stop returns SBI_ENOTSUPP
Make use of generic warm-boot path when platform hart_stop callback returns SBI_ENOTSUPP, in case certain hart can not turn off its power domain, or it detects some error occured in power management unit, it can fall through warm-boot flow and wait for interrupt in sbi_hsm_hart_wait(). Also improves comment in sbi_hsm_hart_wait(). Signed-off-by: Yu Chien Peter Lin <peterlin@andestech.com> Reviewed-by: Andrew Jones <ajones@ventanamicro.com> Reviewed-by: Atish Patra <atishp@rivosinc.com> Reviewed-by: Anup Patel <anup@brainfault.org>
Diffstat (limited to 'include')
-rw-r--r--include/sbi/sbi_hsm.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/include/sbi/sbi_hsm.h b/include/sbi/sbi_hsm.h
index c2a728a..1170127 100644
--- a/include/sbi/sbi_hsm.h
+++ b/include/sbi/sbi_hsm.h
@@ -21,8 +21,12 @@ struct sbi_hsm_device {
int (*hart_start)(u32 hartid, ulong saddr);
/**
- * Stop (or power-down) the current hart from running. This call
- * doesn't expect to return if success.
+ * Stop (or power-down) the current hart from running.
+ *
+ * Return SBI_ENOTSUPP if the hart does not support platform-specific
+ * stop actions.
+ *
+ * For successful stop, the call won't return.
*/
int (*hart_stop)(void);