diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c index 3f9ce5ab96cd..30bbc1961d03 100644 --- a/arch/arm/kernel/smp.c +++ b/arch/arm/kernel/smp.c @@ -48,6 +48,10 @@ #include #include +#ifdef CONFIG_AMLOGIC_MODIFY +#include +#define MIDR __ACCESS_CP15(c0, 0, c0, 0) +#endif #define CREATE_TRACE_POINTS #include @@ -575,6 +579,19 @@ static void ipi_cpu_stop(unsigned int cpu) local_fiq_disable(); local_irq_disable(); +#ifdef CONFIG_AMLOGIC_MODIFY + /* CORTEX-A55 need power down here for shutdown*/ + /* If A55 enter WFI here, it is possible quit from wfi, + * which cause CPU PACTIVE check fail. + */ +#ifdef CONFIG_HOTPLUG_CPU + if (((read_cpuid_id() >> 4) & 0xFFF) == 0xD05) { + flush_cache_louis(); + if (smp_ops.cpu_die) + smp_ops.cpu_die(cpu); + } +#endif +#endif while (1) cpu_relax(); } diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c index d034e17211ae..93acad5adbc4 100644 --- a/arch/arm64/kernel/smp.c +++ b/arch/arm64/kernel/smp.c @@ -62,6 +62,9 @@ #define CREATE_TRACE_POINTS #include +#ifdef CONFIG_AMLOGIC_MODIFY +#include +#endif DEFINE_PER_CPU_READ_MOSTLY(int, cpu_number); EXPORT_PER_CPU_SYMBOL(cpu_number); @@ -833,6 +836,18 @@ static void ipi_cpu_stop(unsigned int cpu) local_irq_disable(); +#ifdef CONFIG_AMLOGIC_MODIFY + /* CORTEX-A55 need power down here for shutdown*/ + /* If A55 enter WFI here, it is possible quit from wfi, + * which cause CPU PACTIVE check fail. + */ +#ifdef CONFIG_HOTPLUG_CPU + if ((read_cpuid_id() & MIDR_CPU_MODEL_MASK) == MIDR_CORTEX_A55) { + if (cpu_ops[cpu] && cpu_ops[cpu]->cpu_die) + cpu_ops[cpu]->cpu_die(cpu); + } +#endif +#endif while (1) cpu_relax(); }