[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7d9f8ec0-574b-4535-8064-7deb2309e74b@quicinc.com>
Date: Thu, 16 Oct 2025 16:59:23 +0800
From: Renjiang Han <quic_renjiang@...cinc.com>
To: Wangao Wang <wangao.wang@....qualcomm.com>,
<vikash.garodia@....qualcomm.com>, <dikshita.agarwal@....qualcomm.com>,
<abhinav.kumar@...ux.dev>, <bod@...nel.org>, <mchehab@...nel.org>
CC: <linux-media@...r.kernel.org>, <linux-arm-msm@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, <quic_qiweil@...cinc.com>
Subject: Re: [PATCH v1] media: qcom: iris: Add sanity check for stop streaming
On 10/16/2025 3:25 PM, Wangao Wang wrote:
> Add sanity check in iris_vb2_stop_streaming. If inst->state is
> already IRIS_INST_ERROR, we should skip the stream_off operation
> because it would still send packets to the firmware.
>
> In iris_vdec_kill_session, inst->state is set to IRIS_INST_ERROR
> and session_close is executed, which will kfree(inst_hfi_gen2->packet).
> If stop_streaming is called afterward, it will cause a crash.
>
> Signed-off-by: Wangao Wang <wangao.wang@....qualcomm.com>
> ---
> drivers/media/platform/qcom/iris/iris_vb2.c | 10 +++++++---
> 1 file changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/media/platform/qcom/iris/iris_vb2.c b/drivers/media/platform/qcom/iris/iris_vb2.c
> index 139b821f7952..c1647fb4f0cc 100644
> --- a/drivers/media/platform/qcom/iris/iris_vb2.c
> +++ b/drivers/media/platform/qcom/iris/iris_vb2.c
> @@ -231,16 +231,20 @@ void iris_vb2_stop_streaming(struct vb2_queue *q)
> return;
>
> mutex_lock(&inst->lock);
> + if (inst->state == IRIS_INST_ERROR) {
> + ret = -EBUSY;
> + goto error;
> + }
>
> if (!V4L2_TYPE_IS_OUTPUT(q->type) &&
> !V4L2_TYPE_IS_CAPTURE(q->type))
> - goto exit;
> + goto error;
>
> ret = iris_session_streamoff(inst, q->type);
> if (ret)
> - goto exit;
> + goto error;
>
> -exit:
> +error:
> iris_helper_buffers_done(inst, q->type, VB2_BUF_STATE_ERROR);
It is necessary to distinguish between error and normal states.
> if (ret)
> iris_inst_change_state(inst, IRIS_INST_ERROR);
--
Best Regards,
Renjiang
Powered by blists - more mailing lists