From patchwork Tue Dec 15 02:45:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zev Weiss X-Patchwork-Id: 11973589 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.8 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 7418AC4361B for ; Tue, 15 Dec 2020 02:47:40 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 31E4A207A2 for ; Tue, 15 Dec 2020 02:47:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 31E4A207A2 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=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=yF3iOwspwZjLw1zB82hwJPQUyc5imbkAWCY5iPTjQCs=; b=prZ1VvWmimA6un9DILZoEkubV UlnNkO2I42Z4i+kUWqrqwLkpX0l77jz4r8MInTmTqKDX8uBse+dqXaZ+ytbwLinz21ItdPxrhkoKs D7BBYs7DKhqEKiafjOFd6VgzqfWotmQdn5X11PIP4LY3piIs+dlL/HAognyDf4kdUa7FV3yCRE1Lz cWrnI0CjRTHqFd4hHGyV1cr0huR4kuLrki6IBAN9tQmPQE57YyGkiAq2ymsP+Pz0ynmRgna5pOAOo hp/IdWYyKbIBn/vDR3/OA0Rp65s3Y1XDRzbTiuR+DxwYK1uWViSz16heXFIxDjIC9CyOhbp3oPP1e sJ3zQjMew==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kp0Ls-0003r3-2k; Tue, 15 Dec 2020 02:46:12 +0000 Received: from thorn.bewilderbeest.net ([2605:2700:0:5::4713:9cab]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kp0Lo-0003pm-0B for linux-arm-kernel@lists.infradead.org; Tue, 15 Dec 2020 02:46:10 +0000 Received: from hatter.bewilderbeest.net (unknown [IPv6:2600:6c44:7f:ba20:1c66:ab2d:5a3:5a9e]) (using TLSv1.2 with cipher DHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: zev) by thorn.bewilderbeest.net (Postfix) with ESMTPSA id 5E5F4806FA; Mon, 14 Dec 2020 18:46:01 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 thorn.bewilderbeest.net 5E5F4806FA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bewilderbeest.net; s=thorn; t=1608000362; bh=iD+Q0HRdZJ6dUnWWVt4Ox1KAVYD8O2LC2E8h+jcXdtk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TW8je8Fa6vSq7loNGgeQy6xxa+1RFxe9mTStlSgYxecdpopU6M/oBenuqVeNCjTBL dN4oNz/ty4nN4z8lzg5DqZObramnu8OyyUBJwryJFVsCbwEUnfrJhs/jW1dyz3OLGC BwXvYeQLr+dugo36VnguK1G800qStEl/rY3sKNC4= From: Zev Weiss To: Eddie James , 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 Subject: [PATCH 2/3] aspeed-video: clear spurious interrupt bits unconditionally Date: Mon, 14 Dec 2020 20:45:41 -0600 Message-Id: <20201215024542.18888-3-zev@bewilderbeest.net> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201215024542.18888-1-zev@bewilderbeest.net> References: <20201215024542.18888-1-zev@bewilderbeest.net> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201214_214608_410479_8AB71656 X-CRM114-Status: GOOD ( 12.39 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jae Hyun Yoo , Zev Weiss Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Instead of testing and conditionally clearing them one by one, we can instead just unconditionally clear them all at once. Signed-off-by: Zev Weiss Reviewed-by: Joel Stanley --- drivers/media/platform/aspeed-video.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/drivers/media/platform/aspeed-video.c b/drivers/media/platform/aspeed-video.c index eb02043532e3..218aae3be809 100644 --- a/drivers/media/platform/aspeed-video.c +++ b/drivers/media/platform/aspeed-video.c @@ -558,6 +558,14 @@ static void aspeed_video_irq_res_change(struct aspeed_video *video, ulong delay) schedule_delayed_work(&video->res_work, delay); } +/* + * Interrupts that we don't use but have to explicitly ignore because the + * hardware asserts them even when they're disabled in the VE_INTERRUPT_CTRL + * register. + */ +#define VE_SPURIOUS_IRQS \ + (VE_INTERRUPT_CAPTURE_COMPLETE | VE_INTERRUPT_FRAME_COMPLETE) + static irqreturn_t aspeed_video_irq(int irq, void *arg) { struct aspeed_video *video = arg; @@ -630,15 +638,8 @@ 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; + /* Squash known bogus interrupts */ + sts &= ~VE_SPURIOUS_IRQS; if (sts) dev_err_ratelimited(video->dev, "unexpected interrupt asserted:"