]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
[media] media: rc: nuvoton: ignore spurious interrupt when logical device is being...
authorHeiner Kallweit <hkallweit1@gmail.com>
Sun, 31 Jul 2016 13:42:55 +0000 (10:42 -0300)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Thu, 22 Sep 2016 14:23:50 +0000 (11:23 -0300)
When removing module nuvoton-cir I get a fifo overrun warning.
It turned out to be caused by a spurious interrupt when the logical CIR
device is being disabled (although no interrupt source bit being set).
Reading the interrupt status register returns 0xff, therefore the fifo
overrun bit is mistakenly interpreted as being set.

Fix this by ignoring interrupts when interrupt source and status register
reads return 0xff.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/rc/nuvoton-cir.c

index 00215f3438196b38dc0cc7b47363ab3814ee32ca..0c69536ea8133c30acf39c2cefef2e6f4bff35bf 100644 (file)
@@ -886,6 +886,15 @@ static irqreturn_t nvt_cir_isr(int irq, void *data)
        status = nvt_cir_reg_read(nvt, CIR_IRSTS);
        iren = nvt_cir_reg_read(nvt, CIR_IREN);
 
+       /* At least NCT6779D creates a spurious interrupt when the
+        * logical device is being disabled.
+        */
+       if (status == 0xff && iren == 0xff) {
+               spin_unlock_irqrestore(&nvt->nvt_lock, flags);
+               nvt_dbg_verbose("Spurious interrupt detected");
+               return IRQ_HANDLED;
+       }
+
        /* IRQ may be shared with CIR WAKE, therefore check for each
         * status bit whether the related interrupt source is enabled
         */