All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sean Young <sean@mess.org>
To: linux-media@vger.kernel.org, "Matthias Reichl" <hias@horus.com>,
	"Juan Jesús García de Soria" <skandalfo@gmail.com>
Subject: [PATCH 6/6] media: ite-cir: check for receive overflow
Date: Mon, 22 Feb 2021 10:43:29 +0000	[thread overview]
Message-ID: <e0b95fe2fdb41dca654a921f083bdf2ad872afce.1613989288.git.sean@mess.org> (raw)
In-Reply-To: <cover.1613989288.git.sean@mess.org>

It's best if this condition is reported.

Signed-off-by: Sean Young <sean@mess.org>
---
 drivers/media/rc/ite-cir.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/drivers/media/rc/ite-cir.c b/drivers/media/rc/ite-cir.c
index cc0a70dcf93d..9580e9e6e5c9 100644
--- a/drivers/media/rc/ite-cir.c
+++ b/drivers/media/rc/ite-cir.c
@@ -236,8 +236,14 @@ static irqreturn_t ite_cir_isr(int irq, void *data)
 	/* read the interrupt flags */
 	iflags = dev->params->get_irq_causes(dev);
 
+	/* Check for RX overflow */
+	if (iflags & ITE_IRQ_RX_FIFO_OVERRUN) {
+		dev_warn(&dev->rdev->dev, "receive overflow\n");
+		ir_raw_event_reset(dev->rdev);
+	}
+
 	/* check for the receive interrupt */
-	if (iflags & (ITE_IRQ_RX_FIFO | ITE_IRQ_RX_FIFO_OVERRUN)) {
+	if (iflags & ITE_IRQ_RX_FIFO) {
 		/* read the FIFO bytes */
 		rx_bytes = dev->params->get_rx_bytes(dev, rx_buf,
 						    ITE_RX_FIFO_LEN);
@@ -496,13 +502,13 @@ static int it87_get_irq_causes(struct ite_dev *dev)
 
 	switch (iflags) {
 	case IT87_II_RXDS:
-		ret = ITE_IRQ_RX_FIFO;
+		ret |= ITE_IRQ_RX_FIFO;
 		break;
 	case IT87_II_RXFO:
-		ret = ITE_IRQ_RX_FIFO_OVERRUN;
+		ret |= ITE_IRQ_RX_FIFO_OVERRUN;
 		break;
 	case IT87_II_TXLDL:
-		ret = ITE_IRQ_TX_FIFO;
+		ret |= ITE_IRQ_TX_FIFO;
 		break;
 	}
 
-- 
2.29.2


  parent reply	other threads:[~2021-02-22 10:44 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-22 10:43 [PATCH 0/6] media: ite-cir driver cleanups Sean Young
2021-02-22 10:43 ` [PATCH 1/6] media: ite-cir: remove unused fields Sean Young
2021-02-22 10:43 ` [PATCH 2/6] media: ite-cir: set parent device Sean Young
2021-02-22 10:43 ` [PATCH 3/6] media: ite-cir: use standard logging and reduce noise Sean Young
2021-02-22 10:43 ` [PATCH 4/6] media: ite-cir: carrier and duty cycle can be set via ioctl Sean Young
2021-02-22 10:43 ` [PATCH 5/6] media: ite-cir: move runtime information into driver data Sean Young
2021-02-22 10:43 ` Sean Young [this message]
2021-02-23 16:13 ` [PATCH 0/6] media: ite-cir driver cleanups Matthias Reichl
2021-02-23 17:50   ` Sean Young
2021-02-23 19:16     ` Matthias Reichl
2021-02-24  9:57       ` Sean Young
2021-02-26 13:57         ` Matthias Reichl
2021-03-01 10:42           ` Sean Young

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=e0b95fe2fdb41dca654a921f083bdf2ad872afce.1613989288.git.sean@mess.org \
    --to=sean@mess.org \
    --cc=hias@horus.com \
    --cc=linux-media@vger.kernel.org \
    --cc=skandalfo@gmail.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.