lib: sbi: Update system suspend to spec
authorAndrew Jones <ajones@ventanamicro.com>
Thu, 20 Jul 2023 15:48:37 +0000 (17:48 +0200)
committerAnup Patel <anup@brainfault.org>
Mon, 31 Jul 2023 06:15:11 +0000 (11:45 +0530)
commit 68e66106120f ("SUSP: Add SBI_ERR_DENIED") of the SBI spec adds
a new error code, SBI_ERR_DENIED, which is returned when entry criteria
has not be meant. Update the system suspend implementation to return
this error when it has detected that not all harts are in the STOPPED
state.

Signed-off-by: Andrew Jones <ajones@ventanamicro.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
lib/sbi/sbi_system.c

index d803ffa8418984f9d1f37813f2bc7b3c77be451b..2e917c9e9130e714c40a6fc82968e89a061ea0c3 100644 (file)
@@ -174,7 +174,7 @@ int sbi_system_suspend(u32 sleep_type, ulong resume_addr, ulong opaque)
                if (i == hartid)
                        continue;
                if (__sbi_hsm_hart_get_state(i) != SBI_HSM_STATE_STOPPED)
-                       return SBI_EFAIL;
+                       return SBI_ERR_DENIED;
        }
 
        if (!sbi_domain_check_addr(dom, resume_addr, prev_mode,