diff options
author | Baolin Wang <baolin.wang7@gmail.com> | 2020-03-09 16:18:45 +0800 |
---|---|---|
committer | Sebastian Reichel <sebastian.reichel@collabora.com> | 2020-03-11 23:32:09 +0100 |
commit | 274afbc3ad33136962d66447e89d02e3c142a30a (patch) | |
tree | 72573a0373a7528e536cdfd30a414bbd234fc8e7 /drivers/power | |
parent | 6cdd5b09cbe67365c42aee539f6fd00f2ecfdaab (diff) |
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 <baolin.wang7@gmail.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Diffstat (limited to 'drivers/power')
-rw-r--r-- | drivers/power/reset/sc27xx-poweroff.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/power/reset/sc27xx-poweroff.c b/drivers/power/reset/sc27xx-poweroff.c index 2bedd4c58ddc..91b5eceeb810 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 } |