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: 1475269 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org (client-ip=2404:9400:2:0:216:3eff:fee1:b9f1; helo=lists.ozlabs.org; envelope-from=openbmc-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=bewilderbeest.net header.i=@bewilderbeest.net header.a=rsa-sha256 header.s=thorn header.b=R7rM3llm; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2404:9400:2:0:216:3eff:fee1:b9f1]) (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) by ozlabs.org (Postfix) with ESMTPS id 4Fbqpw5qGfz9sVv for ; Fri, 7 May 2021 09:41:28 +1000 (AEST) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4Fbqpw3GYvz2yWS for ; Fri, 7 May 2021 09:41:28 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=bewilderbeest.net header.i=@bewilderbeest.net header.a=rsa-sha256 header.s=thorn header.b=R7rM3llm; dkim-atps=neutral X-Original-To: openbmc@lists.ozlabs.org Delivered-To: openbmc@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=bewilderbeest.net (client-ip=2605:2700:0:5::4713:9cab; helo=thorn.bewilderbeest.net; envelope-from=zev@bewilderbeest.net; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=bewilderbeest.net header.i=@bewilderbeest.net header.a=rsa-sha256 header.s=thorn header.b=R7rM3llm; dkim-atps=neutral Received: from thorn.bewilderbeest.net (thorn.bewilderbeest.net [IPv6:2605:2700:0:5::4713:9cab]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4FbqpW5Hdzz2yWN; Fri, 7 May 2021 09:41:06 +1000 (AEST) 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 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-BeenThere: openbmc@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development list for OpenBMC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jae Hyun Yoo , Ryan Chen , linux-aspeed@lists.ozlabs.org, Zev Weiss , 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 Errors-To: openbmc-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "openbmc" 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; }