From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 E9AEA3EBF2C; Sat, 14 Feb 2026 01:02:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771030968; cv=none; b=Esy4nXOqErLpAev6DzGYDkIfYaRHLAV6L1cWSCWjkyRBcW9nqGTp482IMXvjo3Isb/ssAh3HuL+CmsTNhwcLd/SIJIj91TXpfIEpLR3VKqp0tiehFZRUzErHBNgYatdMzcHvGcjCtTZ5i7aYYztYGbgD1oezjyFefGuklWr/Ecg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771030968; c=relaxed/simple; bh=UePWfbBxgT7I3H7m3efoMmny1MCBrzsMkljxq39MG+8=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=o7ezbsZUm6IoghiB5xpB2+Trk9vmX2OG4CP4R4og313PoZ/+rx3RRUtMzQYD01PuKZVh3hMw5JLVSxskp0SNygAz+YuOVXHmp6uHjX0JIUls8dkmfBNXflIWtGgksQzINRo1D73ENkQo0kCqpMuawxv7cCJkY/KYvYwrdV6ySpc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=VoDQrvxR; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="VoDQrvxR" Received: by smtp.kernel.org (Postfix) with ESMTPSA id EAE4CC116C6; Sat, 14 Feb 2026 01:02:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1771030967; bh=UePWfbBxgT7I3H7m3efoMmny1MCBrzsMkljxq39MG+8=; h=From:To:Cc:Subject:Date:From; b=VoDQrvxRxIPXIqF379p3ekn1CgqfqdSFbkoV2ss+HNVqRh9ioOu7DOlEffIGyZS2a 5y6icfR6IrBl59gV5ya02eK7f/nuUuiU0r211BrfuDqVwb8L8Y1f/EGPBYxgypMPqI TyGTgq6IdSDKgcHh8MnBrAfFjPVJrEoclBCJF8WC3L7bbcpeKfjuUUarKL3lUsitZR 87gr2vopQU6fD65E3W3flvJIYwN+PpFxPVutUqrAomkPSX9iIe5xj4DxNKCamfaFWS Sl9iSF5PXYhZ1u9eC5gpt2Ph9Mce+cauTcEsHFJXgmLVXxuGQpBTKxLRdw2lBeye9T qhCUNdpHT0FyQ== From: Sasha Levin To: patches@lists.linux.dev, stable@vger.kernel.org Cc: Sakari Ailus , Bingbu Cao , Mehdi Djait , Hans Verkuil , Sasha Levin , linux-media@vger.kernel.org Subject: [PATCH AUTOSEL 6.19-6.12] media: ipu6: Close firmware streams on streaming enable failure Date: Fri, 13 Feb 2026 19:58:01 -0500 Message-ID: <20260214010245.3671907-1-sashal@kernel.org> X-Mailer: git-send-email 2.51.0 Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.19 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Sakari Ailus [ Upstream commit 5925a92cc70d10c7d3124923c36da09b9c1a6eeb ] When enabling streaming fails, the stream is stopped in firmware but not closed. Do this to release resources on firmware side. Signed-off-by: Sakari Ailus Reviewed-by: Bingbu Cao Tested-by: Mehdi Djait # Dell XPS 9315 Reviewed-by: Mehdi Djait Signed-off-by: Hans Verkuil Signed-off-by: Sasha Levin --- LLM Generated explanations, may be completely bogus: ## Analysis ### Commit Message Analysis The commit message is clear and directly describes a bug fix: when streaming enable fails, the firmware stream is stopped but not closed, leading to a resource leak on the firmware side. The fix adds a `close_streaming_firmware(av)` call in the error path. Key signals: - "Close firmware streams on streaming enable failure" — error path fix - "release resources on firmware side" — resource leak fix - Has **Reviewed-by** from two people (Bingbu Cao, Mehdi Djait) - Has **Tested-by** on real hardware (Dell XPS 9315) - Reviewed by subsystem maintainer (Hans Verkuil) ### Code Change Analysis The change is a **single line addition**: ```c out_media_entity_stop_streaming_firmware: stop_streaming_firmware(av); + close_streaming_firmware(av); return ret; ``` This is in the error path (`goto out_media_entity_stop_streaming_firmware`) that handles the case where `v4l2_subdev_enable_streams()` fails. The existing code already called `stop_streaming_firmware(av)` to stop the stream, but neglected to call `close_streaming_firmware(av)` to release the firmware resources. This is a classic **resource leak on error path** — one of the most common and important bug fix patterns for stable backports. The firmware stream is opened and stopped but never closed, which means firmware-side resources are leaked every time streaming enable fails. ### Classification - **Bug type**: Resource leak (firmware resources not released on error path) - **Pattern**: Missing cleanup call in error handler — a textbook error path fix - **Not a feature addition**: Just completing the error handling that should have been there ### Scope and Risk Assessment - **Lines changed**: 1 line added - **Files changed**: 1 file - **Risk**: Extremely low — adding a missing cleanup call in an error path - **Subsystem**: Intel IPU6 camera driver (media subsystem) - The fix follows the obvious pattern: the normal shutdown path presumably calls both `stop_streaming_firmware()` and `close_streaming_firmware()`, so the error path should too ### User Impact - Affects users with Intel IPU6 camera hardware (common in modern Intel laptops) - Without this fix, firmware resources leak when streaming setup fails, which could lead to the camera becoming unusable until reboot - Tested on Dell XPS 9315 — a popular laptop model ### Stability Indicators - Reviewed by two developers - Tested on real hardware - Single-line, obviously correct fix - No risk of regression — only adds cleanup that was missing ### Dependency Check The fix is self-contained. It only adds a call to `close_streaming_firmware()` which already exists in the codebase. The IPU6 driver was added in the 6.8 timeframe, so this would be relevant for stable trees that include the IPU6 driver. ### Conclusion This is a textbook stable backport candidate: 1. **Obviously correct**: The error path stops streaming but doesn't close it — the fix adds the missing close call 2. **Fixes a real bug**: Firmware resource leak on error path 3. **Small and contained**: Single line addition 4. **No new features**: Just completing error handling 5. **Well-reviewed and tested**: Multiple reviews and hardware testing 6. **Low risk**: Cannot introduce regression — only affects an error path by adding necessary cleanup **YES** drivers/media/pci/intel/ipu6/ipu6-isys-video.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/media/pci/intel/ipu6/ipu6-isys-video.c b/drivers/media/pci/intel/ipu6/ipu6-isys-video.c index dec8f5ffcfa5f..919b77107cef7 100644 --- a/drivers/media/pci/intel/ipu6/ipu6-isys-video.c +++ b/drivers/media/pci/intel/ipu6/ipu6-isys-video.c @@ -1066,6 +1066,7 @@ int ipu6_isys_video_set_streaming(struct ipu6_isys_video *av, int state, out_media_entity_stop_streaming_firmware: stop_streaming_firmware(av); + close_streaming_firmware(av); return ret; } -- 2.51.0