linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [[media] rc] e662671619: BUG: kernel hang in test stage
       [not found] <591060f1.yq3IrK0+vZ5287bb%fengguang.wu@intel.com>
@ 2017-05-16  7:41 ` Sean Young
  2017-05-16  8:45   ` [PATCH] [media] sir_ir: infinite loop in interrupt handler Sean Young
  0 siblings, 1 reply; 2+ messages in thread
From: Sean Young @ 2017-05-16  7:41 UTC (permalink / raw)
  To: kernel test robot
  Cc: LKP, devel, linux-kernel, linux-media, Mauro Carvalho Chehab, wfg

On Mon, May 08, 2017 at 08:13:37PM +0800, kernel test robot wrote:
> Greetings,
> 
> 0day kernel testing robot got the below dmesg and the first bad commit is
> 
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> 
> commit e66267161971155a8b4756b4e17f2f2f82b9f842
> Author:     Sean Young <sean@mess.org>
> AuthorDate: Tue Mar 7 17:07:59 2017 -0300
> Commit:     Mauro Carvalho Chehab <mchehab@s-opensource.com>
> CommitDate: Wed Apr 5 14:50:57 2017 -0300
> 
>     [media] rc: promote lirc_sir out of staging
>     
>     Rename lirc_sir to sir_ir in the process.
>     
>     Signed-off-by: Sean Young <sean@mess.org>
>     Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>

Here the sir_ir gets in an infinite loop in its interrupt handler, since the
hardware is different from what it expects.

I was looking in all the wrong places so it took too long to find this. :/

I'll send a patch as a reply to this email.

Thanks,

Sean

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH] [media] sir_ir: infinite loop in interrupt handler
  2017-05-16  7:41 ` [[media] rc] e662671619: BUG: kernel hang in test stage Sean Young
@ 2017-05-16  8:45   ` Sean Young
  0 siblings, 0 replies; 2+ messages in thread
From: Sean Young @ 2017-05-16  8:45 UTC (permalink / raw)
  To: kernel test robot
  Cc: LKP, devel, linux-kernel, linux-media, Mauro Carvalho Chehab, wfg

Since this driver does no detection of hardware, it might be used with
a non-sir port. Escape out if we are spinning.

Signed-off-by: Sean Young <sean@mess.org>
---
 drivers/media/rc/sir_ir.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/media/rc/sir_ir.c b/drivers/media/rc/sir_ir.c
index e12ec50..90a5f8f 100644
--- a/drivers/media/rc/sir_ir.c
+++ b/drivers/media/rc/sir_ir.c
@@ -183,9 +183,15 @@ static irqreturn_t sir_interrupt(int irq, void *dev_id)
 	static unsigned long delt;
 	unsigned long deltintr;
 	unsigned long flags;
+	int counter = 0;
 	int iir, lsr;
 
 	while ((iir = inb(io + UART_IIR) & UART_IIR_ID)) {
+		if (++counter > 256) {
+			dev_err(&sir_ir_dev->dev, "Trapped in interrupt");
+			break;
+		}
+
 		switch (iir & UART_IIR_ID) { /* FIXME toto treba preriedit */
 		case UART_IIR_MSI:
 			(void)inb(io + UART_MSR);
-- 
2.9.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-05-16  8:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <591060f1.yq3IrK0+vZ5287bb%fengguang.wu@intel.com>
2017-05-16  7:41 ` [[media] rc] e662671619: BUG: kernel hang in test stage Sean Young
2017-05-16  8:45   ` [PATCH] [media] sir_ir: infinite loop in interrupt handler Sean Young

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).