stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: decui@microsoft.com
Cc: linux-pm@vger.kernel.org, len.brown@intel.com, pavel@ucw.cz,
	bvanassche@acm.org, mikelley@microsoft.com, longli@microsoft.com,
	linux-kernel@vger.kernel.org, ming.lei@redhat.com,
	wei.liu@kernel.org, sthemmin@microsoft.com,
	haiyangz@microsoft.com, kys@microsoft.com,
	stable@vger.kernel.org
Subject: Re: [PATCH] PM: hibernate: Freeze kernel threads in software_resume()
Date: Sun, 26 Apr 2020 18:24:14 +0200	[thread overview]
Message-ID: <2420808.aENraY2TMt@kreacher> (raw)
In-Reply-To: <20200424034016.42046-1-decui@microsoft.com>

On Friday, April 24, 2020 5:40:16 AM CEST Dexuan Cui wrote:
> 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: Bart Van Assche <bvanassche@acm.org>
> Cc: stable@vger.kernel.org
> Signed-off-by: Dexuan Cui <decui@microsoft.com>
> ---
>  kernel/power/hibernate.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c
> index 86aba8706b16..30bd28d1d418 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:
> 

Applied as a fix for 5.7-rc4, thanks!




  parent reply	other threads:[~2020-04-26 16:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-24  3:40 [PATCH] PM: hibernate: Freeze kernel threads in software_resume() Dexuan Cui
2020-04-26 15:03 ` Sasha Levin
2020-04-26 16:24 ` Rafael J. Wysocki [this message]
2020-04-26 18:33   ` Bart Van Assche
2020-04-27  0:58     ` Dexuan Cui
2020-04-27  8:43     ` Rafael J. Wysocki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2420808.aENraY2TMt@kreacher \
    --to=rjw@rjwysocki.net \
    --cc=bvanassche@acm.org \
    --cc=decui@microsoft.com \
    --cc=haiyangz@microsoft.com \
    --cc=kys@microsoft.com \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=longli@microsoft.com \
    --cc=mikelley@microsoft.com \
    --cc=ming.lei@redhat.com \
    --cc=pavel@ucw.cz \
    --cc=stable@vger.kernel.org \
    --cc=sthemmin@microsoft.com \
    --cc=wei.liu@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).