media: aspeed-video: ignore interrupts that aren't enabled
Subsystems (2)
PATCH v3 1/1 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.
---
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 at bewilderbeest.net/
[1] https://lore.kernel.org/openbmc/20210506234048.3214-1-zev at bewilderbeest.net/
drivers/media/platform/aspeed-video.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-)
drivers/media/platform/aspeed-video.c +6 -10
@@ -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 ; }
Signature · 1 line
2.32.0
Quoted 30 lines · Zev Weiss
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 theCAPTURE_COMPLETEandFRAME_COMPLETEinterrupts dealt with in that patch,COMP_READYhas 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 <[email protected]>---
Changes since v2 [1]:
- minor commit message improvementsChanges 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 at bewilderbeest.net/
[1] https://lore.kernel.org/openbmc/20210506234048.3214-1-zev at bewilderbeest.net/drivers/media/platform/aspeed-video.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-)drivers/media/platform/aspeed-video.c +0
-0
drivers/media/platform/aspeed-video.c static irqreturn_t aspeed_video_irq(int irq, void *arg) · line 571
Quoted 9 lines
drivers/media/platform/aspeed-video.c +6
-0@@ -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 ); +
Without the patch, the driver gets an unhandled IRQ in a few hours after the KVM page is opened.
This patch is tested on Bytedance's OpenBMC system and the issue has not been reproduced anymore.
Signature · 2 lines
BRs, Lei YU
Quoted 7 lines · Zev Weiss
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 theCAPTURE_COMPLETEandFRAME_COMPLETEinterrupts dealt with in that patch,COMP_READYhas 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.
Suspect this will fix an intermittent problem on AST2500 with screensaver. Change looks good, thanks!
Quoted 59 lines
Signed-off-by Zev Weiss <[email protected]>---
Changes since v2 [1]:
- minor commit message improvementsChanges 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 at bewilderbeest.net/
[1]
https://lore.kernel.org/openbmc/20210506234048.3214-1-zev at bewilderbeest.net/drivers/media/platform/aspeed-video.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-)drivers/media/platform/aspeed-video.c +2
-0@@ -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
drivers/media/platform/aspeed-video.c +4
-2+* 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
drivers/media/platform/aspeed-video.c +0
-1-* are disabled in the VE_INTERRUPT_CTRL register so clear them to
drivers/media/platform/aspeed-video.c +0
-7-* 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 ; }
Quoted 21 lines
-----Original Message-----
From: Eddie James <[email protected]>
Sent: Wednesday, September 1, 2021 11:07 PM
To: Zev Weiss <[email protected]>
Cc: Jae Hyun Yoo <[email protected]>; Ryan Chen <[email protected]>; linux-aspeed at lists.ozlabs.org; Andrew Jeffery <[email protected]>; openbmc at lists.ozlabs.org; linux-kernel at vger.kernel.org; Mauro Carvalho Chehab <[email protected]>;
linux-arm-kernel at lists.infradead.org; linux-media at vger.kernel.org
Subject: Re: [PATCH v3] media: aspeed-video: ignore interrupts that aren't enabledQuoted 7 lines · Zev Weiss
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 theCAPTURE_COMPLETEandFRAME_COMPLETEinterrupts dealt with in that patch,COMP_READYhas 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.
Quoted 5 lines
Suspect this will fix an intermittent problem on AST2500 with screensaver. Change looks good, thanks!
Reviewed-by Eddie James <[email protected]>
Quoted 61 lines
Quoted 7 lines
Signed-off-by Zev Weiss <[email protected]>---
Changes since v2 [1]:
- minor commit message improvementsQuoted 9 lines
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 at be wilderbeest.net/
[1]https://lore.kernel.org/openbmc/20210506234048.3214-1-zev at bewilderbees
Quoted 44 lines
t.net/
drivers/media/platform/aspeed-video.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-)drivers/media/platform/aspeed-video.c +2
-0@@ -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
drivers/media/platform/aspeed-video.c +4
-2+* 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
drivers/media/platform/aspeed-video.c +0
-1-* are disabled in the VE_INTERRUPT_CTRL register so clear them to
drivers/media/platform/aspeed-video.c +0
-7-* 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 ; }
Hi Mauro,
Quoted 12 lines · Ryan Chen
Quoted 12 lines
Subject: Re: [PATCH v3] media: aspeed-video: ignore interrupts that aren't enabled
Quoted 7 lines · Zev Weiss
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 theCAPTURE_COMPLETEandFRAME_COMPLETEinterrupts dealt with in that patch,COMP_READYhas 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.
Quoted 8 lines
Quoted 5 lines
Suspect this will fix an intermittent problem on AST2500 with screensaver. Change looks good, thanks!
Reviewed-by Eddie James <[email protected]>Reviewed-by Ryan Chen <[email protected]>Quoted 2 lines
Quoted 2 lines
Signed-off-by Zev Weiss <[email protected]>
I notice this wasn't merged in the pull request you sent for v5.15. Would you be able to ensure it makes it in the next pull request you send?
It can have some fixes tags too:
Cheers,
Joel
Quoted 60 lines
Quoted 59 lines
Quoted 5 lines
---
Changes since v2 [1]:
- minor commit message improvementsQuoted 9 lines
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 at be wilderbeest.net/
[1]https://lore.kernel.org/openbmc/20210506234048.3214-1-zev at bewilderbees
Quoted 44 lines
t.net/
drivers/media/platform/aspeed-video.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-)drivers/media/platform/aspeed-video.c +2
-0@@ -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
drivers/media/platform/aspeed-video.c +4
-2+* 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 theVE_INTERRUPT_CTRLregister so clear them
todrivers/media/platform/aspeed-video.c +0
-7-* 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 ; }
Quoted 30 lines · Joel Stanley
Hi Mauro,
Quoted 12 lines · Ryan Chen
Quoted 12 lines
Subject: Re: [PATCH v3] media: aspeed-video: ignore interrupts that aren't enabled
Quoted 7 lines · Zev Weiss
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 theCAPTURE_COMPLETEandFRAME_COMPLETEinterrupts dealt with in that patch,COMP_READYhas 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.Quoted 8 lines
Quoted 5 lines
Suspect this will fix an intermittent problem on AST2500 with screensaver. Change looks good, thanks!
Reviewed-by Eddie James <[email protected]>Reviewed-by Ryan Chen <[email protected]>Quoted 2 lines
Quoted 2 lines
Signed-off-by Zev Weiss <[email protected]>I notice this wasn't merged in the pull request you sent for v5.15. Would you be able to ensure it makes it in the next pull request you send?
It can have some fixes tags too:
Quoted 8 lines
Fixes 65d270acb2d6 ("media: aspeed: clear garbage interrupts")Fixes d2b4387f3bdf ("media: platform: Add Aspeed Video Engine driver")Acked-by Joel Stanley <[email protected]>Cheers,
Joel
Also not in the recent merge of the media/v5.15-2 tag it looks like -- ping?
Thanks,
Zev
Joel Stanley
maintainerHi Greg,
Quoted 36 lines · Zev Weiss
Quoted 34 lines · Joel Stanley
Hi Mauro,
Quoted 12 lines · Ryan Chen
Quoted 12 lines
Subject: Re: [PATCH v3] media: aspeed-video: ignore interrupts that aren't enabled
Quoted 7 lines · Zev Weiss
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 theCAPTURE_COMPLETEandFRAME_COMPLETEinterrupts dealt with in that patch,COMP_READYhas 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.Quoted 8 lines
Quoted 5 lines
Suspect this will fix an intermittent problem on AST2500 with screensaver. Change looks good, thanks!
Reviewed-by Eddie James <[email protected]>Reviewed-by Ryan Chen <[email protected]>Quoted 2 lines
Quoted 2 lines
Signed-off-by Zev Weiss <[email protected]>I notice this wasn't merged in the pull request you sent for v5.15. Would you be able to ensure it makes it in the next pull request you send?
It can have some fixes tags too:
Fixes 65d270acb2d6 ("media: aspeed: clear garbage interrupts")Fixes d2b4387f3bdf ("media: platform: Add Aspeed Video Engine driver")Acked-by Joel Stanley <[email protected]>
Quoted 6 lines
Quoted 4 lines
Cheers,
Joel
Also not in the recent merge of the media/v5.15-2 tag it looks like -- ping?
We're struggling to get a hold of the media maintainers to merge this fix. Have you heard from them recently?
Cheers,
Joel
Quoted 41 lines · Joel Stanley
Hi Greg,
Quoted 38 lines · Zev Weiss
Quoted 36 lines · Joel Stanley
Hi Mauro,
Quoted 12 lines · Ryan Chen
Quoted 12 lines
Subject: Re: [PATCH v3] media: aspeed-video: ignore interrupts that aren't enabled
Quoted 7 lines · Zev Weiss
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 theCAPTURE_COMPLETEandFRAME_COMPLETEinterrupts dealt with in that patch,COMP_READYhas 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.Quoted 8 lines
Quoted 5 lines
Suspect this will fix an intermittent problem on AST2500 with screensaver. Change looks good, thanks!
Reviewed-by Eddie James <[email protected]>Reviewed-by Ryan Chen <[email protected]>Quoted 2 lines
Quoted 2 lines
Signed-off-by Zev Weiss <[email protected]>I notice this wasn't merged in the pull request you sent for v5.15. Would you be able to ensure it makes it in the next pull request you send?
It can have some fixes tags too:
Fixes 65d270acb2d6 ("media: aspeed: clear garbage interrupts")Fixes d2b4387f3bdf ("media: platform: Add Aspeed Video Engine driver")Acked-by Joel Stanley <[email protected]>Cheers,
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
Joel
Also not in the recent merge of the media/v5.15-2 tag it looks like -- ping?
We're struggling to get a hold of the media maintainers to merge this fix. Have you heard from them recently?
I have seen them on the mailing list, yes.
good luck!
greg k-h