[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <82e84dc1277e08742b8f72c6a6ce475acd6d36d8.camel@ndufresne.ca>
Date: Fri, 23 May 2025 19:57:00 -0400
From: Nicolas Dufresne <nicolas@...fresne.ca>
To: Sergey Khimich <serghox@...il.com>, linux-media@...r.kernel.org
Cc: Philipp Zabel <p.zabel@...gutronix.de>, Mauro Carvalho Chehab
<mchehab@...nel.org>, linux-kernel@...r.kernel.org, Vladimir Yakovlev
<vovchkir@...il.com>, Maksim Turok <turok.m7@...il.com>
Subject: Re: [PATCH 07/18] media: coda: Add fake IRQ check
Hi,
Le vendredi 14 mars 2025 à 18:29 +0300, Sergey Khimich a écrit :
> From: Sergey Khimich <serghox@...il.com>
>
> Sometimes we receive fake interrupts. It's better to check
> status register and trace fake irq if occurred.
>
> Signed-off-by: Sergey Khimich <serghox@...il.com>
> ---
> .../media/platform/chips-media/coda/coda-bit.c | 16 +++++++++++++++-
> drivers/media/platform/chips-media/coda/trace.h | 16 ++++++++++++++++
> 2 files changed, 31 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/media/platform/chips-media/coda/coda-bit.c b/drivers/media/platform/chips-media/coda/coda-bit.c
> index 84ded154adfe..3e3bb3d64ec9 100644
> --- a/drivers/media/platform/chips-media/coda/coda-bit.c
> +++ b/drivers/media/platform/chips-media/coda/coda-bit.c
> @@ -2635,9 +2635,23 @@ irqreturn_t coda_irq_handler(int irq, void *data)
> {
> struct coda_dev *dev = data;
> struct coda_ctx *ctx;
> + u32 status;
>
> /* read status register to attend the IRQ */
> - coda_read(dev, CODA_REG_BIT_INT_STATUS);
> + status = coda_read(dev, CODA_REG_BIT_INT_STATUS);
> + if (!status) {
> + /*
> + * Sometimes we received wrong interrupts
> + * That's why we check status
> + * and if one of it is zero - wait next interrupts
> + * You need check your HW configuration
> + */
> + dev_warn_ratelimited(dev->dev, "Fake irq status=0x%X\n",
> + status);
> + trace_coda_wrong_irq(dev);
> + return IRQ_HANDLED;
How often is sometimes ? Does it cause any issues, frame loss ? If not, I would say
drop the warning and just swallow it.
Nicolas
> + }
> +
> coda_write(dev, 0, CODA_REG_BIT_INT_REASON);
> coda_write(dev, CODA_REG_BIT_INT_CLEAR_SET,
> CODA_REG_BIT_INT_CLEAR);
> diff --git a/drivers/media/platform/chips-media/coda/trace.h b/drivers/media/platform/chips-media/coda/trace.h
> index abc6a01a74e9..15a96bab10ad 100644
> --- a/drivers/media/platform/chips-media/coda/trace.h
> +++ b/drivers/media/platform/chips-media/coda/trace.h
> @@ -10,6 +10,22 @@
>
> #include "coda.h"
>
> +TRACE_EVENT(coda_wrong_irq,
> + TP_PROTO(struct coda_dev *dev),
> +
> + TP_ARGS(dev),
> +
> + TP_STRUCT__entry(
> + __field(struct coda_dev *, dev)
> + ),
> +
> + TP_fast_assign(
> + __entry->dev = dev;
> + ),
> +
> + TP_printk(" dev = 0x%p", __entry->dev)
> +);
> +
> TRACE_EVENT(coda_bit_run,
> TP_PROTO(struct coda_ctx *ctx, int cmd),
>
Powered by blists - more mailing lists