Patch "PM: hibernate: Freeze kernel threads in software_resume()" has been added to the 5.6-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    PM: hibernate: Freeze kernel threads in software_resume()

to the 5.6-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     pm-hibernate-freeze-kernel-threads-in-software_resum.patch
and it can be found in the queue-5.6 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 1471f6ab6211afc62512151a8965fb6787421b37
Author: Dexuan Cui <decui@xxxxxxxxxxxxx>
Date:   Thu Apr 23 20:40:16 2020 -0700

    PM: hibernate: Freeze kernel threads in software_resume()
    
    commit 2351f8d295ed63393190e39c2f7c1fee1a80578f 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 <stable@xxxxxxxxxxxxxxx>
    Signed-off-by: Dexuan Cui <decui@xxxxxxxxxxxxx>
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@xxxxxxxxx>
    Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>

diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c
index 6dbeedb7354cc..daf3ea9d81de8 100644
--- a/kernel/power/hibernate.c
+++ b/kernel/power/hibernate.c
@@ -898,6 +898,13 @@ static int software_resume(void)
 	error = freeze_processes();
 	if (error)
 		goto Close_Finish;
+
+	error = freeze_kernel_threads();
+	if (error) {
+		thaw_processes();
+		goto Close_Finish;
+	}
+
 	error = load_image_and_restore();
 	thaw_processes();
  Finish:



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux