diff mbox series

[6/6] media: ite-cir: check for receive overflow

Message ID e0b95fe2fdb41dca654a921f083bdf2ad872afce.1613989288.git.sean@mess.org (mailing list archive)
State New
Headers show
Series media: ite-cir driver cleanups | expand

Commit Message

Sean Young Feb. 22, 2021, 10:43 a.m. UTC
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 mbox series

Patch

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;
 	}