Merge git://git.kernel.org/pub/scm/linux/kernel/git/joern/logfs
[firefly-linux-kernel-4.4.55.git] / arch / arm / kernel / smp.c
index 57162af53dc982cc0911e09537915eb1eddc1cbb..a01194e583ff8000587ae9b8887e35fc15e60c59 100644 (file)
@@ -86,6 +86,12 @@ int __cpuinit __cpu_up(unsigned int cpu)
                        return PTR_ERR(idle);
                }
                ci->idle = idle;
+       } else {
+               /*
+                * Since this idle thread is being re-used, call
+                * init_idle() to reinitialize the thread structure.
+                */
+               init_idle(idle, cpu);
        }
 
        /*
@@ -99,6 +105,7 @@ int __cpuinit __cpu_up(unsigned int cpu)
        *pmd = __pmd((PHYS_OFFSET & PGDIR_MASK) |
                     PMD_TYPE_SECT | PMD_SECT_AP_WRITE);
        flush_pmd_entry(pmd);
+       outer_clean_range(__pa(pmd), __pa(pmd + 1));
 
        /*
         * We need to tell the secondary core where to find
@@ -106,7 +113,8 @@ int __cpuinit __cpu_up(unsigned int cpu)
         */
        secondary_data.stack = task_stack_page(idle) + THREAD_START_SP;
        secondary_data.pgdir = virt_to_phys(pgd);
-       wmb();
+       __cpuc_flush_dcache_area(&secondary_data, sizeof(secondary_data));
+       outer_clean_range(__pa(&secondary_data), __pa(&secondary_data + 1));
 
        /*
         * Now bring the CPU into our world.