lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250314152939.2759573-8-serghox@gmail.com>
Date: Fri, 14 Mar 2025 18:29:28 +0300
From: Sergey Khimich <serghox@...il.com>
To: 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: [PATCH 07/18] media: coda: Add fake IRQ check

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;
+	}
+
 	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),
 
-- 
2.30.2


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ