| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 3 | | - * it under the terms of the GNU General Public License version 2 as |
|---|
| 4 | | - * published by the Free Software Foundation. |
|---|
| 5 | | - * |
|---|
| 6 | | - * This program is distributed in the hope that it will be useful, |
|---|
| 7 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 8 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 9 | | - * GNU General Public License for more details. |
|---|
| 10 | 3 | * |
|---|
| 11 | 4 | * Copyright (C) 2013 ARM Limited |
|---|
| 12 | 5 | * |
|---|
| .. | .. |
|---|
| 24 | 17 | |
|---|
| 25 | 18 | #include <uapi/linux/psci.h> |
|---|
| 26 | 19 | |
|---|
| 27 | | -#include <asm/compiler.h> |
|---|
| 28 | 20 | #include <asm/cpu_ops.h> |
|---|
| 29 | 21 | #include <asm/errno.h> |
|---|
| 30 | 22 | #include <asm/smp_plat.h> |
|---|
| .. | .. |
|---|
| 55 | 47 | } |
|---|
| 56 | 48 | |
|---|
| 57 | 49 | #ifdef CONFIG_HOTPLUG_CPU |
|---|
| 50 | +static bool cpu_psci_cpu_can_disable(unsigned int cpu) |
|---|
| 51 | +{ |
|---|
| 52 | + return !psci_tos_resident_on(cpu); |
|---|
| 53 | +} |
|---|
| 54 | + |
|---|
| 58 | 55 | static int cpu_psci_cpu_disable(unsigned int cpu) |
|---|
| 59 | 56 | { |
|---|
| 60 | 57 | /* Fail early if we don't have CPU_OFF support */ |
|---|
| .. | .. |
|---|
| 114 | 111 | |
|---|
| 115 | 112 | const struct cpu_operations cpu_psci_ops = { |
|---|
| 116 | 113 | .name = "psci", |
|---|
| 117 | | -#ifdef CONFIG_CPU_IDLE |
|---|
| 118 | | - .cpu_init_idle = psci_cpu_init_idle, |
|---|
| 119 | | - .cpu_suspend = psci_cpu_suspend_enter, |
|---|
| 120 | | -#endif |
|---|
| 121 | 114 | .cpu_init = cpu_psci_cpu_init, |
|---|
| 122 | 115 | .cpu_prepare = cpu_psci_cpu_prepare, |
|---|
| 123 | 116 | .cpu_boot = cpu_psci_cpu_boot, |
|---|
| 124 | 117 | #ifdef CONFIG_HOTPLUG_CPU |
|---|
| 118 | + .cpu_can_disable = cpu_psci_cpu_can_disable, |
|---|
| 125 | 119 | .cpu_disable = cpu_psci_cpu_disable, |
|---|
| 126 | 120 | .cpu_die = cpu_psci_cpu_die, |
|---|
| 127 | 121 | .cpu_kill = cpu_psci_cpu_kill, |
|---|