From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtpbguseast1.qq.com (smtpbguseast1.qq.com [54.204.34.129]) (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 9D89437881C for ; Thu, 28 May 2026 08:19:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=54.204.34.129 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779956396; cv=none; b=C+G9XMOu4H0/mfY1YdxG/laMHetCqSXeawlubXkQJbYenIL6RhUp4xF5S6BhscieTZrkC8ZqW3YfSAq6hKw+z9MSyFZxB2h2RzrCt/d9rB5alzKrBgO8iW/4WJzN3OrsSnmLEAd60dzXxauSNM4k5AHBuitnx/6aRc8IKwysVdQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779956396; c=relaxed/simple; bh=nT7vtUkFVweXht3a+NAlINTXWJpVZFgV0zikEEBICyQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=tqcCRGB8KLNKBjyzwQlhr5GzqhME8C6pewUQp2yaj5LHrZJqqQnbLOAPPVKWrrpSnhOYglEmbQOp6OrcX/f8pMsHOTB8hSdLh+Wyw+tRp2F999BZFJM82QZpGMFrlpLjVNa9w6+8TM9fqNHSgucdo8x3ZbSIlXFmQ2m9AApagvI= 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=DdwBxxBQ; arc=none smtp.client-ip=54.204.34.129 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="DdwBxxBQ" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=uniontech.com; s=onoh2408; t=1779956347; bh=KWr/K5mP2Y58tJXieQkFjga7owiMuJEyUtjw67tfJ78=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=DdwBxxBQZlKAZkSOI0ncyTuOUmZVZvSYF+c2KJu5H/fMy4Plg8pe2x2vKJxdLYv67 sOAWiK/gG5lAqNW73QCujO5P+7ulU0sVZ3qm8e5GpzA3ZrU7/sFoThgIat492mkHdV DkD7M8pqgYg+Yt2Yz2O7I4alyC0ynGsPQFVLs17E= X-QQ-mid: zesmtpgz3t1779956333t6885fce0 X-QQ-Originating-IP: xIOo1WjjSFuC3rAr/TU7gIVukxxul7/cimwAROAwV+o= Received: from localhost.localdomain ( [113.57.152.160]) by bizesmtp.qq.com (ESMTP) with id ; Thu, 28 May 2026 16:18:51 +0800 (CST) X-QQ-SSF: 0000000000000000000000000000000 X-QQ-GoodBg: 1 X-BIZMAIL-ID: 434068552171632037 EX-QQ-RecipientCnt: 15 From: Haowen Tu To: rafael@kernel.org Cc: lenb@kernel.org, pavel@kernel.org, linux-pm@vger.kernel.org, laurent.pinchart@ideasonboard.com, hansg@kernel.org, mchehab@kernel.org, linux-media@vger.kernel.org, gregkh@linuxfoundation.org, stern@rowland.harvard.edu, oneukum@suse.com, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@uniontech.com, Haowen Tu Subject: [PATCH v2 0/2] PM: hibernate: skip UVC resume after snapshot Date: Thu, 28 May 2026 16:18:38 +0800 Message-Id: <20260528081840.3528089-1-tuhaowen@uniontech.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20260428080513.1833515-1-tuhaowen@uniontech.com> References: <20260428080513.1833515-1-tuhaowen@uniontech.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.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Kchvfjvz0Zun/K3xcLvl pJtnjjVYeoFOY1+jecGVgkxtR+nisFXt059F3ZXEhM0o0lS6LIJnSkeK3OdDewlNJfTHSgJ M1spc1o6IL7A3QmGxMu1qmf++qUKdgR6tncJrj8A== X-QQ-XMRINFO: MSVp+SPm3vtSI1QTLgDHQqIV1w2oNKDqfg== X-QQ-RECHKSPAM: 0 During hibernation, after the memory snapshot has been created, the kernel briefly resumes devices with PMSG_THAW to write the snapshot to storage before powering off. USB driver resume callbacks do not receive the hibernation PM message, so uvcvideo cannot distinguish this transient image-write phase from the final restore path. This series adds pm_hibernation_snapshot_done() and uses it in uvcvideo to avoid reinitializing the camera during the image-write phase. This is not intended to make every leaf driver special-case hibernation THAW. A generic USB-core skip would not be safe because some USB interfaces may be part of the storage path, or otherwise be required by dependencies during image writeout. The helper is an opt-in mechanism for drivers with a concrete reason to avoid reinitializing hardware in this transient phase. In this case, uvcvideo has a user-visible side effect, the camera indicator LED, while the camera is not part of the image writeout path. Changes in v2: - Rename pm_hibernation_storing_image() to pm_hibernation_snapshot_done(). - Clear in_suspend before releasing snapshot memory on the hibernation failure paths and after swsusp_write() returns. - Update the uvcvideo call site for the new helper name. Haowen Tu (2): PM: hibernate: add pm_hibernation_snapshot_done() helper media: uvcvideo: skip resume after hibernation snapshot drivers/media/usb/uvc/uvc_video.c | 12 ++++++++++++ include/linux/suspend.h | 2 ++ kernel/power/hibernate.c | 31 +++++++++++++++++++++++++++---- 3 files changed, 41 insertions(+), 4 deletions(-) -- 2.20.1