The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Haowen Tu <tuhaowen@uniontech.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
Subject: Re: [PATCH v3 3/3] media: uvcvideo: skip streaming restart after hibernation snapshot
Date: Thu, 23 Jul 2026 11:46:33 +0300	[thread overview]
Message-ID: <20260723084633.GE648629@killaraus.ideasonboard.com> (raw)
In-Reply-To: <20260723013955.3724344-1-tuhaowen@uniontech.com>

On Thu, Jul 23, 2026 at 09:39:55AM +0800, Haowen Tu wrote:
> 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().

Yes, I understand what the patch does.

> 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.

Does that mean that, if swsusp_write() fails, the camera will be left in
a hybrid state where the control interface has been resumed but the
streaming interface will not have been restarted ?

> 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.

-- 
Regards,

Laurent Pinchart

  reply	other threads:[~2026-07-23  8:46 UTC|newest]

Thread overview: 23+ 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 [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=20260723084633.GE648629@killaraus.ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hansg@kernel.org \
    --cc=kernel@uniontech.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 \
    --cc=tuhaowen@uniontech.com \
    /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