From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bg5.exmail.qq.com (bg5.exmail.qq.com [43.154.197.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6F8397478 for ; Thu, 23 Jul 2026 01:43:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=43.154.197.177 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784771010; cv=none; b=cQ77MCCYlqcmZO5FRepclrMJCULP3Ma2CiyKenyKn1S9CwvnYJgEtJIm8cvzUldLY3zwtWXYMX5fjH49co2/NJpmfp+Yij2pV36PMPbXpWtGw1Pee+cbrzuxPrI7Y7iQuvEcnHEQQ8wlVGy8/2vFN69lw0pNdLZviHmiA+heye4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784771010; c=relaxed/simple; bh=tDiVFKZNRc4Xa4VPQB5587fGdq0BGe1G0rK39Z3yEBg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=nojD9ern3fw6e3H3w6rK1DpDydaG2pLUM7BBiKE9YcFfHiprGdz8erEr+fVyFYVXdtd+c3LdaIwQSrA5+vIUEX8MHewdaXRQ36qCG/0237jyFryohTkzgqg1CTWtXGyCtwgTAVmgudCTdOamGftTayHWcGeZ+/ntUqcAITkz4uc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=uniontech.com; spf=pass smtp.mailfrom=uniontech.com; dkim=pass (1024-bit key) header.d=uniontech.com header.i=@uniontech.com header.b=JR/dM8XI; arc=none smtp.client-ip=43.154.197.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=uniontech.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=uniontech.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=uniontech.com header.i=@uniontech.com header.b="JR/dM8XI" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=uniontech.com; s=onoh2408; t=1784770817; bh=39BXAVAV22NPOzYN+mKCQLJtCYn25wFR01/w/75Csns=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=JR/dM8XIli+6YHmrt/sYQwFKmZw15SgVyPk3UDwhKbYYtMMGkGV7TkwMEnx7URUOY qtV2/CT8AsapVvlzGnAC8t7GYQN8mEcRz1ROma52PaEyV2Tnst4noNOxoJA8SpxBf1 RgGd69m5eKTuGnBS4l5UFEOFarEPXSjzXArXfAGw= X-QQ-mid: zesmtpgz7t1784770801t1c349629 X-QQ-Originating-IP: tTDg4oK26foSmXmz/lkoC55/Q2YBBwv5cAWyXcflEm4= Received: from localhost.localdomain ( [113.57.152.160]) by bizesmtp.qq.com (ESMTP) with id ; Thu, 23 Jul 2026 09:39:58 +0800 (CST) X-QQ-SSF: 0000000000000000000000000000000 X-QQ-GoodBg: 1 X-BIZMAIL-ID: 2330629455518813040 EX-QQ-RecipientCnt: 15 From: Haowen Tu 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 Message-Id: <20260723013955.3724344-1-tuhaowen@uniontech.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20260722200620.GC648629@killaraus.ideasonboard.com> References: <20260618013133.1047270-4-tuhaowen@uniontech.com> <20260722200620.GC648629@killaraus.ideasonboard.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-QQ-SENDSIZE: 520 Feedback-ID: zesmtpgz:uniontech.com:qybglogicsvrsz:qybglogicsvrsz3b-0 X-QQ-XMAILINFO: N5B2KL7CljI0KOBNHLUtBe/eZsBduW+kRTzFgxEtsGodnz+sA//+KcdR NGEP/l9dwr6k6lYcUNw6yiKBiqK8QdGAM1PBApSrPB1aWO60VgmIVxUG4vPzA0lHyz7Vrxi eoUPXq8F18UftiizEa/1PiiwJRYc03WdNCQHQmSm64Ea10RGMiJW+Jq3MFDa3+2gYkqhdaV DD9IH4iPpSV3fGWvKWKlLcC4VbH8vHw622eoldiCUW7Dfh3Uo6VDqQIPmUY9K2+JYwelpwT ulCsM4Lfh+ptDDHBdQKgEBqu7xS0mdn40exAY53XEgN+YbkXas2xymiC9YmjGAtSvL+pw0A q2msrHEQQcB6kQcaZYG71Xu4yhj/q4MxxGAJgfcmtLYSMeHb/6MUXCf8akk4DXgUx2nlqsZ w/IJgcE42YVdFBNLu5YN0a9TFt8H/8E8EBIuXFVT/JlZq8ddhIXOJdy9QWXI4dWNmiNO11p gqSxYoVhHjpD6hjRqFPgEuIvbt850G4uaQOXB10iYdXrgqIbjE8aPRXCinBRN8kYq32rETZ 0DyW23u2vhhsKG0uNfLnEre6pgHYAFiNnkl2sL2Xx+MyRiHh66yXkVHCYfVGux2V/R/M8HM TVdinFqzEQUk55yPVlVCNoTP4ePeobbCB0zmLlvO8eOXCcPZZ8UDgDD8PwbLRIZFqqsYat7 hsYyiqbnyAZolqqdh8dTDHIRzM2lQ5kvVsw2ZOOIhgSdneLkge/Arodrj9N8EEr/pdk6evP 63Prs1Z9FVY0ro7obHWqNIURoZaaF9Me3owTSLEov6ebHCYvHzwpp/hzBnQXlVfY06dCzJo L2bbFEKKPudzzF5/dCXkgdnMqzuiS23QF2JD1iSc+a26OL/Ps10HxOsHKQBxA4Hrnwqhc5Y seAsCEmxG/76jvcZMyCB9iK5lgWrR1ckO9ztu5EZHxd9M0rH8p3FJ/CCOo5AgaQHKWeMqbu HmwJLP0enlT+EmYkm36wiqAALiw0JBuX2EfnbZTbbg5N8HheQP9u5Rq1pcEyXOdeB+lqjSa yT/W9VXSWEbEZWbxzH60fxtgE7OyU= X-QQ-XMRINFO: NS+P29fieYNwqS3WCnRCOn9D1NpZuCnCRA== X-QQ-RECHKSPAM: 0 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