From 85705895d725a6ff4827517fc0bfe0d20a9e255f Mon Sep 17 00:00:00 2001 From: Mirela Simonovic Date: Mon, 2 Mar 2015 16:17:24 +0100 Subject: [PATCH] PMUFW: PM: pm_slave: PmUpdateSlave rewritten to always try to update slave state. Before, there was a check at the very beginning to see if current state is having exact required capabilities. However, state should be checked for having all required capabilities and not for having exact required caps. Also, even when state have all required capabilities, there could be state with lower power that still has all required capabilities. Code is changed to implement above claims. Signed-off-by: Mirela Simonovic Acked-by: Soren Brinkmann Acked-by: Jyotheeswar Reddy Mutthareddyvari --- lib/sw_apps/zynqmp_pmufw/src/pm_slave.c | 20 +++++++++----------- lib/sw_apps/zynqmp_pmufw/src/xpfw_version.h | 2 +- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/lib/sw_apps/zynqmp_pmufw/src/pm_slave.c b/lib/sw_apps/zynqmp_pmufw/src/pm_slave.c index 7ca1464e..80f8444e 100644 --- a/lib/sw_apps/zynqmp_pmufw/src/pm_slave.c +++ b/lib/sw_apps/zynqmp_pmufw/src/pm_slave.c @@ -217,17 +217,16 @@ u32 PmUpdateSlave(PmSlave* const slave) u32 status = PM_RET_ERROR_NOTSUPPORTED; u32 capsToSet = PmGetMaxCapabilities(slave); - if (capsToSet == slave->slvFsm->states[slave->node.currState]) { - /* Slave is already in right state */ - status = PM_RET_SUCCESS; - goto done; - } - if (0U != capsToSet) { for (s = 0U; s < fsm->statesCnt; s++) { - /* Find the first state with all required capabilities */ + /* Find first state with all required capabilities */ if ((capsToSet & fsm->states[s]) == capsToSet) { - status = PmSlaveChangeState(slave, s); + if (s == slave->node.currState) { + /* Slave is already in right state */ + status = PM_RET_SUCCESS; + } else { + status = PmSlaveChangeState(slave, s); + } break; } } @@ -235,13 +234,12 @@ u32 PmUpdateSlave(PmSlave* const slave) /* * Set the lowest power state, no capabilities are required. This * check has to exist because some slaves have no state with 0 - * capabilities. Therefore, they are always placed in first, lowest - * power state when their capabilities are not required. + * capabilities. Therefore, they are always placed in first, + * lowest power state when their capabilities are not required. */ status = PmSlaveChangeState(slave, 0U); } -done: return status; } diff --git a/lib/sw_apps/zynqmp_pmufw/src/xpfw_version.h b/lib/sw_apps/zynqmp_pmufw/src/xpfw_version.h index 50e0c334..bd366350 100644 --- a/lib/sw_apps/zynqmp_pmufw/src/xpfw_version.h +++ b/lib/sw_apps/zynqmp_pmufw/src/xpfw_version.h @@ -1,4 +1,4 @@ #ifndef ZYNQMP_XPFW_VERSION__H_ #define ZYNQMP_XPFW_VERSION__H_ - #define ZYNQMP_XPFW_VERSION "2015.1-swbeta2-25-gbe36ee956067" + #define ZYNQMP_XPFW_VERSION "2015.1-swbeta2-26-ga3313fd8ec5d" #endif