* [PATCH 1/2] media: qcom: camss: Fix pipeline lock leak in stop_streaming [not found] <20260125145544.50785-1-bjsaikiran@gmail.com> @ 2026-01-25 14:55 ` Saikiran 2026-01-25 15:01 ` Greg KH 2026-01-25 14:55 ` [PATCH 2/2] media: i2c: ov02c10: Check for errors in disable_streams Saikiran 1 sibling, 1 reply; 3+ messages in thread From: Saikiran @ 2026-01-25 14:55 UTC (permalink / raw) To: bjsaikiran; +Cc: stable When a browser or application closes the camera, if any subdevice fails to stop streaming, video_stop_streaming() returns early without calling video_device_pipeline_stop(). This leaves the pipeline permanently locked, preventing any future camera access until reboot. Fix this by logging errors but continuing to stop all remaining subdevices and always releasing the pipeline lock, even when errors occur during the stop sequence. Fixes: 89013969e232 ("media: camss: sm8250: Pipeline starting and stopping for multiple virtual channels") Cc: stable@vger.kernel.org Tested-on: Lenovo Yoga Slim 7x (Snapdragon X Elite, ov02c10 camera) Signed-off-by: Saikiran <bjsaikiran@gmail.com> --- drivers/media/platform/qcom/camss/camss-video.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/qcom/camss/camss-video.c b/drivers/media/platform/qcom/camss/camss-video.c index 831486e14754..242c44f97801 100644 --- a/drivers/media/platform/qcom/camss/camss-video.c +++ b/drivers/media/platform/qcom/camss/camss-video.c @@ -312,9 +312,15 @@ static void video_stop_streaming(struct vb2_queue *q) ret = v4l2_subdev_call(subdev, video, s_stream, 0); + /* + * Don't return early on error - we must continue to stop + * remaining subdevices and release the pipeline lock to + * prevent the camera from being permanently locked. + */ if (ret) { - dev_err(video->camss->dev, "Video pipeline stop failed: %d\n", ret); - return; + dev_err(video->camss->dev, + "Failed to stop subdev '%s': %d\n", + subdev->name, ret); } } -- 2.51.0 ^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 1/2] media: qcom: camss: Fix pipeline lock leak in stop_streaming 2026-01-25 14:55 ` [PATCH 1/2] media: qcom: camss: Fix pipeline lock leak in stop_streaming Saikiran @ 2026-01-25 15:01 ` Greg KH 0 siblings, 0 replies; 3+ messages in thread From: Greg KH @ 2026-01-25 15:01 UTC (permalink / raw) To: Saikiran; +Cc: stable On Sun, Jan 25, 2026 at 08:25:43PM +0530, Saikiran wrote: > When a browser or application closes the camera, if any subdevice fails > to stop streaming, video_stop_streaming() returns early without calling > video_device_pipeline_stop(). This leaves the pipeline permanently locked, > preventing any future camera access until reboot. > > Fix this by logging errors but continuing to stop all remaining subdevices > and always releasing the pipeline lock, even when errors occur during the > stop sequence. > > Fixes: 89013969e232 ("media: camss: sm8250: Pipeline starting and stopping for multiple virtual channels") > Cc: stable@vger.kernel.org > Tested-on: Lenovo Yoga Slim 7x (Snapdragon X Elite, ov02c10 camera) > Signed-off-by: Saikiran <bjsaikiran@gmail.com> > --- > drivers/media/platform/qcom/camss/camss-video.c | 10 ++++++++-- > 1 file changed, 8 insertions(+), 2 deletions(-) > > diff --git a/drivers/media/platform/qcom/camss/camss-video.c b/drivers/media/platform/qcom/camss/camss-video.c > index 831486e14754..242c44f97801 100644 > --- a/drivers/media/platform/qcom/camss/camss-video.c > +++ b/drivers/media/platform/qcom/camss/camss-video.c > @@ -312,9 +312,15 @@ static void video_stop_streaming(struct vb2_queue *q) > > ret = v4l2_subdev_call(subdev, video, s_stream, 0); > > + /* > + * Don't return early on error - we must continue to stop > + * remaining subdevices and release the pipeline lock to > + * prevent the camera from being permanently locked. > + */ > if (ret) { > - dev_err(video->camss->dev, "Video pipeline stop failed: %d\n", ret); > - return; > + dev_err(video->camss->dev, > + "Failed to stop subdev '%s': %d\n", > + subdev->name, ret); > } > } > > -- > 2.51.0 > > <formletter> This is not the correct way to submit patches for inclusion in the stable kernel tree. Please read: https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html for how to do this properly. </formletter> ^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 2/2] media: i2c: ov02c10: Check for errors in disable_streams [not found] <20260125145544.50785-1-bjsaikiran@gmail.com> 2026-01-25 14:55 ` [PATCH 1/2] media: qcom: camss: Fix pipeline lock leak in stop_streaming Saikiran @ 2026-01-25 14:55 ` Saikiran 1 sibling, 0 replies; 3+ messages in thread From: Saikiran @ 2026-01-25 14:55 UTC (permalink / raw) To: bjsaikiran; +Cc: stable The ov02c10_disable_streams() function ignores the return value from cci_write() when stopping the sensor. If the I2C write fails (e.g., due to CCI timeout, power management race, or device removal), the error is silently lost. While we still need to return 0 and call pm_runtime_put() regardless of hardware state (to prevent PM reference leaks and pipeline lock issues), we should at least log when the hardware stop fails. This change: 1. Captures the cci_write() return value 2. Logs an error if the write fails 3. Still returns 0 to ensure proper cleanup Returning an error from disable_streams would cause the camss driver's video_stop_streaming() to exit early without releasing the pipeline lock, permanently locking the camera. Fixes: 0e98938b0157 ("media: i2c: add OmniVision OV02C10 sensor driver") Cc: stable@vger.kernel.org Signed-off-by: Saikiran <bjsaikiran@gmail.com> --- drivers/media/i2c/ov02c10.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/media/i2c/ov02c10.c b/drivers/media/i2c/ov02c10.c index b86cae3d2b74..743d8544ac53 100644 --- a/drivers/media/i2c/ov02c10.c +++ b/drivers/media/i2c/ov02c10.c @@ -629,8 +629,12 @@ static int ov02c10_disable_streams(struct v4l2_subdev *sd, u32 pad, u64 streams_mask) { struct ov02c10 *ov02c10 = to_ov02c10(sd); + int ret; + + ret = cci_write(ov02c10->regmap, OV02C10_REG_STREAM_CONTROL, 0, NULL); + if (ret) + dev_err(ov02c10->dev, "failed to stop streaming: %d\n", ret); - cci_write(ov02c10->regmap, OV02C10_REG_STREAM_CONTROL, 0, NULL); pm_runtime_put(ov02c10->dev); return 0; -- 2.51.0 ^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-01-25 15:01 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20260125145544.50785-1-bjsaikiran@gmail.com>
2026-01-25 14:55 ` [PATCH 1/2] media: qcom: camss: Fix pipeline lock leak in stop_streaming Saikiran
2026-01-25 15:01 ` Greg KH
2026-01-25 14:55 ` [PATCH 2/2] media: i2c: ov02c10: Check for errors in disable_streams Saikiran
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox