mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08:00
suspend: Prevent might sleep splats
timekeeping suspend/resume calls read_persistant_clock() which takes rtc_lock. That results in might sleep warnings because at that point we run with interrupts disabled. We cannot convert rtc_lock to a raw spinlock as that would trigger other might sleep warnings. As a temporary workaround we disable the might sleep warnings by setting system_state to SYSTEM_SUSPEND before calling sysdev_suspend() and restoring it to SYSTEM_RUNNING afer sysdev_resume(). Needs to be revisited. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: azrim <mirzaspc@gmail.com>
This commit is contained in:
parent
c023c8780c
commit
b0bf64af36
@ -533,6 +533,7 @@ extern enum system_states {
|
||||
SYSTEM_HALT,
|
||||
SYSTEM_POWER_OFF,
|
||||
SYSTEM_RESTART,
|
||||
SYSTEM_SUSPEND,
|
||||
} system_state;
|
||||
|
||||
#define TAINT_PROPRIETARY_MODULE 0
|
||||
|
@ -293,6 +293,8 @@ static int create_image(int platform_mode)
|
||||
|
||||
local_irq_disable();
|
||||
|
||||
system_state = SYSTEM_SUSPEND;
|
||||
|
||||
error = syscore_suspend();
|
||||
if (error) {
|
||||
pr_err("Some system devices failed to power down, aborting hibernation\n");
|
||||
@ -323,6 +325,7 @@ static int create_image(int platform_mode)
|
||||
syscore_resume();
|
||||
|
||||
Enable_irqs:
|
||||
system_state = SYSTEM_RUNNING;
|
||||
local_irq_enable();
|
||||
|
||||
Enable_cpus:
|
||||
@ -456,6 +459,7 @@ static int resume_target_kernel(bool platform_mode)
|
||||
goto Enable_cpus;
|
||||
|
||||
local_irq_disable();
|
||||
system_state = SYSTEM_SUSPEND;
|
||||
|
||||
error = syscore_suspend();
|
||||
if (error)
|
||||
@ -489,6 +493,7 @@ static int resume_target_kernel(bool platform_mode)
|
||||
syscore_resume();
|
||||
|
||||
Enable_irqs:
|
||||
system_state = SYSTEM_RUNNING;
|
||||
local_irq_enable();
|
||||
|
||||
Enable_cpus:
|
||||
@ -574,6 +579,7 @@ int hibernation_platform_enter(void)
|
||||
goto Enable_cpus;
|
||||
|
||||
local_irq_disable();
|
||||
system_state = SYSTEM_SUSPEND;
|
||||
syscore_suspend();
|
||||
if (pm_wakeup_pending()) {
|
||||
error = -EAGAIN;
|
||||
@ -586,6 +592,7 @@ int hibernation_platform_enter(void)
|
||||
|
||||
Power_up:
|
||||
syscore_resume();
|
||||
system_state = SYSTEM_RUNNING;
|
||||
local_irq_enable();
|
||||
|
||||
Enable_cpus:
|
||||
|
@ -441,6 +441,8 @@ static int suspend_enter(suspend_state_t state, bool *wakeup)
|
||||
arch_suspend_disable_irqs();
|
||||
BUG_ON(!irqs_disabled());
|
||||
|
||||
system_state = SYSTEM_SUSPEND;
|
||||
|
||||
error = syscore_suspend();
|
||||
if (!error) {
|
||||
*wakeup = pm_wakeup_pending();
|
||||
@ -457,6 +459,8 @@ static int suspend_enter(suspend_state_t state, bool *wakeup)
|
||||
syscore_resume();
|
||||
}
|
||||
|
||||
system_state = SYSTEM_RUNNING;
|
||||
|
||||
arch_suspend_enable_irqs();
|
||||
BUG_ON(irqs_disabled());
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user