From c1759f02c0cac6b139a05e5c00ec32ad7757ffdd Mon Sep 17 00:00:00 2001 From: Youngtae Lee Date: Fri, 4 May 2018 15:48:10 +0900 Subject: [PATCH] arm64: psci: Add affinity_lv for hotplug To indecating hotplug with cluster power down, pass affinity_level EL3 by PSCI. Change-Id: I4687c828e26150485e6ff426a815562322587ee9 Signed-off-by: Youngtae Lee --- arch/arm64/kernel/psci.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/arch/arm64/kernel/psci.c b/arch/arm64/kernel/psci.c index e8edbf13302a..df9ce98fb08e 100644 --- a/arch/arm64/kernel/psci.c +++ b/arch/arm64/kernel/psci.c @@ -21,6 +21,7 @@ #include #include #include +#include #include @@ -69,13 +70,21 @@ static int cpu_psci_cpu_disable(unsigned int cpu) static void cpu_psci_cpu_die(unsigned int cpu) { - int ret; + u32 state; + int ret, affinity_level = 0; /* * There are no known implementations of PSCI actually using the * power state field, pass a sensible default for now. */ - u32 state = PSCI_POWER_STATE_TYPE_POWER_DOWN << - PSCI_0_2_POWER_STATE_TYPE_SHIFT; + if (exynos_cpuhp_last_cpu(cpu)) + affinity_level = 1; + + state = ((PSCI_POWER_STATE_TYPE_POWER_DOWN + << PSCI_0_2_POWER_STATE_TYPE_SHIFT) + & PSCI_0_2_POWER_STATE_TYPE_MASK) | + ((affinity_level + << PSCI_0_2_POWER_STATE_AFFL_SHIFT) + & PSCI_0_2_POWER_STATE_AFFL_MASK); ret = psci_ops.cpu_off(state); -- 2.20.1