Commit ea8a5c11 authored by Zev Weiss's avatar Zev Weiss Committed by Mauro Carvalho Chehab
Browse files

media: aspeed-video: ignore interrupts that aren't enabled



As partially addressed in commit 65d270ac ("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: default avatarZev Weiss <zev@bewilderbeest.net>
Tested-by: default avatarLei YU <yulei.sh@bytedance.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent 35d2969e
Loading
Loading
Loading
Loading
+6 −10
Original line number Diff line number Diff line
@@ -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;
}