From nobody Mon Feb 9 13:03:50 2026 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) (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 E502530E0F3; Mon, 5 Jan 2026 11:36:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.167.242.64 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767612991; cv=none; b=WAWHCT3LYUGiddk4HAA7Ug9/80Nf2N5htUlREbdAyddqiW37ilrSRfDnn7ti6Y90aVkD4sb2VVWcBHJGkiH5lwKAAEQoHkfaesHy4QgI0GOb/B/l1zWRKrJ88V0VDN7U2JJx2mc8z2v3GgjEnYW0PNKyoCnDtfTjlbQjccYUL18= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767612991; c=relaxed/simple; bh=r/iZ8DqEosyRFLaSBiQIpk9AVgGQPCLN1wDRiBBcnVc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=sP4uWLADJYOylwQJSL6x0FsghUTt850ccn2C7Eyirvsz+EMwhQvo0mVVMG85d6s0LEWQ9IzRuUuEfkhBKeKHWIoCcNg1pf5a+0UqBcpuyeCfTRPEyHdm6XFcOtKCfIzDUgUARoCSCgDNWPu47sXQ1PhmkT0OrhsluF6CibUEWVc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ideasonboard.com; spf=pass smtp.mailfrom=ideasonboard.com; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b=JuJgzNkC; arc=none smtp.client-ip=213.167.242.64 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="JuJgzNkC" Received: from ideasonboard.com (unknown [IPv6:2a00:6020:448c:6c00:c12b:c5c7:ad08:9cf2]) by perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id F12E2A8F; Mon, 5 Jan 2026 12:36:07 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1767612968; bh=r/iZ8DqEosyRFLaSBiQIpk9AVgGQPCLN1wDRiBBcnVc=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=JuJgzNkC6Ltm24m+6JpLrqFCKmLl5H1DezWAEtz7HVItaS0929RW4ZlVErxAxJ9gy 0yyARu+HFSyIzkrVYZBS1deXNdRSmNh+RL6/r8vVCDNvZVydB+XlNN5UmR+1yzMe1O HaIbUGp2UmrQ52nIkVmk/uieDo8PBN68soWJ7o/o= From: Stefan Klug Date: Mon, 05 Jan 2026 12:35:53 +0100 Subject: [PATCH 1/4] media: dw100: Implement V4L2 requests support Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260105-sklug-v6-16-topic-dw100-v3-1-dev-v1-1-65af34d04fd8@ideasonboard.com> References: <20260105-sklug-v6-16-topic-dw100-v3-1-dev-v1-0-65af34d04fd8@ideasonboard.com> In-Reply-To: <20260105-sklug-v6-16-topic-dw100-v3-1-dev-v1-0-65af34d04fd8@ideasonboard.com> To: Xavier Roumegue , Mauro Carvalho Chehab , Sebastian Andrzej Siewior , Clark Williams , Steven Rostedt , Laurent Pinchart Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rt-devel@lists.linux.dev, Stefan Klug X-Mailer: b4 0.14.2 The dw100 dewarper hardware present on the NXP i.MX8MP allows very flexible dewarping using a freely configurable vertex map. Aside from lens dewarping the vertex map can be used to implement things like arbitrary zoom, pan and rotation. The current driver supports setting that vertex map before calling VIDIOC_STREAMON. To control above mentioned features during streaming it is necessary to update the vertex map dynamically. To do that in a race free manner V4L2 requests support is required. This patch adds V4L2 requests support to prepare for dynamic vertex map updates. Signed-off-by: Stefan Klug --- Changes in v1: - Moved v4l2_ctrl_request_complete into dw100_device_run --- drivers/media/platform/nxp/dw100/dw100.c | 41 ++++++++++++++++++++++++++++= ---- 1 file changed, 36 insertions(+), 5 deletions(-) diff --git a/drivers/media/platform/nxp/dw100/dw100.c b/drivers/media/platf= orm/nxp/dw100/dw100.c index 4aaf9c3fff5397f0441944ee926f2c8ba6fc864a..7f14b82c15a071605c124dbb868= f8003856c4fc0 100644 --- a/drivers/media/platform/nxp/dw100/dw100.c +++ b/drivers/media/platform/nxp/dw100/dw100.c @@ -459,6 +459,15 @@ static int dw100_queue_setup(struct vb2_queue *vq, return 0; } =20 +static int dw100_buf_out_validate(struct vb2_buffer *vb) +{ + struct vb2_v4l2_buffer *vbuf =3D to_vb2_v4l2_buffer(vb); + + vbuf->field =3D V4L2_FIELD_NONE; + + return 0; +} + static int dw100_buf_prepare(struct vb2_buffer *vb) { unsigned int i; @@ -500,6 +509,13 @@ static void dw100_buf_queue(struct vb2_buffer *vb) v4l2_m2m_buf_queue(ctx->fh.m2m_ctx, vbuf); } =20 +static void dw100_buf_request_complete(struct vb2_buffer *vb) +{ + struct dw100_ctx *ctx =3D vb2_get_drv_priv(vb->vb2_queue); + + v4l2_ctrl_request_complete(vb->req_obj.req, &ctx->hdl); +} + static void dw100_return_all_buffers(struct vb2_queue *q, enum vb2_buffer_state state) { @@ -553,11 +569,13 @@ static void dw100_stop_streaming(struct vb2_queue *q) } =20 static const struct vb2_ops dw100_qops =3D { - .queue_setup =3D dw100_queue_setup, - .buf_prepare =3D dw100_buf_prepare, - .buf_queue =3D dw100_buf_queue, - .start_streaming =3D dw100_start_streaming, - .stop_streaming =3D dw100_stop_streaming, + .queue_setup =3D dw100_queue_setup, + .buf_out_validate =3D dw100_buf_out_validate, + .buf_prepare =3D dw100_buf_prepare, + .buf_queue =3D dw100_buf_queue, + .start_streaming =3D dw100_start_streaming, + .stop_streaming =3D dw100_stop_streaming, + .buf_request_complete =3D dw100_buf_request_complete, }; =20 static int dw100_m2m_queue_init(void *priv, struct vb2_queue *src_vq, @@ -575,6 +593,7 @@ static int dw100_m2m_queue_init(void *priv, struct vb2_= queue *src_vq, src_vq->timestamp_flags =3D V4L2_BUF_FLAG_TIMESTAMP_COPY; src_vq->lock =3D &ctx->vq_mutex; src_vq->dev =3D ctx->dw_dev->v4l2_dev.dev; + src_vq->supports_requests =3D true; =20 ret =3D vb2_queue_init(src_vq); if (ret) @@ -1460,6 +1479,12 @@ static void dw100_device_run(void *priv) src_buf =3D v4l2_m2m_next_src_buf(ctx->fh.m2m_ctx); dst_buf =3D v4l2_m2m_next_dst_buf(ctx->fh.m2m_ctx); =20 + v4l2_ctrl_request_setup(src_buf->vb2_buf.req_obj.req, + &ctx->hdl); + + v4l2_ctrl_request_complete(src_buf->vb2_buf.req_obj.req, + &ctx->hdl); + dw100_start(ctx, src_buf, dst_buf); } =20 @@ -1467,6 +1492,11 @@ static const struct v4l2_m2m_ops dw100_m2m_ops =3D { .device_run =3D dw100_device_run, }; =20 +static const struct media_device_ops dw100_m2m_media_ops =3D { + .req_validate =3D vb2_request_validate, + .req_queue =3D v4l2_m2m_request_queue, +}; + static struct video_device *dw100_init_video_device(struct dw100_device *d= w_dev) { struct video_device *vfd =3D &dw_dev->vfd; @@ -1578,6 +1608,7 @@ static int dw100_probe(struct platform_device *pdev) dw_dev->mdev.dev =3D &pdev->dev; strscpy(dw_dev->mdev.model, "dw100", sizeof(dw_dev->mdev.model)); media_device_init(&dw_dev->mdev); + dw_dev->mdev.ops =3D &dw100_m2m_media_ops; dw_dev->v4l2_dev.mdev =3D &dw_dev->mdev; =20 ret =3D video_register_device(vfd, VFL_TYPE_VIDEO, -1); --=20 2.51.0 From nobody Mon Feb 9 13:03:50 2026 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) (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 3FA35330B13; Mon, 5 Jan 2026 11:36:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.167.242.64 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767612994; cv=none; b=XbQhTVaLRAG4QPq7rMfj2nJ3enwFDLnERkMgbgmBNQdmUB9jOTh9TAqrKZX0ZOh2X0OgrI+KwPJc7UJrnTNxG0mEDh416E6d6yuPp+33kCOZpTg+R4cdYlVpRHAMAXX8x7f/P2qt8EGNJWbupmdTekWugZJHZUMSL4DTaYaMLWI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767612994; c=relaxed/simple; bh=jvlIXbtNSexvmkwwE43H+b1KKz+iJP/Yh8FvkvEyob8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=DnEb7GNXZ1xxOeBarhtcmAEO4YyfwSNd9nhnIjSVylOm1j51MBSOmpfQ9TCZX5SmAO1tNX3d5Tiw/GySBriQftM6QwaqkAF3cu0fYyqnH+TK/zi+ZIGOXDpXO04vGXGGxU3TBGvV/144/PjGJQMsNNNodgqe0KSzbmxYMA1gp2g= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ideasonboard.com; spf=pass smtp.mailfrom=ideasonboard.com; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b=X+GLWobW; arc=none smtp.client-ip=213.167.242.64 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="X+GLWobW" Received: from ideasonboard.com (unknown [IPv6:2a00:6020:448c:6c00:c12b:c5c7:ad08:9cf2]) by perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id 9DC81FDB; Mon, 5 Jan 2026 12:36:10 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1767612970; bh=jvlIXbtNSexvmkwwE43H+b1KKz+iJP/Yh8FvkvEyob8=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=X+GLWobWa93GjXVh88tvAGi7XjZapig38gOcmD5sC9cC8Er9kKGhD0wntYZvRCHcr aEN4sPPdNhP0mG+JRbEbPbaOTpqS3QEbaC/jn5EzvqgT7+HnPd63FiPV2xkkfFJjcx dMGrvCw8x1LMSQ7PP1furd0FhIlFLmU/43CjFmN4= From: Stefan Klug Date: Mon, 05 Jan 2026 12:35:54 +0100 Subject: [PATCH 2/4] media: dw100: Implement dynamic vertex map update Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260105-sklug-v6-16-topic-dw100-v3-1-dev-v1-2-65af34d04fd8@ideasonboard.com> References: <20260105-sklug-v6-16-topic-dw100-v3-1-dev-v1-0-65af34d04fd8@ideasonboard.com> In-Reply-To: <20260105-sklug-v6-16-topic-dw100-v3-1-dev-v1-0-65af34d04fd8@ideasonboard.com> To: Xavier Roumegue , Mauro Carvalho Chehab , Sebastian Andrzej Siewior , Clark Williams , Steven Rostedt , Laurent Pinchart Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rt-devel@lists.linux.dev, Stefan Klug X-Mailer: b4 0.14.2 Implement dynamic vertex map updates by handling the V4L2_CID_DW100_DEWARPING_16x16_VERTEX_MAP control during streaming. This allows to implement features like dynamic zoom, pan, rotate and dewarp. To stay compatible with the old version, updates of V4L2_CID_DW100_DEWARPING_16x16_VERTEX_MAP are ignored during streaming when requests are not used. Print a corresponding warning once. Signed-off-by: Stefan Klug --- drivers/media/platform/nxp/dw100/dw100.c | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/drivers/media/platform/nxp/dw100/dw100.c b/drivers/media/platf= orm/nxp/dw100/dw100.c index 7f14b82c15a071605c124dbb868f8003856c4fc0..8a421059a1c9b55f514a29d3c2c= 5a6ffb76e0a64 100644 --- a/drivers/media/platform/nxp/dw100/dw100.c +++ b/drivers/media/platform/nxp/dw100/dw100.c @@ -98,6 +98,8 @@ struct dw100_ctx { unsigned int map_width; unsigned int map_height; bool user_map_is_set; + bool user_map_needs_update; + bool warned_dynamic_update; =20 /* Source and destination queue data */ struct dw100_q_data q_data[2]; @@ -293,11 +295,15 @@ static u32 dw100_map_format_coordinates(u16 xq, u16 y= q) return (u32)((yq << 16) | xq); } =20 -static u32 *dw100_get_user_map(struct dw100_ctx *ctx) +static void dw100_update_mapping(struct dw100_ctx *ctx) { struct v4l2_ctrl *ctrl =3D ctx->ctrls[DW100_CTRL_DEWARPING_MAP]; =20 - return ctrl->p_cur.p_u32; + if (!ctx->user_map_needs_update) + return; + + memcpy(ctx->map, ctrl->p_cur.p_u32, ctx->map_size); + ctx->user_map_needs_update =3D false; } =20 /* @@ -306,8 +312,6 @@ static u32 *dw100_get_user_map(struct dw100_ctx *ctx) */ static int dw100_create_mapping(struct dw100_ctx *ctx) { - u32 *user_map; - if (ctx->map) dma_free_coherent(&ctx->dw_dev->pdev->dev, ctx->map_size, ctx->map, ctx->map_dma); @@ -318,8 +322,8 @@ static int dw100_create_mapping(struct dw100_ctx *ctx) if (!ctx->map) return -ENOMEM; =20 - user_map =3D dw100_get_user_map(ctx); - memcpy(ctx->map, user_map, ctx->map_size); + ctx->user_map_needs_update =3D true; + dw100_update_mapping(ctx); =20 dev_dbg(&ctx->dw_dev->pdev->dev, "%ux%u %s mapping created (d:%pad-c:%p) for stream %ux%u->%ux%u\n", @@ -351,6 +355,7 @@ static int dw100_s_ctrl(struct v4l2_ctrl *ctrl) switch (ctrl->id) { case V4L2_CID_DW100_DEWARPING_16x16_VERTEX_MAP: ctx->user_map_is_set =3D true; + ctx->user_map_needs_update =3D true; break; } =20 @@ -405,6 +410,7 @@ static void dw100_ctrl_dewarping_map_init(const struct = v4l2_ctrl *ctrl, } =20 ctx->user_map_is_set =3D false; + ctx->user_map_needs_update =3D true; } =20 static const struct v4l2_ctrl_type_ops dw100_ctrl_type_ops =3D { @@ -1482,6 +1488,15 @@ static void dw100_device_run(void *priv) v4l2_ctrl_request_setup(src_buf->vb2_buf.req_obj.req, &ctx->hdl); =20 + if (src_buf->vb2_buf.req_obj.req) { + dw100_update_mapping(ctx); + } else if (ctx->user_map_needs_update && !ctx->warned_dynamic_update) { + ctx->warned_dynamic_update =3D true; + dev_warn(&ctx->dw_dev->pdev->dev, + "V4L2 requests are required to update the vertex map dynamically" + ); + } + v4l2_ctrl_request_complete(src_buf->vb2_buf.req_obj.req, &ctx->hdl); =20 --=20 2.51.0 From nobody Mon Feb 9 13:03:50 2026 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) (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 5262131960E; Mon, 5 Jan 2026 11:36:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.167.242.64 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767612997; cv=none; b=ZJrqKhoBBKt17qE2AzK1O3hvRKN9JM96H45oQT9TA60O4s53JWB7U852eUJe+e8Pp8nPOi9IgHJsSCP96mv6GOqbuQN6BUZAInLgJWvwr9uQOAu/k+uz6zNvgaLXnePgOjpE0X8zZs7pK2zAZEWWwVDf2ITzQm0nsmixNfn9Uhg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767612997; c=relaxed/simple; bh=YSjJ1cuIpMddaWeRdW3FNnaussg9qgd0RdT5kpyzKMs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=SvaHTBRMz8UwPoYjf+Hsnn/4GzPActS9/mTzu7/6jkaQB9YJr2oXqHio7cft06sJu8Sqv+tyR6+IeW4e1irGf44/h/QRYolKPVI0PfpViUonEVjAisKItBUZKAgDJOc31pNCCSv5W3/h7Q8SOG14pDXhJJWN4f7z4pFn0EbPRhU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ideasonboard.com; spf=pass smtp.mailfrom=ideasonboard.com; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b=nNf2gfQf; arc=none smtp.client-ip=213.167.242.64 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="nNf2gfQf" Received: from ideasonboard.com (unknown [IPv6:2a00:6020:448c:6c00:c12b:c5c7:ad08:9cf2]) by perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id 0A3B3134C; Mon, 5 Jan 2026 12:36:14 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1767612974; bh=YSjJ1cuIpMddaWeRdW3FNnaussg9qgd0RdT5kpyzKMs=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=nNf2gfQfd3I5E/HFUtI1hpplXIUhWL+IQLfZvsmsErE8M0afntffLJCmCPSMyoFke rbVAHXBtierqmhLjCA3Gi6JbcGINvZP7yszubQeJtBmFZFxkTRdCYDuKJitYW1ZLl7 2IwITeCmHFo9T18L4n7NsWsfLVB9sMx/r/Nb1SEM= From: Stefan Klug Date: Mon, 05 Jan 2026 12:35:55 +0100 Subject: [PATCH 3/4] media: dw100: Fix kernel oops with PREEMPT_RT enabled Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260105-sklug-v6-16-topic-dw100-v3-1-dev-v1-3-65af34d04fd8@ideasonboard.com> References: <20260105-sklug-v6-16-topic-dw100-v3-1-dev-v1-0-65af34d04fd8@ideasonboard.com> In-Reply-To: <20260105-sklug-v6-16-topic-dw100-v3-1-dev-v1-0-65af34d04fd8@ideasonboard.com> To: Xavier Roumegue , Mauro Carvalho Chehab , Sebastian Andrzej Siewior , Clark Williams , Steven Rostedt , Laurent Pinchart Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rt-devel@lists.linux.dev, Stefan Klug X-Mailer: b4 0.14.2 On kernels with PREEMPT_RT enabled, a "BUG: scheduling while atomic" kernel oops occurs inside dw100_irq_handler -> vb2_buffer_done. This is because vb2_buffer_done takes a spinlock which is not allowed within interrupt context on PREEMPT_RT. Fix that by making the irq handler threaded. The threaded interrupt handling might cause the interrupt line to be disabled a little longer than before. As the line is not shared, this has no negative side effects. Signed-off-by: Stefan Klug Reviewed-by: Nicolas Dufresne --- drivers/media/platform/nxp/dw100/dw100.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/nxp/dw100/dw100.c b/drivers/media/platf= orm/nxp/dw100/dw100.c index 8a421059a1c9b55f514a29d3c2c5a6ffb76e0a64..4f5ef70e5f4a052fb5f208e35f8= 785f9d30dc54e 100644 --- a/drivers/media/platform/nxp/dw100/dw100.c +++ b/drivers/media/platform/nxp/dw100/dw100.c @@ -1600,8 +1600,9 @@ static int dw100_probe(struct platform_device *pdev) =20 pm_runtime_put_sync(&pdev->dev); =20 - ret =3D devm_request_irq(&pdev->dev, irq, dw100_irq_handler, IRQF_ONESHOT, - dev_name(&pdev->dev), dw_dev); + ret =3D devm_request_threaded_irq(&pdev->dev, irq, NULL, + dw100_irq_handler, IRQF_ONESHOT, + dev_name(&pdev->dev), dw_dev); if (ret < 0) { dev_err(&pdev->dev, "Failed to request irq: %d\n", ret); goto err_pm; --=20 2.51.0 From nobody Mon Feb 9 13:03:50 2026 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) (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 C1E9332B99C; Mon, 5 Jan 2026 11:36:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.167.242.64 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767612999; cv=none; b=fhAn3rbaxA5ljqEjkT8/cFBtTtah4slMy3GS58wfUsgWhEQ6IXTdJux54pTAlbDQRM8ZwNNww50yHfVErXkUlv68CzeFcqpbqA5uuCnSTrfQ0eyYEtqwrFd8r1Ykx/tbuzhO/mcz5dYRrgCfhXW8UWwJqZqV6mOyl8UwIlUCBZY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767612999; c=relaxed/simple; bh=m4SsVkhGfBpQnEXQ4x2bVODp2G73bAqAfTJqh+1eCiM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=lfdM+X8TeiVHhFx2OVk54NojE736jjP8k1R4a3xQCWeIBWXxEgw2Ec1N59flUs0mmR489S1MU2DmKN8UvZ5LShfIgW9ikox7HKyhM43GB9/zC3WFKl9naD+QKlULToSL9eoqvQXOwWDhUlMdp7c3Ar4GHQwFzr4cn8zGgLnPdF8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ideasonboard.com; spf=pass smtp.mailfrom=ideasonboard.com; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b=uqoUT3t9; arc=none smtp.client-ip=213.167.242.64 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="uqoUT3t9" Received: from ideasonboard.com (unknown [IPv6:2a00:6020:448c:6c00:c12b:c5c7:ad08:9cf2]) by perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id 743F614C7; Mon, 5 Jan 2026 12:36:16 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1767612976; bh=m4SsVkhGfBpQnEXQ4x2bVODp2G73bAqAfTJqh+1eCiM=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=uqoUT3t9XGsqpvVEc0sYj7qiHpMMowFH/YZkLjT/XhptpuJvCDsy4Q12xbzrW4BC4 LviNAnj2tiZ5CYuFXEeqk5F+3dbWkKWMLucmd+aKISjJYt7ujXW4rDrbWTwy8de1/V G6tvb9xnk33xRmXrqLqFNi5ar78PIDl7270nxVKg= From: Stefan Klug Date: Mon, 05 Jan 2026 12:35:56 +0100 Subject: [PATCH 4/4] media: dw100: Split interrupt handler to fix timeout error Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260105-sklug-v6-16-topic-dw100-v3-1-dev-v1-4-65af34d04fd8@ideasonboard.com> References: <20260105-sklug-v6-16-topic-dw100-v3-1-dev-v1-0-65af34d04fd8@ideasonboard.com> In-Reply-To: <20260105-sklug-v6-16-topic-dw100-v3-1-dev-v1-0-65af34d04fd8@ideasonboard.com> To: Xavier Roumegue , Mauro Carvalho Chehab , Sebastian Andrzej Siewior , Clark Williams , Steven Rostedt , Laurent Pinchart Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rt-devel@lists.linux.dev, Stefan Klug X-Mailer: b4 0.14.2 In the previous commit, the interrupt handler was changed to threaded. This sometimes leads to DW100_INTERRUPT_STATUS_INT_ERR_TIME_OUT being set after changing the vertex map. This can be seen by repeated error outputs in dmesg: dw100 32e30000.dwe: Interrupt error: 0x1 As there is no documentation available, it is unclear why that happens and if this condition can simply be ignored. By splitting the interrupt handling into two parts and only handling the dw100_job_finish() within the threaded part, the error does not occur anymore. Signed-off-by: Stefan Klug --- As noted on the cover letter, this patch still is intended to start the discussion for a proper fix. While writing this I noted that when DW100_INTERRUPT_STATUS_INT_FRAME_DONE is set, the job gets finished without error even when err_irqs !=3D 0. Is that on purpose? --- drivers/media/platform/nxp/dw100/dw100.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/drivers/media/platform/nxp/dw100/dw100.c b/drivers/media/platf= orm/nxp/dw100/dw100.c index 4f5ef70e5f4a052fb5f208e35f8785f9d30dc54e..67d941bdf768398edc611c94896= cc42a70b88225 100644 --- a/drivers/media/platform/nxp/dw100/dw100.c +++ b/drivers/media/platform/nxp/dw100/dw100.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -74,6 +75,7 @@ struct dw100_device { struct clk_bulk_data *clks; int num_clks; struct dentry *debugfs_root; + bool frame_failed; }; =20 struct dw100_q_data { @@ -1411,7 +1413,8 @@ static irqreturn_t dw100_irq_handler(int irq, void *d= ev_id) { struct dw100_device *dw_dev =3D dev_id; u32 pending_irqs, err_irqs, frame_done_irq; - bool with_error =3D true; + + dw_dev->frame_failed =3D true; =20 pending_irqs =3D dw_hw_get_pending_irqs(dw_dev); frame_done_irq =3D pending_irqs & DW100_INTERRUPT_STATUS_INT_FRAME_DONE; @@ -1419,7 +1422,7 @@ static irqreturn_t dw100_irq_handler(int irq, void *d= ev_id) =20 if (frame_done_irq) { dev_dbg(&dw_dev->pdev->dev, "Frame done interrupt\n"); - with_error =3D false; + dw_dev->frame_failed =3D false; err_irqs &=3D ~DW100_INTERRUPT_STATUS_INT_ERR_STATUS (DW100_INTERRUPT_STATUS_INT_ERR_FRAME_DONE); } @@ -1432,7 +1435,14 @@ static irqreturn_t dw100_irq_handler(int irq, void *= dev_id) dw100_hw_clear_irq(dw_dev, pending_irqs | DW100_INTERRUPT_STATUS_INT_ERR_TIME_OUT); =20 - dw100_job_finish(dw_dev, with_error); + return IRQ_WAKE_THREAD; +} + +static irqreturn_t dw100_irq_thread_fn(int irq, void *dev_id) +{ + struct dw100_device *dw_dev =3D dev_id; + + dw100_job_finish(dw_dev, dw_dev->frame_failed); =20 return IRQ_HANDLED; } @@ -1600,8 +1610,8 @@ static int dw100_probe(struct platform_device *pdev) =20 pm_runtime_put_sync(&pdev->dev); =20 - ret =3D devm_request_threaded_irq(&pdev->dev, irq, NULL, - dw100_irq_handler, IRQF_ONESHOT, + ret =3D devm_request_threaded_irq(&pdev->dev, irq, dw100_irq_handler, + dw100_irq_thread_fn, IRQF_ONESHOT, dev_name(&pdev->dev), dw_dev); if (ret < 0) { dev_err(&pdev->dev, "Failed to request irq: %d\n", ret); --=20 2.51.0