From patchwork Thu Jun 17 22:02:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zev Weiss X-Patchwork-Id: 12329639 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.9 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,USER_AGENT_GIT autolearn=unavailable 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 D5F3EC2B9F4 for ; Thu, 17 Jun 2021 22:04:12 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 8F2F9610CD for ; Thu, 17 Jun 2021 22:04:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8F2F9610CD 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=bombadil.20210309; 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=EzLoDsoXe+Uy4iXrjWzqtlPzWtlHTK4/tniRC9TW1B8=; b=qJ9veQ+l+AdQLw cKtslqVu8BwIUSW0LgGaKPri5TZlxSFBNpSthgwLRTo721DEfZ+HIGeD0AqM0gugpZAU4k5KJtLRt uuIr42yvZhunf/6DMFTBy0p9mAgFk8DGwc62pDaHl/2PIeFa933Izbuc36ivKD/nQ83d/PN7eJuND CvpNYnK0S8dKKbdm5LAENapis8gSFKcFSsWQ05sybV6jEB6n06YpqVF5OLb5ng1gz5GIZLZ2IMI4L LF9zLYtNE9kfMawJ0IkARX7d22XQLE330BkK3E4xomqjufnxlW8BFMYJExTknfh1VF6guGH5Hm+2h NMbcVU6VtyFcBsAbU2TQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lu06A-00Btoj-D6; Thu, 17 Jun 2021 22:02:54 +0000 Received: from thorn.bewilderbeest.net ([2605:2700:0:5::4713:9cab]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lu065-00Btnh-8j for linux-arm-kernel@lists.infradead.org; Thu, 17 Jun 2021 22:02:50 +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 098B62B9; Thu, 17 Jun 2021 15:02:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bewilderbeest.net; s=thorn; t=1623967364; bh=FQzjrW5WNAOrVkJs/Hts+Ik3+Hqt7NokValuBbhexNw=; h=From:To:Cc:Subject:Date:From; b=F9Tcc6TKUxeEZshhBHAE4lTP1tdqkb4gjBU2K/1a+9NCGvuD0das9eNYChfQpq3Qu 4/myI7/JUaErXS8bPiH3kt6RTx0Bl2ejRLMqUxZ+n9RbXyHRkeNxhxYjdypO1opJLT s1VuxP9adGTe1ztK7An+nQdgXLN1L3ZPDoKybD6M= From: Zev Weiss To: Eddie James Cc: Zev Weiss , Jae Hyun Yoo , Joel Stanley , Ryan Chen , linux-aspeed@lists.ozlabs.org, Andrew Jeffery , openbmc@lists.ozlabs.org, linux-kernel@vger.kernel.org, Mauro Carvalho Chehab , linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org Subject: [PATCH v3] media: aspeed-video: ignore interrupts that aren't enabled Date: Thu, 17 Jun 2021 17:02:29 -0500 Message-Id: <20210617220229.7352-1-zev@bewilderbeest.net> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210617_150249_336643_31CD261C X-CRM114-Status: GOOD ( 10.05 ) 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 ("media: aspeed: clear garbage interrupts"), the ASpeed video engine sometimes asserts interrupts that the driver hasn't enabled. In addition to the CAPTURE_COMPLETE and FRAME_COMPLETE interrupts dealt with 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 Tested-by: Lei YU Reviewed-by: Eddie James Reviewed-by: Ryan Chen Acked-by: Joel Stanley --- Changes since v2 [1]: - minor commit message improvements 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/ [1] https://lore.kernel.org/openbmc/20210506234048.3214-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; }