[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231205120441.GD17394@pendragon.ideasonboard.com>
Date: Tue, 5 Dec 2023 14:04:41 +0200
From: Laurent Pinchart <laurent.pinchart@...asonboard.com>
To: Tomi Valkeinen <tomi.valkeinen@...asonboard.com>
Cc: Dafna Hirschfeld <dafna@...tmail.com>,
Mauro Carvalho Chehab <mchehab@...nel.org>,
Heiko Stuebner <heiko@...ech.de>,
Paul Elder <paul.elder@...asonboard.com>,
Alexander Stein <alexander.stein@...tq-group.com>,
kieran.bingham@...asonboard.com, umang.jain@...asonboard.com,
aford173@...il.com, linux-media@...r.kernel.org,
linux-rockchip@...ts.infradead.org,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/4] media: rkisp1: Fix IRQ handler return values
Hi Tomi,
Thank you for the patch.
On Tue, Dec 05, 2023 at 10:09:33AM +0200, Tomi Valkeinen wrote:
> The IRQ handler rkisp1_isr() calls sub-handlers, all of which returns an
> irqreturn_t value, but rkisp1_isr() ignores those values and always
> returns IRQ_HANDLED.
>
> Fix this by collecting the return values, and returning IRQ_HANDLED or
> IRQ_NONE as appropriate.
>
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@...asonboard.com>
> ---
> drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c | 18 ++++++++++++++----
> 1 file changed, 14 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c b/drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c
> index 76f93614b4cf..1d60f4b8bd09 100644
> --- a/drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c
> +++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c
> @@ -445,17 +445,27 @@ static int rkisp1_entities_register(struct rkisp1_device *rkisp1)
>
> static irqreturn_t rkisp1_isr(int irq, void *ctx)
> {
> + irqreturn_t ret;
irqreturn_t ret = IRQ_NONE;
> +
> /*
> * Call rkisp1_capture_isr() first to handle the frame that
> * potentially completed using the current frame_sequence number before
> * it is potentially incremented by rkisp1_isp_isr() in the vertical
> * sync.
> */
> - rkisp1_capture_isr(irq, ctx);
> - rkisp1_isp_isr(irq, ctx);
> - rkisp1_csi_isr(irq, ctx);
>
> - return IRQ_HANDLED;
> + ret = IRQ_NONE;
And drop this.
Reviewed-by: Laurent Pinchart <laurent.pinchart@...asonboard.com>
> +
> + if (rkisp1_capture_isr(irq, ctx) == IRQ_HANDLED)
> + ret = IRQ_HANDLED;
> +
> + if (rkisp1_isp_isr(irq, ctx) == IRQ_HANDLED)
> + ret = IRQ_HANDLED;
> +
> + if (rkisp1_csi_isr(irq, ctx) == IRQ_HANDLED)
> + ret = IRQ_HANDLED;
> +
> + return ret;
> }
>
> static const char * const px30_isp_clks[] = {
--
Regards,
Laurent Pinchart
Powered by blists - more mailing lists