Re: [PATCH v3 4/4] media: iris: Wake up blocked clients when the driver is removed
From: bod
Date: Mon Nov 30 2026 - 09:28:19 EST
On 2026-11-19 17:15 +0530, Vishnu Reddy wrote:
> iris_remove() does not wake up a client that is blocked in
> VIDIOC_DQBUF or poll() on an open session. The client stays blocked and
> keeps its file descriptor open.
>
> Flag the vb2 queues of all open instances as errored after the core is
> shut down. This wakes up the blocked clients, which fail with an error
> and can close the file descriptor. Skip the instances that are already
> closing, as iris_close() releases their queues.
>
> Fixes: 38506cb7e8d2 ("media: iris: add platform driver for iris video device")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Vishnu Reddy <busanna.reddy@xxxxxxxxxxxxxxxx>
> ---
> drivers/media/platform/qcom/iris/iris_instance.h | 2 ++
> drivers/media/platform/qcom/iris/iris_probe.c | 16 ++++++++++++++++
> drivers/media/platform/qcom/iris/iris_vidc.c | 5 +++++
> 3 files changed, 23 insertions(+)
>
> diff --git a/drivers/media/platform/qcom/iris/iris_instance.h b/drivers/media/platform/qcom/iris/iris_instance.h
> index 771269e705d9..cb84753e4f91 100644
> --- a/drivers/media/platform/qcom/iris/iris_instance.h
> +++ b/drivers/media/platform/qcom/iris/iris_instance.h
> @@ -50,6 +50,7 @@ struct iris_hfi_session_ops;
> * @icc_data: structure of interconnect data
> * @m2m_dev: a reference to m2m device structure
> * @m2m_ctx: a reference to m2m context structure
> + * @closing: set on close, skips the queue error during removal
> * @sequence_cap: a sequence counter for capture queue
> * @sequence_out: a sequence counter for output queue
> * @tss: timestamp metadata
> @@ -98,6 +99,7 @@ struct iris_inst {
> struct icc_vote_data icc_data;
> struct v4l2_m2m_dev *m2m_dev;
> struct v4l2_m2m_ctx *m2m_ctx;
> + bool closing;
There's already a state variable, why do we need another flag ?
---
bod