[PATCH v3 0/3] PM: hibernate: skip UVC streaming restart after snapshot

From: Haowen Tu

Date: Wed Jun 17 2026 - 21:33:22 EST


After a hibernation snapshot is created, devices are resumed with
PMSG_THAW before the image is written and the system is powered off.
USB interface driver resume callbacks do not receive the PM event, so
they cannot distinguish this phase from PMSG_RESTORE.

This series first makes the lifetime represented by in_suspend match the
snapshot memory lifetime, then exposes that state through
pm_hibernation_snapshot_done(). The helper only exposes the PM state;
drivers remain responsible for deciding whether device-specific behavior
is safe, including subsequent poweroff or shutdown handling.

As the first user, uvcvideo skips only restarting active streaming
hardware during the transient THAW phase. Its frozen state and clock are
still updated, a subsequent UVC suspend can stop the stream as usual,
and uvcvideo does not provide a shutdown callback that requires the
streaming hardware to be restarted first.

Changes in v3:
- Split the in_suspend cleanup into a separate patch, as requested by
Rafael.
- Reword the helper description to clarify that it only exposes PM
state and that callers must account for poweroff/shutdown handling.
- Restrict the UVC description to skipping the streaming hardware
restart and explain why it does not prevent UVC shutdown handling.
- Drop extern from the new prototype to satisfy Media CI checkpatch.

Changes in v2:
- Rename pm_hibernation_storing_image() to
pm_hibernation_snapshot_done().
- Clear in_suspend before releasing snapshot memory on failure paths and
after swsusp_write() returns.
- Move the UVC check after clearing the frozen state and resetting its
clock.

Haowen Tu (3):
PM: hibernate: clear in_suspend before freeing the snapshot
PM: hibernate: add pm_hibernation_snapshot_done() helper
media: uvcvideo: skip streaming restart after hibernation snapshot

drivers/media/usb/uvc/uvc_video.c | 8 ++++++++
include/linux/suspend.h | 2 ++
kernel/power/hibernate.c | 24 ++++++++++++++++++++----
3 files changed, 30 insertions(+), 4 deletions(-)

--
2.20.1