summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/power_management/hotplug/hotplug.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/lib/power_management/hotplug/hotplug.c b/lib/power_management/hotplug/hotplug.c
index 7c5be95..97e3298 100644
--- a/lib/power_management/hotplug/hotplug.c
+++ b/lib/power_management/hotplug/hotplug.c
@@ -210,26 +210,25 @@ int32_t tftf_try_cpu_on(uint64_t target_cpu,
int32_t ret;
unsigned int core_pos = platform_get_core_pos(target_cpu);
- spin_lock(&cpus_status_map[core_pos].lock);
-
ret = tftf_psci_cpu_on(target_cpu,
(uint64_t) tftf_hotplug_entry,
context_id);
if (ret == PSCI_E_SUCCESS) {
- assert(cpus_status_map[core_pos].state == TFTF_AFFINITY_STATE_OFF);
- cpus_status_map[core_pos].state = TFTF_AFFINITY_STATE_ON_PENDING;
+ spin_lock(&cpus_status_map[core_pos].lock);
+ assert(cpus_status_map[core_pos].state ==
+ TFTF_AFFINITY_STATE_OFF);
+ cpus_status_map[core_pos].state =
+ TFTF_AFFINITY_STATE_ON_PENDING;
+
+ spin_unlock(&cpus_status_map[core_pos].lock);
/*
* Populate the test entry point for this core.
- * This is the address where the core will jump to once the framework
- * has finished initialising it.
+ * This is the address where the core will jump to once the
+ * framework has finished initialising it.
*/
test_entrypoint[core_pos] = (test_function_t) entrypoint;
- spin_unlock(&cpus_status_map[core_pos].lock);
- } else {
- spin_unlock(&cpus_status_map[core_pos].lock);
- ERROR("Failed to boot CPU 0x%lx (%d)\n", target_cpu, ret);
}
return ret;