From: Sean Young <sean@mess.org>
To: kernel test robot <fengguang.wu@intel.com>
Cc: LKP <lkp@01.org>,
devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org,
linux-media@vger.kernel.org,
Mauro Carvalho Chehab <m.chehab@samsung.com>,
wfg@linux.intel.com
Subject: [PATCH] [media] sir_ir: infinite loop in interrupt handler
Date: Tue, 16 May 2017 09:45:55 +0100 [thread overview]
Message-ID: <20170516084555.GA9699@gofer.mess.org> (raw)
In-Reply-To: <20170516074143.GA8691@gofer.mess.org>
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
prev parent reply other threads:[~2017-05-16 8:45 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-08 12:13 [[media] rc] e662671619: BUG: kernel hang in test stage kernel test robot
2017-05-08 12:13 ` kernel test robot
2017-05-16 7:41 ` Sean Young
2017-05-16 8:45 ` Sean Young [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170516084555.GA9699@gofer.mess.org \
--to=sean@mess.org \
--cc=devel@driverdev.osuosl.org \
--cc=fengguang.wu@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=lkp@01.org \
--cc=m.chehab@samsung.com \
--cc=wfg@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.