mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-05-08 10:08:47 +00:00
PSCI: Lookup list of parent nodes to lock only once
When acquiring or releasing the power domain locks for a given CPU the parent nodes are looked up by walking the up the PD tree list on both the acquire and release path, only one set of lookups is needed. Fetch the parent nodes first and pass this list into both the acquire and release functions to avoid the double lookup. This also allows us to not have to do this lookup after coherency has been exited during the core power down sequence. The shared struct psci_cpu_pd_nodes is not placed in coherent memory like is done for psci_non_cpu_pd_nodes and doing so would negatively affect performance. With this patch we remove the need to have it in coherent memory by moving the access out of psci_release_pwr_domain_locks(). Signed-off-by: Andrew F. Davis <afd@ti.com> Change-Id: I7b9cfa9d31148dea0f5e21091c8b45ef7fe4c4ab
This commit is contained in:
parent
0f95565c40
commit
74d27d0062
4 changed files with 49 additions and 28 deletions
|
@ -45,6 +45,7 @@ int psci_do_cpu_off(unsigned int end_pwrlvl)
|
|||
int rc = PSCI_E_SUCCESS;
|
||||
int idx = (int) plat_my_core_pos();
|
||||
psci_power_state_t state_info;
|
||||
unsigned int parent_nodes[PLAT_MAX_PWR_LVL] = {0};
|
||||
|
||||
/*
|
||||
* This function must only be called on platforms where the
|
||||
|
@ -55,12 +56,21 @@ int psci_do_cpu_off(unsigned int end_pwrlvl)
|
|||
/* Construct the psci_power_state for CPU_OFF */
|
||||
psci_set_power_off_state(&state_info);
|
||||
|
||||
/*
|
||||
* Get the parent nodes here, this is important to do before we
|
||||
* initiate the power down sequence as after that point the core may
|
||||
* have exited coherency and its cache may be disabled, any access to
|
||||
* shared memory after that (such as the parent node lookup in
|
||||
* psci_cpu_pd_nodes) can cause coherency issues on some platforms.
|
||||
*/
|
||||
psci_get_parent_pwr_domain_nodes(idx, end_pwrlvl, parent_nodes);
|
||||
|
||||
/*
|
||||
* This function acquires the lock corresponding to each power
|
||||
* level so that by the time all locks are taken, the system topology
|
||||
* is snapshot and state management can be done safely.
|
||||
*/
|
||||
psci_acquire_pwr_domain_locks(end_pwrlvl, idx);
|
||||
psci_acquire_pwr_domain_locks(end_pwrlvl, parent_nodes);
|
||||
|
||||
/*
|
||||
* Call the cpu off handler registered by the Secure Payload Dispatcher
|
||||
|
@ -122,7 +132,7 @@ exit:
|
|||
* Release the locks corresponding to each power level in the
|
||||
* reverse order to which they were acquired.
|
||||
*/
|
||||
psci_release_pwr_domain_locks(end_pwrlvl, idx);
|
||||
psci_release_pwr_domain_locks(end_pwrlvl, parent_nodes);
|
||||
|
||||
/*
|
||||
* Check if all actions needed to safely power down this cpu have
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue