Re: [PATCH] PM: hibernate: Don't lose create_image() errors to arch_resume_nosmt()
From: Cole Leavitt
Date: Fri Nov 13 2026 - 14:19:32 EST
On Fri, Nov 13, 2026 at 7:15 PM Rafael J. Wysocki (Intel) <rafael@xxxxxxxxxx> wrote:
> Sashiko has feedback on this that needs to be addressed:
>
> https://sashiko.dev/#/patchset/20261018164004.132785-1-cole%40unwrap.rs
Thanks for pointing me to it. Sashiko is right that devices are resumed
with PMSG_RESTORE when hibernation aborts before the image is taken,
because in_suspend is only set right before swsusp_arch_suspend(). This
is older than my patch: before it, arch_resume_nosmt() reset error to 0
on those paths and the message was PMSG_RESTORE as well. A dpm_suspend()
failure in hibernation_snapshot() gets the same message.
I don't think the suggested fix of choosing PMSG_RECOVER whenever error
is set is right, though. arch_resume_nosmt() can also fail after a real
restore, and there the devices need their ->restore*() callbacks.
I'll send a v2 with a separate patch that records whether the snapshot
was taken and uses PMSG_RECOVER only for errors before that point. v2
also adds a patch that makes a wakeup event pending after
syscore_suspend() fail image creation with -EBUSY. That case currently
returns 0 and is reported as a successful restore.
Thanks,
Cole