[PATCH v2 2/2] ARM64: kernel: PSCI: move PSCI idle management code to drivers/firmware

Mark Rutland mark.rutland at arm.com
Mon Oct 12 07:29:26 PDT 2015


Hi Lorenzo,

On Mon, Oct 12, 2015 at 12:17:08PM +0100, Lorenzo Pieralisi wrote:
> ARM64 PSCI kernel interfaces that initialize idle states and implement
> the suspend API to enter them are generic and can be shared with the
> ARM architecture.
> 
> To achieve that goal, this patch moves ARM64 PSCI idle management
> code to drivers/firmware by creating a file that contains PSCI
> helper functions implementing the common kernel interface required
> by ARM and ARM64 to share the PSCI idle management code.
> 
> The ARM generic CPUidle implementation also requires the definition of
> a cpuidle_ops section entry for the kernel to initialize the CPUidle
> operations at boot based on the enable-method (ie ARM64 has the
> statically initialized cpu_ops counterparts for that purpose); therefore
> this patch also adds the required section entry on CONFIG_ARM for PSCI so
> that the kernel can initialize the PSCI CPUidle back-end when PSCI is
> the probed enable-method.
> 
> On ARM64 this patch provides no functional change.
> 
> Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi at arm.com>
> Cc: Will Deacon <will.deacon at arm.com>
> Cc: Sudeep Holla <sudeep.holla at arm.com>
> Cc: Russell King <linux at arm.linux.org.uk>
> Cc: Daniel Lezcano <daniel.lezcano at linaro.org>
> Cc: Catalin Marinas <catalin.marinas at arm.com>
> Cc: Mark Rutland <mark.rutland at arm.com>
> Cc: Jisheng Zhang <jszhang at marvell.com>
> ---
>  arch/arm64/kernel/psci.c       |  99 +-----------------------------
>  drivers/firmware/Makefile      |   2 +-
>  drivers/firmware/psci_cpuops.c | 133 +++++++++++++++++++++++++++++++++++++++++

Do we really need the new file, given most of this lived happily in
psci.c previously?

> +#ifdef CONFIG_ARM
> +struct cpuidle_ops psci_cpuidle_ops __initdata = {
> +	.suspend = psci_cpu_suspend_enter,
> +	.init = psci_dt_cpu_init_idle,
> +};
> +
> +CPUIDLE_METHOD_OF_DECLARE(psci, "arm,psci", &psci_cpuidle_ops);
> +#endif

Don't these also need to be guarded for CONFIG_CPU_IDLE?

The definitions of cpuidle_ops and CPUIDLE_METHOD_OF_DECLARE in
arch/arm/include/asm/cpuidle.h depend on it.

Otherwise this looks fine to me.

Thanks,
Mark.



More information about the linux-arm-kernel mailing list