@@ -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);
@@ -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),