[PATCH v2 2/6] media: vsp1: Clean FRE interrupt status

Jacopo Mondi posted 6 patches 9 months, 3 weeks ago
There is a newer version of this series
[PATCH v2 2/6] media: vsp1: Clean FRE interrupt status
Posted by Jacopo Mondi 9 months, 3 weeks ago
The VSPX generates "FRame End" (FRE) interrutps, one for each
buffer transferred to the ISP.

Even if the FRE interrupt is not enabled, it is reported as active
in the interrupt status register.

Make sure to clean it when handling the interrupt.

Signed-off-by: Jacopo Mondi <jacopo.mondi+renesas@ideasonboard.com>
---
 drivers/media/platform/renesas/vsp1/vsp1_drv.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/media/platform/renesas/vsp1/vsp1_drv.c b/drivers/media/platform/renesas/vsp1/vsp1_drv.c
index d13e9b31aa7cff8610ea196ae4de88ab22e44e0f..17ace4c6844d19aaafc27e79f016cc05091372bf 100644
--- a/drivers/media/platform/renesas/vsp1/vsp1_drv.c
+++ b/drivers/media/platform/renesas/vsp1/vsp1_drv.c
@@ -69,7 +69,8 @@ static irqreturn_t vsp1_irq_handler(int irq, void *data)
 				i, wpf->entity.pipe->underrun_count);
 		}
 
-		if (status & VI6_WPF_IRQ_STA_DFE) {
+		if (status & VI6_WPF_IRQ_STA_DFE ||
+		    status & VI6_WPF_IRQ_STA_FRE) {
 			vsp1_pipeline_frame_end(wpf->entity.pipe);
 			ret = IRQ_HANDLED;
 		}

-- 
2.48.1
Re: [PATCH v2 2/6] media: vsp1: Clean FRE interrupt status
Posted by Laurent Pinchart 9 months, 2 weeks ago
Hi Jacopo,

Thank you for the patch.

On Mon, Feb 24, 2025 at 09:19:42PM +0100, Jacopo Mondi wrote:
> The VSPX generates "FRame End" (FRE) interrutps, one for each
> buffer transferred to the ISP.
> 
> Even if the FRE interrupt is not enabled, it is reported as active
> in the interrupt status register.
> 
> Make sure to clean it when handling the interrupt.

This doesn't seem to match the code code.

> Signed-off-by: Jacopo Mondi <jacopo.mondi+renesas@ideasonboard.com>
> ---
>  drivers/media/platform/renesas/vsp1/vsp1_drv.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/media/platform/renesas/vsp1/vsp1_drv.c b/drivers/media/platform/renesas/vsp1/vsp1_drv.c
> index d13e9b31aa7cff8610ea196ae4de88ab22e44e0f..17ace4c6844d19aaafc27e79f016cc05091372bf 100644
> --- a/drivers/media/platform/renesas/vsp1/vsp1_drv.c
> +++ b/drivers/media/platform/renesas/vsp1/vsp1_drv.c
> @@ -69,7 +69,8 @@ static irqreturn_t vsp1_irq_handler(int irq, void *data)
>  				i, wpf->entity.pipe->underrun_count);
>  		}
>  
> -		if (status & VI6_WPF_IRQ_STA_DFE) {
> +		if (status & VI6_WPF_IRQ_STA_DFE ||
> +		    status & VI6_WPF_IRQ_STA_FRE) {
>  			vsp1_pipeline_frame_end(wpf->entity.pipe);
>  			ret = IRQ_HANDLED;
>  		}
> 

-- 
Regards,

Laurent Pinchart
Re: [PATCH v2 2/6] media: vsp1: Clean FRE interrupt status
Posted by Sergey Shtylyov 9 months, 3 weeks ago
On 2/24/25 11:19 PM, Jacopo Mondi wrote:

> The VSPX generates "FRame End" (FRE) interrutps, one for each
> buffer transferred to the ISP.
> 
> Even if the FRE interrupt is not enabled, it is reported as active
> in the interrupt status register.
> 
> Make sure to clean it when handling the interrupt.
> 
> Signed-off-by: Jacopo Mondi <jacopo.mondi+renesas@ideasonboard.com>
> ---
>  drivers/media/platform/renesas/vsp1/vsp1_drv.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/media/platform/renesas/vsp1/vsp1_drv.c b/drivers/media/platform/renesas/vsp1/vsp1_drv.c
> index d13e9b31aa7cff8610ea196ae4de88ab22e44e0f..17ace4c6844d19aaafc27e79f016cc05091372bf 100644
> --- a/drivers/media/platform/renesas/vsp1/vsp1_drv.c
> +++ b/drivers/media/platform/renesas/vsp1/vsp1_drv.c
> @@ -69,7 +69,8 @@ static irqreturn_t vsp1_irq_handler(int irq, void *data)
>  				i, wpf->entity.pipe->underrun_count);
>  		}
>  
> -		if (status & VI6_WPF_IRQ_STA_DFE) {
> +		if (status & VI6_WPF_IRQ_STA_DFE ||
> +		    status & VI6_WPF_IRQ_STA_FRE) {

   Maybe:

		if (status & (VI6_WPF_IRQ_STA_DFE | VI6_WPF_IRQ_STA_FRE)) {

[...]

MBR, Sergey
Re: [PATCH v2 2/6] media: vsp1: Clean FRE interrupt status
Posted by Sergey Shtylyov 9 months, 3 weeks ago
On 2/24/25 11:19 PM, Jacopo Mondi wrote:

> The VSPX generates "FRame End" (FRE) interrutps, one for each
> buffer transferred to the ISP.
> 
> Even if the FRE interrupt is not enabled, it is reported as active
> in the interrupt status register.
> 
> Make sure to clean it when handling the interrupt.
> 
> Signed-off-by: Jacopo Mondi <jacopo.mondi+renesas@ideasonboard.com>
> ---
>  drivers/media/platform/renesas/vsp1/vsp1_drv.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/media/platform/renesas/vsp1/vsp1_drv.c b/drivers/media/platform/renesas/vsp1/vsp1_drv.c
> index d13e9b31aa7cff8610ea196ae4de88ab22e44e0f..17ace4c6844d19aaafc27e79f016cc05091372bf 100644
> --- a/drivers/media/platform/renesas/vsp1/vsp1_drv.c
> +++ b/drivers/media/platform/renesas/vsp1/vsp1_drv.c
> @@ -69,7 +69,8 @@ static irqreturn_t vsp1_irq_handler(int irq, void *data)
>  				i, wpf->entity.pipe->underrun_count);
>  		}
>  
> -		if (status & VI6_WPF_IRQ_STA_DFE) {
> +		if (status & VI6_WPF_IRQ_STA_DFE ||
> +		    status & VI6_WPF_IRQ_STA_FRE) {

   Maybe:

		if (status & (VI6_WPF_IRQ_STA_DFE | VI6_WPF_IRQ_STA_FRE)) {

[...]

MBR, Sergey