Commit addc8120 authored by Catalin Marinas's avatar Catalin Marinas

Merge branch 'arm64/psci-rework' of git://git.kernel.org/pub/scm/linux/kernel/git/mark/linux

* 'arm64/psci-rework' of git://git.kernel.org/pub/scm/linux/kernel/git/mark/linux:
  arm64: psci: remove ACPI coupling
  arm64: psci: kill psci_power_state
  arm64: psci: account for Trusted OS instances
  arm64: psci: support unsigned return values
  arm64: psci: remove unnecessary id indirection
  arm64: smp: consistently use error codes
  arm64: smp_plat: add get_logical_index
  arm/arm64: kvm: add missing PSCI include

Conflicts:
	arch/arm64/kernel/smp.c
parents eb7c11ee c5a13305
...@@ -24,6 +24,8 @@ ...@@ -24,6 +24,8 @@
#include <asm/kvm_psci.h> #include <asm/kvm_psci.h>
#include <asm/kvm_host.h> #include <asm/kvm_host.h>
#include <uapi/linux/psci.h>
/* /*
* This is an implementation of the Power State Coordination Interface * This is an implementation of the Power State Coordination Interface
* as described in ARM document number ARM DEN 0022A. * as described in ARM document number ARM DEN 0022A.
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#include <linux/irqchip/arm-gic-acpi.h> #include <linux/irqchip/arm-gic-acpi.h>
#include <asm/cputype.h> #include <asm/cputype.h>
#include <asm/psci.h>
#include <asm/smp_plat.h> #include <asm/smp_plat.h>
/* Basic configuration for ACPI */ /* Basic configuration for ACPI */
...@@ -39,18 +40,6 @@ extern int acpi_disabled; ...@@ -39,18 +40,6 @@ extern int acpi_disabled;
extern int acpi_noirq; extern int acpi_noirq;
extern int acpi_pci_disabled; extern int acpi_pci_disabled;
/* 1 to indicate PSCI 0.2+ is implemented */
static inline bool acpi_psci_present(void)
{
return acpi_gbl_FADT.arm_boot_flags & ACPI_FADT_PSCI_COMPLIANT;
}
/* 1 to indicate HVC must be used instead of SMC as the PSCI conduit */
static inline bool acpi_psci_use_hvc(void)
{
return acpi_gbl_FADT.arm_boot_flags & ACPI_FADT_PSCI_USE_HVC;
}
static inline void disable_acpi(void) static inline void disable_acpi(void)
{ {
acpi_disabled = 1; acpi_disabled = 1;
...@@ -88,8 +77,6 @@ static inline void arch_fix_phys_package_id(int num, u32 slot) { } ...@@ -88,8 +77,6 @@ static inline void arch_fix_phys_package_id(int num, u32 slot) { }
void __init acpi_init_cpus(void); void __init acpi_init_cpus(void);
#else #else
static inline bool acpi_psci_present(void) { return false; }
static inline bool acpi_psci_use_hvc(void) { return false; }
static inline void acpi_init_cpus(void) { } static inline void acpi_init_cpus(void) { }
#endif /* CONFIG_ACPI */ #endif /* CONFIG_ACPI */
......
...@@ -14,7 +14,15 @@ ...@@ -14,7 +14,15 @@
#ifndef __ASM_PSCI_H #ifndef __ASM_PSCI_H
#define __ASM_PSCI_H #define __ASM_PSCI_H
int psci_dt_init(void); int __init psci_dt_init(void);
int psci_acpi_init(void);
#ifdef CONFIG_ACPI
int __init psci_acpi_init(void);
bool __init acpi_psci_present(void);
bool __init acpi_psci_use_hvc(void);
#else
static inline int psci_acpi_init(void) { return 0; }
static inline bool acpi_psci_present(void) { return false; }
#endif
#endif /* __ASM_PSCI_H */ #endif /* __ASM_PSCI_H */
...@@ -19,6 +19,8 @@ ...@@ -19,6 +19,8 @@
#ifndef __ASM_SMP_PLAT_H #ifndef __ASM_SMP_PLAT_H
#define __ASM_SMP_PLAT_H #define __ASM_SMP_PLAT_H
#include <linux/cpumask.h>
#include <asm/types.h> #include <asm/types.h>
struct mpidr_hash { struct mpidr_hash {
...@@ -39,6 +41,20 @@ static inline u32 mpidr_hash_size(void) ...@@ -39,6 +41,20 @@ static inline u32 mpidr_hash_size(void)
*/ */
extern u64 __cpu_logical_map[NR_CPUS]; extern u64 __cpu_logical_map[NR_CPUS];
#define cpu_logical_map(cpu) __cpu_logical_map[cpu] #define cpu_logical_map(cpu) __cpu_logical_map[cpu]
/*
* Retrieve logical cpu index corresponding to a given MPIDR.Aff*
* - mpidr: MPIDR.Aff* bits to be used for the look-up
*
* Returns the cpu logical index or -EINVAL on look-up error
*/
static inline int get_logical_index(u64 mpidr)
{
int cpu;
for (cpu = 0; cpu < nr_cpu_ids; cpu++)
if (cpu_logical_map(cpu) == mpidr)
return cpu;
return -EINVAL;
}
void __init do_post_cpus_up_work(void); void __init do_post_cpus_up_work(void);
......
...@@ -89,6 +89,17 @@ void __init __acpi_unmap_table(char *map, unsigned long size) ...@@ -89,6 +89,17 @@ void __init __acpi_unmap_table(char *map, unsigned long size)
early_memunmap(map, size); early_memunmap(map, size);
} }
bool __init acpi_psci_present(void)
{
return acpi_gbl_FADT.arm_boot_flags & ACPI_FADT_PSCI_COMPLIANT;
}
/* Whether HVC must be used instead of SMC as the PSCI conduit */
bool __init acpi_psci_use_hvc(void)
{
return acpi_gbl_FADT.arm_boot_flags & ACPI_FADT_PSCI_USE_HVC;
}
/* /*
* acpi_fadt_sanity_check() - Check FADT presence and carry out sanity * acpi_fadt_sanity_check() - Check FADT presence and carry out sanity
* checks on it * checks on it
......
This diff is collapsed.
...@@ -249,7 +249,7 @@ static int op_cpu_kill(unsigned int cpu) ...@@ -249,7 +249,7 @@ static int op_cpu_kill(unsigned int cpu)
* time and hope that it's dead, so let's skip the wait and just hope. * time and hope that it's dead, so let's skip the wait and just hope.
*/ */
if (!cpu_ops[cpu]->cpu_kill) if (!cpu_ops[cpu]->cpu_kill)
return 1; return 0;
return cpu_ops[cpu]->cpu_kill(cpu); return cpu_ops[cpu]->cpu_kill(cpu);
} }
...@@ -260,6 +260,8 @@ static int op_cpu_kill(unsigned int cpu) ...@@ -260,6 +260,8 @@ static int op_cpu_kill(unsigned int cpu)
*/ */
void __cpu_die(unsigned int cpu) void __cpu_die(unsigned int cpu)
{ {
int err;
if (!cpu_wait_death(cpu, 5)) { if (!cpu_wait_death(cpu, 5)) {
pr_crit("CPU%u: cpu didn't die\n", cpu); pr_crit("CPU%u: cpu didn't die\n", cpu);
return; return;
...@@ -272,8 +274,10 @@ void __cpu_die(unsigned int cpu) ...@@ -272,8 +274,10 @@ void __cpu_die(unsigned int cpu)
* verify that it has really left the kernel before we consider * verify that it has really left the kernel before we consider
* clobbering anything it might still be using. * clobbering anything it might still be using.
*/ */
if (!op_cpu_kill(cpu)) err = op_cpu_kill(cpu);
pr_warn("CPU%d may not have shut down cleanly\n", cpu); if (err)
pr_warn("CPU%d may not have shut down cleanly: %d\n",
cpu, err);
} }
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment