Merge pull request #301 from soby-mathew/sm/cpu_on_pend_state_fix

PSCI: Set ON_PENDING state early during CPU_ON
This commit is contained in:
achingupta 2015-05-18 18:32:38 +01:00
commit 57e56bba34
1 changed files with 16 additions and 14 deletions

View File

@ -257,6 +257,16 @@ int psci_afflvl_on(unsigned long target_cpu,
if (psci_spd_pm && psci_spd_pm->svc_on) if (psci_spd_pm && psci_spd_pm->svc_on)
psci_spd_pm->svc_on(target_cpu); psci_spd_pm->svc_on(target_cpu);
/*
* This function updates the state of each affinity instance
* corresponding to the mpidr in the range of affinity levels
* specified.
*/
psci_do_afflvl_state_mgmt(start_afflvl,
end_afflvl,
target_cpu_nodes,
PSCI_STATE_ON_PENDING);
/* Perform generic, architecture and platform specific handling. */ /* Perform generic, architecture and platform specific handling. */
rc = psci_call_on_handlers(target_cpu_nodes, rc = psci_call_on_handlers(target_cpu_nodes,
start_afflvl, start_afflvl,
@ -265,23 +275,15 @@ int psci_afflvl_on(unsigned long target_cpu,
assert(rc == PSCI_E_SUCCESS || rc == PSCI_E_INTERN_FAIL); assert(rc == PSCI_E_SUCCESS || rc == PSCI_E_INTERN_FAIL);
/* if (rc == PSCI_E_SUCCESS)
* This function updates the state of each affinity instance /* Store the re-entry information for the non-secure world. */
* corresponding to the mpidr in the range of affinity levels cm_init_context(target_cpu, ep);
* specified. else
*/ /* Restore the state on error. */
if (rc == PSCI_E_SUCCESS) {
psci_do_afflvl_state_mgmt(start_afflvl, psci_do_afflvl_state_mgmt(start_afflvl,
end_afflvl, end_afflvl,
target_cpu_nodes, target_cpu_nodes,
PSCI_STATE_ON_PENDING); PSCI_STATE_OFF);
/*
* Store the re-entry information for the non-secure world.
*/
cm_init_context(target_cpu, ep);
}
exit: exit:
/* /*
* This loop releases the lock corresponding to each affinity level * This loop releases the lock corresponding to each affinity level