2019-02-16 18:26:57 +00:00
|
|
|
From 435f85177927de909ca399f0935d6f5d3b2bd08f Mon Sep 17 00:00:00 2001
|
2019-01-27 16:01:27 +00:00
|
|
|
From: Jake Day <jake@ninebysix.com>
|
2019-02-16 18:26:57 +00:00
|
|
|
Date: Sat, 16 Feb 2019 13:23:22 -0500
|
2019-01-27 16:01:27 +00:00
|
|
|
Subject: [PATCH 02/11] resume-delay
|
|
|
|
|
|
|
|
---
|
|
|
|
kernel/power/suspend.c | 11 +++++++++++
|
|
|
|
kernel/sysctl.c | 9 +++++++++
|
|
|
|
2 files changed, 20 insertions(+)
|
|
|
|
|
|
|
|
diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c
|
|
|
|
index 0bd595a0b610..a8385e8894a5 100644
|
|
|
|
--- a/kernel/power/suspend.c
|
|
|
|
+++ b/kernel/power/suspend.c
|
|
|
|
@@ -526,6 +526,8 @@ int suspend_devices_and_enter(suspend_state_t state)
|
|
|
|
goto Resume_devices;
|
|
|
|
}
|
|
|
|
|
|
|
|
+unsigned int resume_delay = 3000;
|
|
|
|
+
|
|
|
|
/**
|
|
|
|
* suspend_finish - Clean up before finishing the suspend sequence.
|
|
|
|
*
|
|
|
|
@@ -534,6 +536,15 @@ int suspend_devices_and_enter(suspend_state_t state)
|
|
|
|
*/
|
|
|
|
static void suspend_finish(void)
|
|
|
|
{
|
|
|
|
+ if (resume_delay) {
|
|
|
|
+ /* Give kernel threads a head start, such that usb-storage
|
|
|
|
+ * can detect devices before syslog attempts to write log
|
|
|
|
+ * messages from the suspend code.
|
|
|
|
+ */
|
|
|
|
+ thaw_kernel_threads();
|
|
|
|
+ pr_debug("PM: Sleeping for %d milliseconds.\n", resume_delay);
|
|
|
|
+ msleep(resume_delay);
|
|
|
|
+ }
|
|
|
|
suspend_thaw_processes();
|
|
|
|
pm_notifier_call_chain(PM_POST_SUSPEND);
|
|
|
|
pm_restore_console();
|
|
|
|
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
|
2019-02-16 18:26:57 +00:00
|
|
|
index 32dea29d05a0..96043d4b4b1f 100644
|
2019-01-27 16:01:27 +00:00
|
|
|
--- a/kernel/sysctl.c
|
|
|
|
+++ b/kernel/sysctl.c
|
|
|
|
@@ -311,7 +311,16 @@ static int min_extfrag_threshold;
|
|
|
|
static int max_extfrag_threshold = 1000;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
+extern unsigned int resume_delay;
|
|
|
|
+
|
|
|
|
static struct ctl_table kern_table[] = {
|
|
|
|
+ {
|
|
|
|
+ .procname = "resume_delay",
|
|
|
|
+ .data = &resume_delay,
|
|
|
|
+ .maxlen = sizeof(unsigned int),
|
|
|
|
+ .mode = 0644,
|
|
|
|
+ .proc_handler = proc_dointvec,
|
|
|
|
+ },
|
|
|
|
{
|
|
|
|
.procname = "sched_child_runs_first",
|
|
|
|
.data = &sysctl_sched_child_runs_first,
|
|
|
|
--
|
2019-02-16 18:26:57 +00:00
|
|
|
2.19.1
|
2019-01-27 16:01:27 +00:00
|
|
|
|