summaryrefslogtreecommitdiff
path: root/lib/psci/psci_private.h
diff options
context:
space:
mode:
authorWing Li <wingers@google.com>2023-05-04 08:31:19 -0700
committerWing Li <wingers@google.com>2023-05-31 23:54:19 -0700
commitd34886140c74c0afc48ab20e63523505fcfb4b7d (patch)
treedf15b6e75c7b94ea96b7840fa654229350412fe3 /lib/psci/psci_private.h
parenta43be0f61003df1d8cf01bd706d5af305428c022 (diff)
fix(psci): add optional pwr_domain_validate_suspend to plat_psci_ops_t
This patch adds a new optional member `pwr_domain_validate_suspend` to the `plat_psci_ops_t` structure that allows a platform to optionally perform platform specific validations in OS-initiated mode. This is conditionally compiled into the build depending on the value of the `PSCI_OS_INIT_MODE` build option. In https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/17682, the return type of the `pwr_domain_suspend` handler was updated from `void` to `int` to allow a platform to optionally perform platform specific validations in OS-initiated mode. However, when an error code other than `PSCI_E_SUCCESS` is returned, the current exit path does not undo the operations in `psci_suspend_to_pwrdown_start`, and as a result, the system ends up in an unexpected state. The fix in this patch prevents the need to undo the operations in `psci_suspend_to_pwrdown_start`, by allowing the platform to first perform any necessary platform specific validations before the PSCI generic code proceeds to the point of no return where the CPU_SUSPEND request is expected to complete successfully. Change-Id: I05d92c7ea3f5364da09af630d44d78252185db20 Signed-off-by: Wing Li <wingers@google.com>
Diffstat (limited to 'lib/psci/psci_private.h')
-rw-r--r--lib/psci/psci_private.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/psci/psci_private.h b/lib/psci/psci_private.h
index b9987fe65..04f93bd08 100644
--- a/lib/psci/psci_private.h
+++ b/lib/psci/psci_private.h
@@ -298,6 +298,8 @@ void psci_restore_req_local_pwr_states(unsigned int cpu_idx,
#endif
void psci_get_target_local_pwr_states(unsigned int end_pwrlvl,
psci_power_state_t *target_state);
+void psci_set_target_local_pwr_states(unsigned int end_pwrlvl,
+ const psci_power_state_t *target_state);
int psci_validate_entry_point(entry_point_info_t *ep,
uintptr_t entrypoint, u_register_t context_id);
void psci_get_parent_pwr_domain_nodes(unsigned int cpu_idx,