From: Haowen Tu <tuhaowen@uniontech.com>
To: laurent.pinchart@ideasonboard.com, stern@rowland.harvard.edu,
rafael@kernel.org
Cc: tuhaowen@uniontech.com, gregkh@linuxfoundation.org,
hansg@kernel.org, kernel@uniontech.com, lenb@kernel.org,
linux-kernel@vger.kernel.org, linux-media@vger.kernel.org,
linux-pm@vger.kernel.org, linux-usb@vger.kernel.org,
mchehab@kernel.org, oneukum@suse.com, pavel@kernel.org
Subject: Re: [PATCH v4 4/4] media: uvcvideo: defer streaming restart after hibernation snapshot
Date: Fri, 31 Jul 2026 09:30:24 +0800 [thread overview]
Message-ID: <20260731013024.1577337-1-tuhaowen@uniontech.com> (raw)
In-Reply-To: <20260730153817.GA1555869@killaraus.ideasonboard.com>
Hi Laurent, Alan,
On Thu, Jul 30, 2026 at 06:38:17PM +0300, Laurent Pinchart wrote:
> Something like that. I'm very biased as I mostly work on multimedia
> devices, but it feels to me that for many drivers the current
> hibernation procedure is too complex. Those drivers don't need to
> differentiate suspend and hibernation, they only need to be instructed
> to suspend at some point, and resume later. Resuming could occur when
> the system is woken up, or when hibernation fails in the THAW phase, and
> those drivers wouldn't care to differentiate between the two. Seeing an
> extra resume + suspend cycle due to the hibernation machinery needing to
> write the image to disk, and having to handle that cycle manually as in
> this series, is additional complexity that (unless I'm missing
> something) could be handled by the PM core.
I agree. This was actually close to what I considered before trying the
smaller UVC-specific approach.
My initial thought was that the PM core could distinguish the
post-snapshot resume used for writing the hibernation image from the
later path where the original kernel continues running. In that model,
devices that do not need to be resumed during the image-write phase
could be marked accordingly. They would remain suspended after FREEZE,
and would only be resumed if the original kernel continues running
instead of powering down.
That would avoid making each driver open-code the same kind of
post-snapshot THAW check and recovery handling. It would also avoid the
notifier ordering issue in v4, because the PM core would keep the normal
device ordering when resuming the skipped devices.
The reason I did not start with that approach is that it looked like a
larger PM core change. It needs a clear definition of which devices need
to be resumed for hibernation image writeout, and it needs to preserve
parent-device and storage-stack dependencies. It also needs to handle
the case Alan mentioned, where the restore kernel cannot restore the
image and sends THAW before continuing; that path should not be skipped
in the same way as the post-snapshot image-writeout resume.
So v4 was an attempt to keep the change local to the observed UVC issue
while still handling the swsusp_write() failure path. But I agree that,
if this is viewed as a more general PM problem, a PM-core solution with
an explicit skip and recovery mechanism would be cleaner than a UVC
notifier.
Rafael, would such a PM-core direction be acceptable to explore? For
example, a device flag indicating that the device does not need to be
resumed during the post-snapshot image-write phase, with PM resuming
those skipped devices if the original kernel continues running, before
userspace is thawed?
If that direction is preferred, I can rework the series around a
PM-core-managed mechanism.
Thanks,
Haowen
next prev parent reply other threads:[~2026-07-31 1:30 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
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-07-23 1:39 ` Haowen Tu
2026-07-23 8:46 ` Laurent Pinchart
2026-07-29 7:11 ` [PATCH v4 0/4] PM: hibernate: defer UVC streaming restart after snapshot Haowen Tu
2026-07-29 7:11 ` [PATCH v4 1/4] PM: hibernate: clear in_suspend before freeing the snapshot Haowen Tu
2026-07-29 7:11 ` [PATCH v4 2/4] PM: hibernate: add pm_hibernation_snapshot_done() helper Haowen Tu
2026-07-29 7:11 ` [PATCH v4 3/4] PM: hibernate: notify on image write failure Haowen Tu
2026-07-29 7:11 ` [PATCH v4 4/4] media: uvcvideo: defer streaming restart after hibernation snapshot Haowen Tu
2026-07-29 7:29 ` Hans de Goede
2026-07-29 7:56 ` Haowen Tu
2026-07-29 14:08 ` Alan Stern
2026-07-29 14:43 ` Oliver Neukum
2026-07-29 14:54 ` Alan Stern
2026-07-30 13:16 ` Laurent Pinchart
2026-07-30 14:29 ` Alan Stern
2026-07-30 15:38 ` Laurent Pinchart
2026-07-31 1:30 ` Haowen Tu [this message]
2026-05-28 8:18 ` [PATCH v2 2/2] media: uvcvideo: skip resume " 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=20260731013024.1577337-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