diff options
author | Zev Weiss <zev@bewilderbeest.net> | 2021-06-18 01:02:29 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2021-09-30 11:07:54 +0300 |
commit | ea8a5c118e2491726ffd27fd3fc149110d104095 (patch) | |
tree | 54578ae9448491f56c0a20823715dd4633e7ca59 | |
parent | 35d2969ea3c7d32aee78066b1f3cf61a0d935a4e (diff) | |
download | linux-ea8a5c118e2491726ffd27fd3fc149110d104095.tar.xz |
media: aspeed-video: ignore interrupts that aren't enabled
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>
Tested-by: Lei YU <yulei.sh@bytedance.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
-rw-r--r-- | drivers/media/platform/aspeed-video.c | 16 |
1 files 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 @@ -564,6 +564,12 @@ static irqreturn_t aspeed_video_irq(int irq, void *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; } |