ARM: at91: pm: fallback to slowclock when backup mode fails
authorAlexandre Belloni <[email protected]>
Wed, 26 Apr 2017 14:34:24 +0000 (16:34 +0200)
committerAlexandre Belloni <[email protected]>
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 <[email protected]>
Acked-by: Wenyou Yang <[email protected]>
arch/arm/mach-at91/pm.c

index ef9c1d29cc6719543ce17c2ff0faa892215fc58f..fc4026478579dce9259a6a130415c08c805d666f 100644 (file)
@@ -544,6 +544,11 @@ sfrbu_fail:
 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 {