public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH AUTOSEL 6.19-6.12] media: ipu6: Close firmware streams on streaming enable failure
@ 2026-02-14  0:58 Sasha Levin
  2026-02-14  0:58 ` [PATCH AUTOSEL 6.19-6.12] media: chips-media: wave5: Fix conditional in start_streaming Sasha Levin
                   ` (15 more replies)
  0 siblings, 16 replies; 17+ messages in thread
From: Sasha Levin @ 2026-02-14  0:58 UTC (permalink / raw)
  To: patches, stable
  Cc: Sakari Ailus, Bingbu Cao, Mehdi Djait, Hans Verkuil, Sasha Levin,
	linux-media

From: Sakari Ailus <sakari.ailus@linux.intel.com>

[ 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 <sakari.ailus@linux.intel.com>
Reviewed-by: Bingbu Cao <bingbu.cao@intel.com>
Tested-by: Mehdi Djait <mehdi.djait@linux.intel.com> # Dell XPS 9315
Reviewed-by: Mehdi Djait <mehdi.djait@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---

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


^ permalink raw reply related	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2026-02-14  1:07 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-14  0:58 [PATCH AUTOSEL 6.19-6.12] media: ipu6: Close firmware streams on streaming enable failure Sasha Levin
2026-02-14  0:58 ` [PATCH AUTOSEL 6.19-6.12] media: chips-media: wave5: Fix conditional in start_streaming Sasha Levin
2026-02-14  0:58 ` [PATCH AUTOSEL 6.19-6.12] media: mt9m114: Avoid a reset low spike during probe() Sasha Levin
2026-02-14  0:58 ` [PATCH AUTOSEL 6.19-6.1] media: amphion: Clear last_buffer_dequeued flag for DEC_CMD_START Sasha Levin
2026-02-14  0:58 ` [PATCH AUTOSEL 6.19-5.10] media: adv7180: fix frame interval in progressive mode Sasha Levin
2026-02-14  0:58 ` [PATCH AUTOSEL 6.19-6.6] media: v4l2-async: Fix error handling on steps after finding a match Sasha Levin
2026-02-14  0:58 ` [PATCH AUTOSEL 6.19-6.1] media: rkisp1: Fix filter mode register configuration Sasha Levin
2026-02-14  0:58 ` [PATCH AUTOSEL 6.19-6.12] media: ipu6: Ensure stream_mutex is acquired when dealing with node list Sasha Levin
2026-02-14  0:58 ` [PATCH AUTOSEL 6.19-6.12] media: mt9m114: Return -EPROBE_DEFER if no endpoint is found Sasha Levin
2026-02-14  0:59 ` [PATCH AUTOSEL 6.19-6.18] media: uvcvideo: Create an ID namespace for streaming output terminals Sasha Levin
2026-02-14  0:59 ` [PATCH AUTOSEL 6.19-6.12] media: ipu6: Always close firmware stream Sasha Levin
2026-02-14  0:59 ` [PATCH AUTOSEL 6.19-6.18] media: qcom: camss: Do not enable cpas fast ahb clock for SM8550 VFE lite Sasha Levin
2026-02-14  0:59 ` [PATCH AUTOSEL 6.19-5.10] media: solo6x10: Check for out of bounds chip_id Sasha Levin
2026-02-14  0:59 ` [PATCH AUTOSEL 6.19-6.18] drm/amdgpu: Refactor amdgpu_gem_va_ioctl for Handling Last Fence Update and Timeline Management v4 Sasha Levin
2026-02-14  0:59 ` [PATCH AUTOSEL 6.19-6.12] media: chips-media: wave5: Process ready frames when CMD_STOP sent to Encoder Sasha Levin
2026-02-14  0:59 ` [PATCH AUTOSEL 6.19-5.10] media: pvrusb2: fix URB leak in pvr2_send_request_ex Sasha Levin
2026-02-14  0:59 ` [PATCH AUTOSEL 6.19-5.10] media: dvb-core: dmxdevfilter must always flush bufs Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox