All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zev Weiss <zev@bewilderbeest.net>
To: Eddie James <eajames@linux.ibm.com>
Cc: Zev Weiss <zev@bewilderbeest.net>,
	Jae Hyun Yoo <jae.hyun.yoo@linux.intel.com>,
	Joel Stanley <joel@jms.id.au>,
	Ryan Chen <ryan_chen@aspeedtech.com>,
	linux-aspeed@lists.ozlabs.org, Andrew Jeffery <andrew@aj.id.au>,
	openbmc@lists.ozlabs.org, linux-kernel@vger.kernel.org,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	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	[thread overview]
Message-ID: <20210617220229.7352-1-zev@bewilderbeest.net> (raw)

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 <zev@bewilderbeest.net>
---

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;
 }
 
-- 
2.32.0


WARNING: multiple messages have this Message-ID (diff)
From: Zev Weiss <zev@bewilderbeest.net>
To: Eddie James <eajames@linux.ibm.com>
Cc: Jae Hyun Yoo <jae.hyun.yoo@linux.intel.com>,
	Ryan Chen <ryan_chen@aspeedtech.com>,
	linux-aspeed@lists.ozlabs.org, Zev Weiss <zev@bewilderbeest.net>,
	Andrew Jeffery <andrew@aj.id.au>,
	openbmc@lists.ozlabs.org, linux-kernel@vger.kernel.org,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	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	[thread overview]
Message-ID: <20210617220229.7352-1-zev@bewilderbeest.net> (raw)

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 <zev@bewilderbeest.net>
---

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;
 }
 
-- 
2.32.0


WARNING: multiple messages have this Message-ID (diff)
From: Zev Weiss <zev@bewilderbeest.net>
To: Eddie James <eajames@linux.ibm.com>
Cc: Zev Weiss <zev@bewilderbeest.net>,
	Jae Hyun Yoo <jae.hyun.yoo@linux.intel.com>,
	Joel Stanley <joel@jms.id.au>,
	Ryan Chen <ryan_chen@aspeedtech.com>,
	linux-aspeed@lists.ozlabs.org, Andrew Jeffery <andrew@aj.id.au>,
	openbmc@lists.ozlabs.org, linux-kernel@vger.kernel.org,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	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	[thread overview]
Message-ID: <20210617220229.7352-1-zev@bewilderbeest.net> (raw)

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 <zev@bewilderbeest.net>
---

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;
 }
 
-- 
2.32.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

             reply	other threads:[~2021-06-17 22:02 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-17 22:02 Zev Weiss [this message]
2021-06-17 22:02 ` [PATCH v3] media: aspeed-video: ignore interrupts that aren't enabled Zev Weiss
2021-06-17 22:02 ` Zev Weiss
2021-08-25  2:14 ` [Phishing Risk] [External] " Lei Yu
2021-08-25  2:14   ` Lei Yu
2021-08-25  2:14   ` Lei Yu
2021-09-01 15:07 ` Eddie James
2021-09-01 15:07   ` Eddie James
2021-09-06 10:10   ` Ryan Chen
2021-09-06 10:10     ` Ryan Chen
2021-09-06 10:10     ` Ryan Chen
2021-09-06 11:47     ` Joel Stanley
2021-09-06 11:47       ` Joel Stanley
2021-09-06 11:47       ` Joel Stanley
2021-09-28 18:57       ` Zev Weiss
2021-09-28 18:57         ` Zev Weiss
2021-09-28 18:57         ` Zev Weiss
2021-10-08  4:43         ` Joel Stanley
2021-10-08  4:43           ` Joel Stanley
2021-10-08  4:43           ` Joel Stanley
2021-10-08  5:45           ` Greg KH
2021-10-08  5:45             ` Greg KH
2021-10-08  5:45             ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210617220229.7352-1-zev@bewilderbeest.net \
    --to=zev@bewilderbeest.net \
    --cc=andrew@aj.id.au \
    --cc=eajames@linux.ibm.com \
    --cc=jae.hyun.yoo@linux.intel.com \
    --cc=joel@jms.id.au \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-aspeed@lists.ozlabs.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=openbmc@lists.ozlabs.org \
    --cc=ryan_chen@aspeedtech.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.