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 <mirela.simonovic@aggios.com>
Acked-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
Acked-by: Jyotheeswar Reddy Mutthareddyvari <jyothee@xilinx.com>
This commit is contained in:
Mirela Simonovic 2015-03-02 16:17:24 +01:00 committed by Nava kishore Manne
parent e3bb1821b7
commit 85705895d7
2 changed files with 10 additions and 12 deletions

View file

@ -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;
}

View file

@ -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