From 099973469b430fdbccc6ab82737c760aeccfbfce Mon Sep 17 00:00:00 2001 From: Soby Mathew Date: Tue, 18 Nov 2014 10:14:14 +0000 Subject: Invalidate the dcache after initializing cpu-ops This patch fixes a crash due to corruption of cpu_ops data structure. During the secondary CPU boot, after the cpu_ops has been initialized in the per cpu-data, the dcache lines need to invalidated so that the update in memory can be seen later on when the dcaches are turned ON. Also, after initializing the psci per cpu data, the dcache lines are flushed so that they are written back to memory and dirty dcache lines are avoided. Fixes ARM-Software/tf-issues#271 Change-Id: Ia90f55e9882690ead61226eea5a5a9146d35f313 --- services/std_svc/psci/psci_setup.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'services/std_svc/psci/psci_setup.c') diff --git a/services/std_svc/psci/psci_setup.c b/services/std_svc/psci/psci_setup.c index 8e9d15dc..e0bc8331 100644 --- a/services/std_svc/psci/psci_setup.c +++ b/services/std_svc/psci/psci_setup.c @@ -219,10 +219,11 @@ static void psci_init_aff_map_node(unsigned long mpidr, psci_svc_cpu_data.max_phys_off_afflvl, PSCI_INVALID_DATA); + flush_cpu_data_by_index(linear_id, psci_svc_cpu_data); + cm_set_context_by_mpidr(mpidr, (void *) &psci_ns_context[linear_id], NON_SECURE); - } return; -- cgit