From patchwork Sun Jul 31 13:42:55 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 9253427 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0F9E26048F for ; Sun, 31 Jul 2016 16:00:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E7C6828460 for ; Sun, 31 Jul 2016 16:00:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C6AC22848C; Sun, 31 Jul 2016 16:00:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6A6D528460 for ; Sun, 31 Jul 2016 16:00:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753723AbcGaQAb (ORCPT ); Sun, 31 Jul 2016 12:00:31 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:34912 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753324AbcGaQAa (ORCPT ); Sun, 31 Jul 2016 12:00:30 -0400 Received: by mail-wm0-f67.google.com with SMTP id i5so22830568wmg.2 for ; Sun, 31 Jul 2016 08:59:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:message-id:date:user-agent:mime-version :content-transfer-encoding; bh=fXMCqE6kmM22Ut7eHjCxFuAib+Sa0qn72GNq4Gql0K0=; b=IrWc53vWtlCn8rbqiu+8BPpnS0985ePPh9D7G2IKRJdkygXJ3OlJfxg55Rhgf0lzLN TpcKUh2LSmM4Z8HN+xtwbk5KEgke4G37WPrr6sI0vqy/CxZ/MjgB9xHc8R9VKNkpSkFF U+LYGAV1hu7GTvpZX7mCU6ZzOJ3Zf7RdVagiiXhOIZbIcJUZguMgH3V2kyYslMhj9oPG i+zYi0c44tMGXMhFT/6AZ4Z7rGRmOGORG0UqnORsF167gLan32p/buiDcOvdBlLNKpsX FzhcD9hCJxhgEblv1aIu5SkznIZzz26z9YfWBhVeNF1DZUS6RkGp0ClnSL1wxn0JtTiZ ZHzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:message-id:date:user-agent :mime-version:content-transfer-encoding; bh=fXMCqE6kmM22Ut7eHjCxFuAib+Sa0qn72GNq4Gql0K0=; b=Dhz4MI2JNtfVu5h2zUub6HQ3NmYEr9DFi8hTjzXgrlLCu9JjN4hpvDUMMX6THcfu6a A11ifaMhzV3vtUWWb96GKBoj88D1xtaAhJSJPtdaXHLUXpPbg48mLr+TEEjtEHJlbMMV aR1vo//kIvCktxubWpjqRqb+ROM7Ip+8WLhx+I9b8D2IngNhDKLl/cdZBsfjHhvUduUi vdVzUINo/rTwR+djrxxGURW8a06EAWEaUHQYCJ3jwTw4XlecL6se9kZ7KJ32uGnKqrsg HOinYiBOyQMrhzFH0h7uJrt7zEhhT+sZ2uSzVVn8Be98PB2vhAWNjAucHb7fEghFt4pd MOFw== X-Gm-Message-State: AEkoouuxPNSbodcWfWmd9ltNir5JUO16TYVEeRj1GDxQp7rRVB2HDeyirdktuylZdj8+wg== X-Received: by 10.194.145.103 with SMTP id st7mr46434457wjb.61.1469972583709; Sun, 31 Jul 2016 06:43:03 -0700 (PDT) Received: from ?IPv6:2003:62:5f01:4400:f9aa:5089:9399:c8e1? (p200300625F014400F9AA50899399C8E1.dip0.t-ipconnect.de. [2003:62:5f01:4400:f9aa:5089:9399:c8e1]) by smtp.googlemail.com with ESMTPSA id c10sm25733779wjk.22.2016.07.31.06.42.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 31 Jul 2016 06:42:59 -0700 (PDT) From: Heiner Kallweit To: Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org Subject: [PATCH] media: rc: nuvoton: ignore spurious interrupt when logical device is being disabled Message-ID: <81921cc3-2b49-7c0b-68dd-d3af0cc7dae6@gmail.com> Date: Sun, 31 Jul 2016 15:42:55 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When removing module nuvoton-cir I get a fifo overrun warning. It turned out to be caused by a spurious interrupt when the logical CIR device is being disabled (although no interrupt source bit being set). Reading the interrupt status register returns 0xff, therefore the fifo overrun bit is mistakenly interpreted as being set. Fix this by ignoring interrupts when interrupt source and status register reads return 0xff. Signed-off-by: Heiner Kallweit --- drivers/media/rc/nuvoton-cir.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/media/rc/nuvoton-cir.c b/drivers/media/rc/nuvoton-cir.c index 00215f3..0c69536 100644 --- a/drivers/media/rc/nuvoton-cir.c +++ b/drivers/media/rc/nuvoton-cir.c @@ -886,6 +886,15 @@ static irqreturn_t nvt_cir_isr(int irq, void *data) status = nvt_cir_reg_read(nvt, CIR_IRSTS); iren = nvt_cir_reg_read(nvt, CIR_IREN); + /* At least NCT6779D creates a spurious interrupt when the + * logical device is being disabled. + */ + if (status == 0xff && iren == 0xff) { + spin_unlock_irqrestore(&nvt->nvt_lock, flags); + nvt_dbg_verbose("Spurious interrupt detected"); + return IRQ_HANDLED; + } + /* IRQ may be shared with CIR WAKE, therefore check for each * status bit whether the related interrupt source is enabled */