Skip to content

Commit 3904bdf

Browse files
dcuigregkh
authored andcommitted
PM: hibernate: Freeze kernel threads in software_resume()
commit 2351f8d upstream. Currently the kernel threads are not frozen in software_resume(), so between dpm_suspend_start(PMSG_QUIESCE) and resume_target_kernel(), system_freezable_power_efficient_wq can still try to submit SCSI commands and this can cause a panic since the low level SCSI driver (e.g. hv_storvsc) has quiesced the SCSI adapter and can not accept any SCSI commands: https://lkml.org/lkml/2020/4/10/47 At first I posted a fix (https://lkml.org/lkml/2020/4/21/1318) trying to resolve the issue from hv_storvsc, but with the help of Bart Van Assche, I realized it's better to fix software_resume(), since this looks like a generic issue, not only pertaining to SCSI. Cc: All applicable <[email protected]> Signed-off-by: Dexuan Cui <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 2484110 commit 3904bdf

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

kernel/power/hibernate.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -901,6 +901,13 @@ static int software_resume(void)
901901
error = freeze_processes();
902902
if (error)
903903
goto Close_Finish;
904+
905+
error = freeze_kernel_threads();
906+
if (error) {
907+
thaw_processes();
908+
goto Close_Finish;
909+
}
910+
904911
error = load_image_and_restore();
905912
thaw_processes();
906913
Finish:

0 commit comments

Comments
 (0)