hc
2023-11-06 e3e12f52b214121840b44c91de5b3e5af5d3eb84
kernel/kernel/power/suspend.c
....@@ -620,6 +620,8 @@
620620 return error;
621621 }
622622
623
+bool pm_in_action;
624
+
623625 /**
624626 * pm_suspend - Externally visible function for suspending the system.
625627 * @state: System sleep state to enter.
....@@ -634,6 +636,7 @@
634636 if (state <= PM_SUSPEND_ON || state >= PM_SUSPEND_MAX)
635637 return -EINVAL;
636638
639
+ pm_in_action = true;
637640 pr_info("suspend entry (%s)\n", mem_sleep_labels[state]);
638641
639642 if (state == PM_SUSPEND_MEM_LITE || state == PM_SUSPEND_MEM_ULTRA)
....@@ -647,6 +650,7 @@
647650 suspend_stats.success++;
648651 }
649652 pr_info("suspend exit\n");
653
+ pm_in_action = false;
650654 return error;
651655 }
652656 EXPORT_SYMBOL(pm_suspend);