From patchwork Mon Feb 22 10:43:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Young X-Patchwork-Id: 12098341 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5AD05C4332E for ; Mon, 22 Feb 2021 10:44:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1766B64E2F for ; Mon, 22 Feb 2021 10:44:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229990AbhBVKoT (ORCPT ); Mon, 22 Feb 2021 05:44:19 -0500 Received: from gofer.mess.org ([88.97.38.141]:54611 "EHLO gofer.mess.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230315AbhBVKoP (ORCPT ); Mon, 22 Feb 2021 05:44:15 -0500 Received: by gofer.mess.org (Postfix, from userid 1000) id 9372CC64D8; Mon, 22 Feb 2021 10:43:30 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mess.org; s=2020; t=1613990610; bh=vFVBNb9aw+ZPRYimnegRaki9g0NwtUzst6xS3c7pxBQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=rRi/KEbolzt5JwNEuLXR30uBdwvfW6cseXSUJutgqfWvGPaKHsD8XR+YgFY2VL4jg UZmygkc3pd6EqHS5Tr8jqvUYDKLYnPRUjW5ei+vtE5Xs/VgtmEKCnscV0Yaw3IqqVF V1a2JaDSQUZgNN/tFOt/OpBbKlNrHVKZFxbxICheprODLUTP7+VSKlC/Ormqz0ndpV FfUkg5elIMDaEa9t/2z8GtpzRMd9WZJcLJySac2EXd3MA/dKAJboKNmxRLy7LGFnZi HfpY2cK0SEdbIV66Hyj/0qCN6fLJxZs+sccGnpI5ay7MjGvLjxyew9qpAe7LpKxER4 03s6AAgi0ZP9g== From: Sean Young To: linux-media@vger.kernel.org, Matthias Reichl , =?utf-8?q?Juan_Jes=C3=BAs_Garc=C3=ADa_de_Soria?= Subject: [PATCH 6/6] media: ite-cir: check for receive overflow Date: Mon, 22 Feb 2021 10:43:29 +0000 Message-Id: X-Mailer: git-send-email 2.20.1 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org It's best if this condition is reported. Signed-off-by: Sean Young --- 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; }