Merge changes from topic "fix_psci_osi" into integration

* changes:
  fix(psci): fix parent_idx in psci_validate_state_coordination
  fix(psci): mask the Last in Level nibble in StateId
This commit is contained in:
Manish Pandey 2024-05-08 15:45:12 +02:00 committed by TrustedFirmware Code Review
commit dd03806122
3 changed files with 4 additions and 7 deletions
include/plat/arm/common
lib/psci
plat/arm/common

View file

@ -153,11 +153,10 @@ void arm_setup_romlib(void);
#define ARM_LOCAL_PSTATE_WIDTH 4
#define ARM_LOCAL_PSTATE_MASK ((1 << ARM_LOCAL_PSTATE_WIDTH) - 1)
#if PSCI_OS_INIT_MODE
/* Last in Level for the OS-initiated */
#define ARM_LAST_AT_PLVL_MASK (ARM_LOCAL_PSTATE_MASK << \
(ARM_LOCAL_PSTATE_WIDTH * \
(PLAT_MAX_PWR_LVL + 1)))
#endif /* __PSCI_OS_INIT_MODE__ */
/* Macros to construct the composite power state */

View file

@ -665,6 +665,8 @@ int psci_validate_state_coordination(unsigned int end_pwrlvl,
}
goto exit;
}
parent_idx = psci_non_cpu_pd_nodes[parent_idx].parent_node;
}
/*

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015-2020, ARM Limited and Contributors. All rights reserved.
* Copyright (c) 2015-2024, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@ -79,12 +79,8 @@ int arm_validate_power_state(unsigned int power_state,
* search if the number of entries justify the additional complexity.
*/
for (i = 0; !!arm_pm_idle_states[i]; i++) {
#if PSCI_OS_INIT_MODE
if ((power_state & ~ARM_LAST_AT_PLVL_MASK) ==
arm_pm_idle_states[i])
#else
if (power_state == arm_pm_idle_states[i])
#endif /* __PSCI_OS_INIT_MODE__ */
break;
}