Re: [PATCH 08/16] ARM: mvebu: Use a local variable to store the resume address

Thomas Petazzoni
2014-06-30T15:09:56Z

Dear Gregory CLEMENT,

On Fri, 27 Jun 2014 15:22:49 +0200, Gregory CLEMENT wrote:

> +static void *mvebu_cpu_resume;
> +
> static struct platform_device mvebu_v7_cpuidle_device = {
> .name = "cpuidle-armada-370-xp",
> };
> @@ -281,7 +283,7 @@ static int mvebu_v7_cpu_pm_notify(struct notifier_block *self,
> {
> if (action == CPU_PM_ENTER) {
> unsigned int hw_cpu = cpu_logical_map(smp_processor_id());
> - mvebu_pmsu_set_cpu_boot_addr(hw_cpu, armada_370_xp_cpu_resume);
> + mvebu_pmsu_set_cpu_boot_addr(hw_cpu, mvebu_cpu_resume);

Instead of doing this in the CPU_PM_ENTER notifier, do we have a reason
to not do it in the do_armada_370_xp_cpu_suspend() function, and then
do_armada_38x_suspend() function respectively? Those functions are
already SoC-specific, so surely, they already know whether the resume
path should go through armada_370_xp_cpu_resume() or
armada_38x_cpu_resume(), no?

Thanks,

Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering