diff options
Diffstat (limited to 'arch/mips/kernel/pm-cps.c')
-rw-r--r-- | arch/mips/kernel/pm-cps.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/arch/mips/kernel/pm-cps.c b/arch/mips/kernel/pm-cps.c index c4c2069d3a20..06147179a175 100644 --- a/arch/mips/kernel/pm-cps.c +++ b/arch/mips/kernel/pm-cps.c | |||
@@ -149,8 +149,12 @@ int cps_pm_enter_state(enum cps_pm_state state) | |||
149 | 149 | ||
150 | /* Setup the VPE to run mips_cps_pm_restore when started again */ | 150 | /* Setup the VPE to run mips_cps_pm_restore when started again */ |
151 | if (config_enabled(CONFIG_CPU_PM) && state == CPS_PM_POWER_GATED) { | 151 | if (config_enabled(CONFIG_CPU_PM) && state == CPS_PM_POWER_GATED) { |
152 | /* Power gating relies upon CPS SMP */ | ||
153 | if (!mips_cps_smp_in_use()) | ||
154 | return -EINVAL; | ||
155 | |||
152 | core_cfg = &mips_cps_core_bootcfg[core]; | 156 | core_cfg = &mips_cps_core_bootcfg[core]; |
153 | vpe_cfg = &core_cfg->vpe_config[current_cpu_data.vpe_id]; | 157 | vpe_cfg = &core_cfg->vpe_config[cpu_vpe_id(¤t_cpu_data)]; |
154 | vpe_cfg->pc = (unsigned long)mips_cps_pm_restore; | 158 | vpe_cfg->pc = (unsigned long)mips_cps_pm_restore; |
155 | vpe_cfg->gp = (unsigned long)current_thread_info(); | 159 | vpe_cfg->gp = (unsigned long)current_thread_info(); |
156 | vpe_cfg->sp = 0; | 160 | vpe_cfg->sp = 0; |
@@ -376,6 +380,10 @@ static void * __init cps_gen_entry_code(unsigned cpu, enum cps_pm_state state) | |||
376 | memset(relocs, 0, sizeof(relocs)); | 380 | memset(relocs, 0, sizeof(relocs)); |
377 | 381 | ||
378 | if (config_enabled(CONFIG_CPU_PM) && state == CPS_PM_POWER_GATED) { | 382 | if (config_enabled(CONFIG_CPU_PM) && state == CPS_PM_POWER_GATED) { |
383 | /* Power gating relies upon CPS SMP */ | ||
384 | if (!mips_cps_smp_in_use()) | ||
385 | goto out_err; | ||
386 | |||
379 | /* | 387 | /* |
380 | * Save CPU state. Note the non-standard calling convention | 388 | * Save CPU state. Note the non-standard calling convention |
381 | * with the return address placed in v0 to avoid clobbering | 389 | * with the return address placed in v0 to avoid clobbering |