1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
|
int syscore_suspend(void) { struct syscore_ops *ops; int ret = 0;
trace_suspend_resume(TPS("syscore_suspend"), 0, true); pm_pr_dbg("Checking wakeup interrupts\n");
if (pm_wakeup_pending()) return -EBUSY;
WARN_ONCE(!irqs_disabled(), "Interrupts enabled before system core suspend.\n");
list_for_each_entry_reverse(ops, &syscore_ops_list, node) if (ops->suspend) { pm_pr_dbg("Calling %pS\n", ops->suspend); ret = ops->suspend(); if (ret) goto err_out; WARN_ONCE(!irqs_disabled(), "Interrupts enabled after %pS\n", ops->suspend); }
trace_suspend_resume(TPS("syscore_suspend"), 0, false); return 0;
err_out: pr_err("PM: System core suspend callback %pS failed.\n", ops->suspend);
list_for_each_entry_continue(ops, &syscore_ops_list, node) if (ops->resume) ops->resume();
return ret; }
|