From: Baolin Wang Date: Mon, 9 Mar 2020 08:18:45 +0000 (+0800) Subject: power: reset: sc27xx: Change to use cpu_down() X-Git-Tag: v5.7-rc1~76^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=274afbc3ad33136962d66447e89d02e3c142a30a;p=thirdparty%2Fkernel%2Flinux.git power: reset: sc27xx: Change to use cpu_down() To allow the SC27XX driver can be built as a module, and the freeze_secondary_cpus() symbol is not exported, thus we can change to use the exported cpu_down() API to shut down other cpus to avoid racing, which is same as the freeze_secondary_cpus(). Signed-off-by: Baolin Wang Signed-off-by: Sebastian Reichel --- diff --git a/drivers/power/reset/sc27xx-poweroff.c b/drivers/power/reset/sc27xx-poweroff.c index 2bedd4c58ddc5..91b5eceeb810b 100644 --- a/drivers/power/reset/sc27xx-poweroff.c +++ b/drivers/power/reset/sc27xx-poweroff.c @@ -29,10 +29,13 @@ static struct regmap *regmap; */ static void sc27xx_poweroff_shutdown(void) { -#ifdef CONFIG_PM_SLEEP_SMP - int cpu = smp_processor_id(); +#ifdef CONFIG_HOTPLUG_CPU + int cpu; - freeze_secondary_cpus(cpu); + for_each_online_cpu(cpu) { + if (cpu != smp_processor_id()) + cpu_down(cpu); + } #endif }