From patchwork Thu May 6 23:40:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zev Weiss X-Patchwork-Id: 12243681 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=-17.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, 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 15218C433ED for ; Thu, 6 May 2021 23:43:41 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 852FA61001 for ; Thu, 6 May 2021 23:43:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 852FA61001 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bewilderbeest.net Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=sHcDa3FNHrkw/0z9gCHCGIGtcpo21oPkQUTjdr/ahLY=; b=Iia6fzN4ILr72Tpx8vYhdkX5M4 iMCgmvSVIuUXIIMwvszE5B8WMHpBir8u9OhOsdtDnRkzqRVHjWK33SXwLA/T47WJR9ZtTFVQBQlFe tSuEbjMAWRKR95/BX6kVqrCFqpdLIHm+hddZjlx4dPDtLfeco7T1OiBN1dbnZ1iAe5HG4iUO/A7vr 4gAJbCPTCYKFv8VAdVIGHSoiwDSepzBXUWUJ28QRLhTFFXV5XtPKjF20j0PioP0PhGDOsd2qLlKEI v6gfcaeu2MTEV0hMw5SpN0tkXbyjaNRxafSX0IveGuk8ta+SHV9TlsXvtoNSKSOvMiwQRgO95VOEa xyBxwpDg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lencB-005al2-RZ; Thu, 06 May 2021 23:41:08 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lencA-005akq-4G for linux-arm-kernel@desiato.infradead.org; Thu, 06 May 2021 23:41:06 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:In-Reply-To:References; bh=jIaZvfkenQf1rh57M8vcem0GlDIo6IbnDC4FoRVlbJo=; b=VBXElEi0/zdlHicMUgYPqunys2 xhF7qhfPkseKTjl2k/tUdh/N0wXIVffV/MESvdsOkDqor5qtYivf5mX9J3dejkzRZzMIDh9+YtUhK iMRpeUyokkN+otSdbE00JNgFa0vRt4IiiEwl60s/ADBTWnBbPAVDtJTaMeGYGBwxO1BuuF4iDLQOX wpL4gSl6C2cDhxRfl52PkI0QCFY6bIZDOjhpLnbS1IGAhcvcurXbxLXFZpQFeQYb1J3JNgDK+7zrC PwsJ95JqcJH8Pl7Vjnmx4hLDTp5HLuzG2EJziuJKyxR1pRAdF9K37zDt2TUNluh4ruBh/oTCQ/D29 XYhVAYeg==; Received: from thorn.bewilderbeest.net ([2605:2700:0:5::4713:9cab]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lenc7-006SLK-9F for linux-arm-kernel@lists.infradead.org; Thu, 06 May 2021 23:41:04 +0000 Received: from hatter.bewilderbeest.net (unknown [IPv6:2600:6c44:7f:ba20::7c6]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: zev) by thorn.bewilderbeest.net (Postfix) with ESMTPSA id 74A9D57F; Thu, 6 May 2021 16:41:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bewilderbeest.net; s=thorn; t=1620344462; bh=jIaZvfkenQf1rh57M8vcem0GlDIo6IbnDC4FoRVlbJo=; h=From:To:Cc:Subject:Date:From; b=R7rM3llmUGP+0fYa8CpKS0+1h0hUeNv1FOm3hdT2UH2YTOQGi4WDA1S3gnMG7guDn cle+gZkQjVvE0xZGiRncJVc8oIYs4D1hvZ826qUBSCHBiBrjUaf37nNmmUpixLXF8A OiJYoB/0iSCorwoO77FIu3VtyXSaOxQziJji1lq8= From: Zev Weiss To: Eddie James Cc: Zev Weiss , Mauro Carvalho Chehab , Joel Stanley , Andrew Jeffery , linux-media@vger.kernel.org, openbmc@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, linux-aspeed@lists.ozlabs.org, linux-kernel@vger.kernel.org, Ryan Chen , Jae Hyun Yoo Subject: [PATCH v2] media: aspeed-video: ignore interrupts that aren't enabled Date: Thu, 6 May 2021 18:40:48 -0500 Message-Id: <20210506234048.3214-1-zev@bewilderbeest.net> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210506_164103_353094_EF26A1B9 X-CRM114-Status: GOOD ( 10.49 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org As partially addressed in commit 65d270acb2d6, the ASpeed video engine sometimes asserts interrupts that the driver hasn't enabled. In addition to the CAPTURE_COMPLETE and FRAME_COMPLETE interrupts addressed in that patch, COMP_READY has also been observed. Instead of playing whack-a-mole with each one individually, we can instead just blanket ignore everything we haven't explicitly enabled. Signed-off-by: Zev Weiss --- Changes since v1 [0]: - dropped error message - switched to a blanket-ignore approach as suggested by Ryan [0] https://lore.kernel.org/linux-arm-kernel/20201215024542.18888-1-zev@bewilderbeest.net/ drivers/media/platform/aspeed-video.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/drivers/media/platform/aspeed-video.c b/drivers/media/platform/aspeed-video.c index 7bb6babdcade..77611c296a25 100644 --- a/drivers/media/platform/aspeed-video.c +++ b/drivers/media/platform/aspeed-video.c @@ -563,6 +563,12 @@ static irqreturn_t aspeed_video_irq(int irq, void *arg) struct aspeed_video *video = arg; u32 sts = aspeed_video_read(video, VE_INTERRUPT_STATUS); + /* + * Hardware sometimes asserts interrupts that we haven't actually + * enabled; ignore them if so. + */ + sts &= aspeed_video_read(video, VE_INTERRUPT_CTRL); + /* * Resolution changed or signal was lost; reset the engine and * re-initialize @@ -629,16 +635,6 @@ static irqreturn_t aspeed_video_irq(int irq, void *arg) aspeed_video_start_frame(video); } - /* - * CAPTURE_COMPLETE and FRAME_COMPLETE interrupts come even when these - * are disabled in the VE_INTERRUPT_CTRL register so clear them to - * prevent unnecessary interrupt calls. - */ - if (sts & VE_INTERRUPT_CAPTURE_COMPLETE) - sts &= ~VE_INTERRUPT_CAPTURE_COMPLETE; - if (sts & VE_INTERRUPT_FRAME_COMPLETE) - sts &= ~VE_INTERRUPT_FRAME_COMPLETE; - return sts ? IRQ_NONE : IRQ_HANDLED; }