arm-trusted-firmware/lib/psci
Wing Li d34886140c 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>
2023-05-31 23:54:19 -07:00
..
aarch32 fix(psci): tighten psci_power_down_wfi behaviour 2023-01-23 17:25:40 +00:00
aarch64 build(psci): move runtime_errata.S to PSCI 2023-05-03 15:36:08 +02:00
psci_common.c fix(psci): add optional pwr_domain_validate_suspend to plat_psci_ops_t 2023-05-31 23:54:19 -07:00
psci_lib.mk build(psci): move runtime_errata.S to PSCI 2023-05-03 15:36:08 +02:00
psci_main.c fix(psci): remove unreachable switch/case blocks 2023-04-04 12:39:36 +02:00
psci_mem_protect.c Sanitise includes across codebase 2019-01-04 10:43:17 +00:00
psci_off.c fix(psci): add optional pwr_domain_validate_suspend to plat_psci_ops_t 2023-05-31 23:54:19 -07:00
psci_on.c fix(psci): do not panic on illegal MPIDR 2023-05-03 17:00:31 +01:00
psci_private.h fix(psci): add optional pwr_domain_validate_suspend to plat_psci_ops_t 2023-05-31 23:54:19 -07:00
psci_setup.c feat(psci): add support for PSCI_SET_SUSPEND_MODE 2023-03-20 22:20:35 -07:00
psci_stat.c Unify type of "cpu_idx" across PSCI module. 2020-01-10 17:11:51 +00:00
psci_suspend.c fix(psci): add optional pwr_domain_validate_suspend to plat_psci_ops_t 2023-05-31 23:54:19 -07:00
psci_system_off.c Don't return error information from console_flush 2020-10-09 10:21:50 -05:00