mirror of
https://github.com/Fishwaldo/opensbi.git
synced 2025-06-26 08:08:54 +00:00
lib: sbi_hsm: Don't try to restore state on failed change
When a state change fails there's no need to restore the original state as it remains the same. Signed-off-by: Andrew Jones <ajones@ventanamicro.com> Reviewed-by: Anup Patel <anup@brainfault.org>
This commit is contained in:
parent
1364d5adb2
commit
40f16a81d3
1 changed files with 2 additions and 5 deletions
|
@ -428,10 +428,8 @@ int sbi_hsm_hart_suspend(struct sbi_scratch *scratch, u32 suspend_type,
|
||||||
|
|
||||||
/* Directly move from STARTED to SUSPENDED state */
|
/* Directly move from STARTED to SUSPENDED state */
|
||||||
if (!__sbi_hsm_hart_change_state(hdata, SBI_HSM_STATE_STARTED,
|
if (!__sbi_hsm_hart_change_state(hdata, SBI_HSM_STATE_STARTED,
|
||||||
SBI_HSM_STATE_SUSPENDED)) {
|
SBI_HSM_STATE_SUSPENDED))
|
||||||
ret = SBI_EDENIED;
|
return SBI_EDENIED;
|
||||||
goto fail_restore_state;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Save the suspend type */
|
/* Save the suspend type */
|
||||||
hdata->suspend_type = suspend_type;
|
hdata->suspend_type = suspend_type;
|
||||||
|
@ -466,7 +464,6 @@ int sbi_hsm_hart_suspend(struct sbi_scratch *scratch, u32 suspend_type,
|
||||||
jump_warmboot();
|
jump_warmboot();
|
||||||
}
|
}
|
||||||
|
|
||||||
fail_restore_state:
|
|
||||||
/*
|
/*
|
||||||
* We might have successfully resumed from retentive suspend
|
* We might have successfully resumed from retentive suspend
|
||||||
* or suspend failed. In both cases, we restore state of hart.
|
* or suspend failed. In both cases, we restore state of hart.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue