Searched hist:b34be5df710fd65d609dc2aafcfbd1f3b9132888 (Results 1 – 1 of 1) sorted by relevance
| /rk3399_ARM-atf/lib/psci/ |
| H A D | psci_main.c | b34be5df710fd65d609dc2aafcfbd1f3b9132888 Thu Apr 10 09:24:47 UTC 2025 Boyan Karatotev <boyan.karatotev@arm.com> fix(psci): do not modify higher levels for standby in OSI mode
The OSI mode for the CPU standby fast path updates the requested power states incorrectly. psci_update_req_local_pwr_states() will not bother saving level 0. It will also clamp the level it accesses to the end_pwrlvl argument. Well, in the fast path, this argument is always 0 (as a condition of entering the fast path). The result is that it reads the level 0 power state (retention) and writes it to the level 1 power state, even though by definition, the fast path will not update higher power levels.
The fix is to pass PLAT_MAX_PWR_LVL instead of target_pwrlvl to psci_update_req_local_pwr_states(). However, doing that makes it apparent that this call will not change anything and therefore there is nothing to save - the level 0 power state is written by psci_set_cpu_local_state(). So the save + restore are redundant. Remove them to save on a bunch of work.
Another thing that is not considered is locking. No locks are held in the fast path, so these updates are not safe.
Change-Id: Icc785df87b294b938b59705116369abd80ccf4da Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
|