aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHeiner Kallweit <hkallweit1@gmail.com>2016-07-31 09:42:55 -0400
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2016-09-22 10:23:50 -0400
commitd14f291b6280a675b7bf129aa9a2d7a077554a31 (patch)
treec37f8e2bbafe9dddd0025e96dfd6acbe351d5130
parent033919e0f8debfc2e5cfb13edf8fbdeff5b47b7d (diff)
[media] media: rc: nuvoton: ignore spurious interrupt when logical device is being disabled
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>
-rw-r--r--drivers/media/rc/nuvoton-cir.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/media/rc/nuvoton-cir.c b/drivers/media/rc/nuvoton-cir.c
index 00215f343819..0c69536ea813 100644
--- a/drivers/media/rc/nuvoton-cir.c
+++ b/drivers/media/rc/nuvoton-cir.c
@@ -886,6 +886,15 @@ static irqreturn_t nvt_cir_isr(int irq, void *data)
886 status = nvt_cir_reg_read(nvt, CIR_IRSTS); 886 status = nvt_cir_reg_read(nvt, CIR_IRSTS);
887 iren = nvt_cir_reg_read(nvt, CIR_IREN); 887 iren = nvt_cir_reg_read(nvt, CIR_IREN);
888 888
889 /* At least NCT6779D creates a spurious interrupt when the
890 * logical device is being disabled.
891 */
892 if (status == 0xff && iren == 0xff) {
893 spin_unlock_irqrestore(&nvt->nvt_lock, flags);
894 nvt_dbg_verbose("Spurious interrupt detected");
895 return IRQ_HANDLED;
896 }
897
889 /* IRQ may be shared with CIR WAKE, therefore check for each 898 /* IRQ may be shared with CIR WAKE, therefore check for each
890 * status bit whether the related interrupt source is enabled 899 * status bit whether the related interrupt source is enabled
891 */ 900 */