File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -533,6 +533,8 @@ int suspend_devices_and_enter(suspend_state_t state)
533533 goto Resume_devices ;
534534}
535535
536+ unsigned int resume_delay = 3000 ;
537+
536538/**
537539 * suspend_finish - Clean up before finishing the suspend sequence.
538540 *
@@ -541,6 +543,15 @@ int suspend_devices_and_enter(suspend_state_t state)
541543 */
542544static void suspend_finish (void )
543545{
546+ if (resume_delay ) {
547+ /* Give kernel threads a head start, such that usb-storage
548+ * can detect devices before syslog attempts to write log
549+ * messages from the suspend code.
550+ */
551+ thaw_kernel_threads ();
552+ pr_debug ("PM: Sleeping for %d milliseconds.\n" , resume_delay );
553+ msleep (resume_delay );
554+ }
544555 suspend_thaw_processes ();
545556 pm_notifier_call_chain (PM_POST_SUSPEND );
546557 pm_restore_console ();
Original file line number Diff line number Diff line change @@ -315,7 +315,16 @@ static int min_extfrag_threshold;
315315static int max_extfrag_threshold = 1000 ;
316316#endif
317317
318+ extern unsigned int resume_delay ;
319+
318320static struct ctl_table kern_table [] = {
321+ {
322+ .procname = "resume_delay" ,
323+ .data = & resume_delay ,
324+ .maxlen = sizeof (unsigned int ),
325+ .mode = 0644 ,
326+ .proc_handler = proc_dointvec ,
327+ },
319328 {
320329 .procname = "sched_child_runs_first" ,
321330 .data = & sysctl_sched_child_runs_first ,
You can’t perform that action at this time.
0 commit comments