Skip to content

module/power_domain Address incorrect state update and UTs

Katherine Vincent requested to merge pd_missing_state into main

Each power domain tracks its one power state in 3 variables in the module context, to keep track of all the transitions. These consist of current_state, requested_state and state_requested_to_driver.

During process_set_state_request(), the requested_state is updated before the transaction takes effectively place and, in case of failure to transition to the new power state, it is not restored to its previous value. In subsequent operations this may cause power transitions to take place (or not) based on incorrect power state.

This patch makes sure that:

  • the requested_state in process_set_state_request() is brought back to its previous valid one, should the transition fail
  • the state_requested_to_driver is updated only on successful operation returned by the driver

Change-Id: I59098cce2f2e62d9994e4be6e0c85ee32a0504b4 Signed-off-by: Nicola Mazzucato nicola.mazzucato@arm.com Signed-off-by: Katherine Vincent katherine.vincent@arm.com

Merge request reports