]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
ARM: at91: pm: fallback to slowclock when backup mode fails
authorAlexandre Belloni <alexandre.belloni@free-electrons.com>
Wed, 26 Apr 2017 14:34:24 +0000 (16:34 +0200)
committerAlexandre Belloni <alexandre.belloni@free-electrons.com>
Mon, 15 May 2017 09:55:33 +0000 (11:55 +0200)
If the backup sram allocation fails, ensure we can suspend by falling back
to the usual slow clock mode.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Acked-by: Wenyou Yang <wenyou.yang@atmel.com>
arch/arm/mach-at91/pm.c

index ef9c1d29cc6719543ce17c2ff0faa892215fc58f..fc4026478579dce9259a6a130415c08c805d666f 100644 (file)
@@ -544,6 +544,11 @@ static void __init at91_pm_backup_init(void)
 securam_fail:
        iounmap(pm_data.sfrbu);
        pm_data.sfrbu = NULL;
+
+       if (pm_data.standby_mode == AT91_PM_BACKUP)
+               pm_data.standby_mode = AT91_PM_SLOW_CLOCK;
+       if (pm_data.suspend_mode == AT91_PM_BACKUP)
+               pm_data.suspend_mode = AT91_PM_SLOW_CLOCK;
 }
 
 struct pmc_info {