Linux Power Management development
 help / color / mirror / Atom feed
* [PATCH 0/2] PM: hibernate: add helper to detect image-write phase
@ 2026-04-28  8:05 Haowen Tu
  2026-04-28  8:05 ` [PATCH 1/2] PM: hibernate: add pm_hibernation_storing_image() helper Haowen Tu
                   ` (2 more replies)
  0 siblings, 3 replies; 21+ messages in thread
From: Haowen Tu @ 2026-04-28  8:05 UTC (permalink / raw)
  To: rafael
  Cc: lenb, pavel, linux-pm, laurent.pinchart, hansg, mchehab,
	linux-media, linux-kernel, Haowen Tu

During S4 hibernation, after create_image() saves the memory snapshot,
the kernel resumes devices with PMSG_THAW solely to write the hibernation
image to storage before final powerdown.  Drivers unrelated to storage I/O
have no reason to reinitialize during this transient phase.

Drivers using dev_pm_ops already have separate .thaw and .restore
callbacks and can handle this natively.  However, usb_driver.resume
takes no pm_message_t argument, so a USB driver cannot distinguish
PMSG_THAW from PMSG_RESTORE without an out-of-band query.

This series adds pm_hibernation_storing_image(), a small helper that
returns true during the image-write window.  As a first user, the UVC
driver uses it to skip resume in uvc_video_resume() until the real
PMSG_RESTORE wake-up.

Tested with hibernation image written to local storage and resumed from
disk on a system with a USB UVC camera attached.

Haowen Tu (2):
  pm/hibernate: add pm_hibernation_storing_image() helper
  media: uvcvideo: skip resume when writing hibernation image

 drivers/media/usb/uvc/uvc_video.c | 10 ++++++++++
 include/linux/suspend.h           |  2 ++
 kernel/power/hibernate.c          | 19 +++++++++++++++++++
 3 files changed, 31 insertions(+)

-- 
2.20.1


^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2026-07-22 20:06 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-28  8:05 [PATCH 0/2] PM: hibernate: add helper to detect image-write phase Haowen Tu
2026-04-28  8:05 ` [PATCH 1/2] PM: hibernate: add pm_hibernation_storing_image() helper Haowen Tu
2026-05-26 13:43   ` Rafael J. Wysocki
2026-04-28  8:05 ` [PATCH 2/2] media: uvcvideo: skip resume when writing hibernation image Haowen Tu
2026-04-28  8:36   ` Oliver Neukum
2026-04-28  8:58     ` Haowen Tu
2026-04-28  9:13   ` Laurent Pinchart
2026-04-29  1:15     ` Haowen Tu
2026-04-29  1:16     ` Haowen Tu
2026-05-28  8:18 ` [PATCH v2 0/2] PM: hibernate: skip UVC resume after snapshot Haowen Tu
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-06-18  1:31         ` [PATCH v3 0/3] PM: hibernate: skip UVC streaming restart after snapshot Haowen Tu
2026-06-18  1:31           ` [PATCH v3 1/3] PM: hibernate: clear in_suspend before freeing the snapshot Haowen Tu
2026-07-22 15:37             ` Rafael J. Wysocki (Intel)
2026-06-18  1:31           ` [PATCH v3 2/3] PM: hibernate: add pm_hibernation_snapshot_done() helper Haowen Tu
2026-07-22 15:40             ` Rafael J. Wysocki (Intel)
2026-06-18  1:31           ` [PATCH v3 3/3] media: uvcvideo: skip streaming restart after hibernation snapshot Haowen Tu
2026-07-22 20:06             ` Laurent Pinchart
2026-05-28  8:18   ` [PATCH v2 2/2] media: uvcvideo: skip resume " Haowen Tu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox