From: Haowen Tu <tuhaowen@uniontech.com>
To: laurent.pinchart@ideasonboard.com
Cc: 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,
rafael@kernel.org, stern@rowland.harvard.edu,
tuhaowen@uniontech.com
Subject: Re: [PATCH v3 3/3] media: uvcvideo: skip streaming restart after hibernation snapshot
Date: Thu, 23 Jul 2026 09:39:55 +0800 [thread overview]
Message-ID: <20260723013955.3724344-1-tuhaowen@uniontech.com> (raw)
In-Reply-To: <20260722200620.GC648629@killaraus.ideasonboard.com>
Hi Laurent,
On Wed, Jul 22, 2026 at 11:06:20PM +0300, Laurent Pinchart wrote:
> On Thu, Jun 18, 2026 at 09:31:33AM +0800, Haowen Tu wrote:
> > After the hibernation snapshot is created, devices are resumed with
> > PMSG_THAW before the image is written and the system is powered off.
> > Restarting an active UVC stream during this phase reinitializes the
> > camera and visibly turns its indicator LED back on.
> >
> > Skip only the UVC streaming hardware restart while the snapshot is
> > available. The driver's frozen state and clock are still updated before
> > the check, and a subsequent UVC suspend can stop the stream and select
> > alternate setting 0 as usual.
>
> Why is that desired (both the decision to only block the resume of the
> video interface, and the decision to not block the next suspend) ?
The intention is not to block the whole video interface resume callback.
The callback still clears stream->frozen and resets the stream clock
before the new check. The patch only skips the final streaming hardware
restart, namely uvc_commit_video() and uvc_video_start_transfer().
In the earlier version the check was placed before those state updates.
After Oliver pointed out the image write failure path, I moved it later
in uvc_video_resume(). If swsusp_write() fails, the system continues
running in the original kernel, and the driver should not be left with
stream->frozen still set from the preceding FREEZE suspend.
That is the part that reconfigures the camera and restarts USB video
transfers, which is what turns the camera indicator LED back on during
the hibernation image-write phase. The control interface resume path is
left unchanged because it is not the source of that visible side effect,
and because I do not want to change more of the UVC PM flow than needed
for this case.
The later suspend is also intentionally left unchanged. The patch should
not alter the PM core sequencing. If the platform hibernation path or an
error recovery path later asks the UVC streaming interface to suspend
again, uvc_video_suspend() can still run the existing cleanup path and
select alternate setting 0 as usual. This keeps the interface in the
same state that the existing suspend path expects, instead of introducing
a special case where the later suspend is skipped too.
> > uvcvideo does not provide a shutdown
> > callback that requires the streaming hardware to be restarted first.
> >
> > This is a device-specific use of pm_hibernation_snapshot_done(). The
> > helper does not cause other drivers or USB core to skip THAW resume.
>
> I don't think this sentence belongs to the commit message.
Agreed, I can drop that sentence from the commit message in the next
version. It belongs more in the cover letter, if anywhere.
Thanks,
Haowen
next prev parent reply other threads:[~2026-07-23 1:40 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20260428080513.1833515-1-tuhaowen@uniontech.com>
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 [this message]
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-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=20260723013955.3724344-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