From: Haowen Tu <tuhaowen@uniontech.com>
To: rafael@kernel.org
Cc: lenb@kernel.org, pavel@kernel.org, linux-pm@vger.kernel.org,
laurent.pinchart@ideasonboard.com, hansg@kernel.org,
mchehab@kernel.org, linux-media@vger.kernel.org,
gregkh@linuxfoundation.org, stern@rowland.harvard.edu,
oneukum@suse.com, linux-usb@vger.kernel.org,
linux-kernel@vger.kernel.org, kernel@uniontech.com,
Haowen Tu <tuhaowen@uniontech.com>
Subject: [PATCH v2 0/2] PM: hibernate: skip UVC resume after snapshot
Date: Thu, 28 May 2026 16:18:38 +0800 [thread overview]
Message-ID: <20260528081840.3528089-1-tuhaowen@uniontech.com> (raw)
In-Reply-To: <20260428080513.1833515-1-tuhaowen@uniontech.com>
During hibernation, after the memory snapshot has been created, the
kernel briefly resumes devices with PMSG_THAW to write the snapshot to
storage before powering off. USB driver resume callbacks do not receive
the hibernation PM message, so uvcvideo cannot distinguish this transient
image-write phase from the final restore path.
This series adds pm_hibernation_snapshot_done() and uses it in uvcvideo
to avoid reinitializing the camera during the image-write phase.
This is not intended to make every leaf driver special-case hibernation
THAW. A generic USB-core skip would not be safe because some USB
interfaces may be part of the storage path, or otherwise be required by
dependencies during image writeout. The helper is an opt-in mechanism
for drivers with a concrete reason to avoid reinitializing hardware in
this transient phase. In this case, uvcvideo has a user-visible side
effect, the camera indicator LED, while the camera is not part of the
image writeout path.
Changes in v2:
- Rename pm_hibernation_storing_image() to
pm_hibernation_snapshot_done().
- Clear in_suspend before releasing snapshot memory on the hibernation
failure paths and after swsusp_write() returns.
- Update the uvcvideo call site for the new helper name.
Haowen Tu (2):
PM: hibernate: add pm_hibernation_snapshot_done() helper
media: uvcvideo: skip resume after hibernation snapshot
drivers/media/usb/uvc/uvc_video.c | 12 ++++++++++++
include/linux/suspend.h | 2 ++
kernel/power/hibernate.c | 31 +++++++++++++++++++++++++++----
3 files changed, 41 insertions(+), 4 deletions(-)
--
2.20.1
next parent reply other threads:[~2026-05-28 8:19 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20260428080513.1833515-1-tuhaowen@uniontech.com>
2026-05-28 8:18 ` Haowen Tu [this message]
2026-05-28 8:18 ` [PATCH v2 1/2] PM: hibernate: add pm_hibernation_snapshot_done() helper Haowen Tu
2026-06-01 18:22 ` Rafael J. Wysocki
2026-06-02 3:24 ` Haowen Tu
2026-05-28 8:18 ` [PATCH v2 2/2] media: uvcvideo: skip resume after hibernation snapshot Haowen Tu
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=20260528081840.3528089-1-tuhaowen@uniontech.com \
--to=tuhaowen@uniontech.com \
--cc=gregkh@linuxfoundation.org \
--cc=hansg@kernel.org \
--cc=kernel@uniontech.com \
--cc=laurent.pinchart@ideasonboard.com \
--cc=lenb@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=oneukum@suse.com \
--cc=pavel@kernel.org \
--cc=rafael@kernel.org \
--cc=stern@rowland.harvard.edu \
/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