Skip to content

Commit

Permalink
ARM: psci: cpuidle: Enable PSCI CPUidle driver
Browse files Browse the repository at this point in the history
Allow selection of the PSCI CPUidle in the kernel by updating
the respective Kconfig entry.

Remove PSCI callbacks from ARM/ARM64 generic CPU ops
to prevent the PSCI idle driver from clashing with the generic
ARM CPUidle driver initialization, that relies on CPU ops
to initialize and enter idle states.

Signed-off-by: Lorenzo Pieralisi <[email protected]>
Reviewed-by: Ulf Hansson <[email protected]>
Cc: Will Deacon <[email protected]>
Cc: Ulf Hansson <[email protected]>
Cc: Sudeep Holla <[email protected]>
Cc: Daniel Lezcano <[email protected]>
Cc: Catalin Marinas <[email protected]>
Cc: Mark Rutland <[email protected]>
Cc: "Rafael J. Wysocki" <[email protected]>
Signed-off-by: Will Deacon <[email protected]>
  • Loading branch information
Lorenzo Pieralisi authored and willdeacon committed Aug 9, 2019
1 parent 81d549e commit 7889614
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 18 deletions.
7 changes: 4 additions & 3 deletions arch/arm64/kernel/cpuidle.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <linux/cpu_pm.h>
#include <linux/of.h>
#include <linux/of_device.h>
#include <linux/psci.h>

#include <asm/cpuidle.h>
#include <asm/cpu_ops.h>
Expand Down Expand Up @@ -48,15 +49,15 @@ int arm_cpuidle_suspend(int index)

int acpi_processor_ffh_lpi_probe(unsigned int cpu)
{
return arm_cpuidle_init(cpu);
return psci_cpu_init_idle(cpu);
}

int acpi_processor_ffh_lpi_enter(struct acpi_lpi_state *lpi)
{
if (ARM64_LPI_IS_RETENTION_STATE(lpi->arch_flags))
return CPU_PM_CPU_IDLE_ENTER_RETENTION(arm_cpuidle_suspend,
return CPU_PM_CPU_IDLE_ENTER_RETENTION(psci_cpu_suspend_enter,
lpi->index);
else
return CPU_PM_CPU_IDLE_ENTER(arm_cpuidle_suspend, lpi->index);
return CPU_PM_CPU_IDLE_ENTER(psci_cpu_suspend_enter, lpi->index);
}
#endif
4 changes: 0 additions & 4 deletions arch/arm64/kernel/psci.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,6 @@ static int cpu_psci_cpu_kill(unsigned int cpu)

const struct cpu_operations cpu_psci_ops = {
.name = "psci",
#ifdef CONFIG_CPU_IDLE
.cpu_init_idle = psci_cpu_init_idle,
.cpu_suspend = psci_cpu_suspend_enter,
#endif
.cpu_init = cpu_psci_cpu_init,
.cpu_prepare = cpu_psci_cpu_prepare,
.cpu_boot = cpu_psci_cpu_boot,
Expand Down
2 changes: 1 addition & 1 deletion drivers/cpuidle/Kconfig.arm
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ config ARM_CPUIDLE
provided by architecture code.

config ARM_PSCI_CPUIDLE
bool
bool "PSCI CPU idle Driver"
depends on ARM_PSCI_FW
select DT_IDLE_STATES
select CPU_IDLE_MULTIPLE_DRIVERS
Expand Down
10 changes: 0 additions & 10 deletions drivers/firmware/psci/psci.c
Original file line number Diff line number Diff line change
Expand Up @@ -436,16 +436,6 @@ int psci_cpu_suspend_enter(unsigned long index)

return ret;
}

/* ARM specific CPU idle operations */
#ifdef CONFIG_ARM
static const struct cpuidle_ops psci_cpuidle_ops __initconst = {
.suspend = psci_cpu_suspend_enter,
.init = psci_dt_cpu_init_idle,
};

CPUIDLE_METHOD_OF_DECLARE(psci, "psci", &psci_cpuidle_ops);
#endif
#endif

static int psci_system_suspend(unsigned long unused)
Expand Down

0 comments on commit 7889614

Please sign in to comment.