[PATCH v2 14/15] media: rzg2l-cru: Remove debug printouts from irq

Jacopo Mondi posted 15 patches 1 day, 2 hours ago
[PATCH v2 14/15] media: rzg2l-cru: Remove debug printouts from irq
Posted by Jacopo Mondi 1 day, 2 hours ago
Using dev_dbg() in irq handlers to debug per-frame events is marginally
useful and possibly not the best idea, as using printk-based helpers
introduce latencies that impact the drivers operations.

If any tracing/debugging has to be performed around frame events
in interrupt handlers, the tracing subsystem offers better alternatives.

Drop dev_dgb() calls from the CRU interrupt handlers.

Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
---
 drivers/media/platform/renesas/rzg2l-cru/rzg2l-video.c | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/drivers/media/platform/renesas/rzg2l-cru/rzg2l-video.c b/drivers/media/platform/renesas/rzg2l-cru/rzg2l-video.c
index 721057edca6b..e2073cc1afc6 100644
--- a/drivers/media/platform/renesas/rzg2l-cru/rzg2l-video.c
+++ b/drivers/media/platform/renesas/rzg2l-cru/rzg2l-video.c
@@ -627,9 +627,6 @@ irqreturn_t rzg2l_cru_irq(int irq, void *data)
 		vb2_buffer_done(&cru->queue_buf[slot]->vb2_buf,
 				VB2_BUF_STATE_DONE);
 		cru->queue_buf[slot] = NULL;
-	} else {
-		/* Scratch buffer was used, dropping frame. */
-		dev_dbg(cru->dev, "Dropping frame %u\n", cru->sequence);
 	}
 
 	cru->sequence++;
@@ -656,8 +653,6 @@ irqreturn_t rzg3e_cru_irq(int irq, void *data)
 	slot = cru->active_slot;
 	cru->active_slot = rzg2l_cru_slot_next(cru, cru->active_slot);
 
-	dev_dbg(cru->dev, "Current written slot: %d\n", slot);
-
 	/* Capture frame */
 	if (cru->queue_buf[slot]) {
 		struct vb2_v4l2_buffer *buf = cru->queue_buf[slot];
@@ -667,9 +662,6 @@ irqreturn_t rzg3e_cru_irq(int irq, void *data)
 		buf->vb2_buf.timestamp = ktime_get_ns();
 		vb2_buffer_done(&buf->vb2_buf, VB2_BUF_STATE_DONE);
 		cru->queue_buf[slot] = NULL;
-	} else {
-		/* Scratch buffer was used, dropping frame. */
-		dev_dbg(cru->dev, "Dropping frame %u\n", cru->sequence);
 	}
 
 	cru->sequence++;

-- 
2.53.0
Re: [PATCH v2 14/15] media: rzg2l-cru: Remove debug printouts from irq
Posted by Dan Scally 1 day, 1 hour ago
Hi Jacopo

On 31/03/2026 11:27, Jacopo Mondi wrote:
> Using dev_dbg() in irq handlers to debug per-frame events is marginally
> useful and possibly not the best idea, as using printk-based helpers
> introduce latencies that impact the drivers operations.
> 
> If any tracing/debugging has to be performed around frame events
> in interrupt handlers, the tracing subsystem offers better alternatives.
> 
> Drop dev_dgb() calls from the CRU interrupt handlers.
> 
> Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>

Yeah good idea:

Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com>

> ---
>   drivers/media/platform/renesas/rzg2l-cru/rzg2l-video.c | 8 --------
>   1 file changed, 8 deletions(-)
> 
> diff --git a/drivers/media/platform/renesas/rzg2l-cru/rzg2l-video.c b/drivers/media/platform/renesas/rzg2l-cru/rzg2l-video.c
> index 721057edca6b..e2073cc1afc6 100644
> --- a/drivers/media/platform/renesas/rzg2l-cru/rzg2l-video.c
> +++ b/drivers/media/platform/renesas/rzg2l-cru/rzg2l-video.c
> @@ -627,9 +627,6 @@ irqreturn_t rzg2l_cru_irq(int irq, void *data)
>   		vb2_buffer_done(&cru->queue_buf[slot]->vb2_buf,
>   				VB2_BUF_STATE_DONE);
>   		cru->queue_buf[slot] = NULL;
> -	} else {
> -		/* Scratch buffer was used, dropping frame. */
> -		dev_dbg(cru->dev, "Dropping frame %u\n", cru->sequence);
>   	}
>   
>   	cru->sequence++;
> @@ -656,8 +653,6 @@ irqreturn_t rzg3e_cru_irq(int irq, void *data)
>   	slot = cru->active_slot;
>   	cru->active_slot = rzg2l_cru_slot_next(cru, cru->active_slot);
>   
> -	dev_dbg(cru->dev, "Current written slot: %d\n", slot);
> -
>   	/* Capture frame */
>   	if (cru->queue_buf[slot]) {
>   		struct vb2_v4l2_buffer *buf = cru->queue_buf[slot];
> @@ -667,9 +662,6 @@ irqreturn_t rzg3e_cru_irq(int irq, void *data)
>   		buf->vb2_buf.timestamp = ktime_get_ns();
>   		vb2_buffer_done(&buf->vb2_buf, VB2_BUF_STATE_DONE);
>   		cru->queue_buf[slot] = NULL;
> -	} else {
> -		/* Scratch buffer was used, dropping frame. */
> -		dev_dbg(cru->dev, "Dropping frame %u\n", cru->sequence);
>   	}
>   
>   	cru->sequence++;
>