From: "Jackson.lee" <jackson.lee@chipsnmedia.com>
To: mchehab@kernel.org, nicolas@ndufresne.ca, sebastian.fricke@collabora.com
Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
hverkuil@xs4all.nl, nas.chung@chipsnmedia.com,
lafley.kim@chipsnmedia.com, b-brnich@ti.com,
jackson.lee@chipsnmedia.com
Subject: [PATCH v0 4/6] media: chips-media: wave5: Fix Multistream Decode Hang with no IRQ Present
Date: Tue, 12 Nov 2024 11:15:15 +0900 [thread overview]
Message-ID: <20241112021517.121-5-jackson.lee@chipsnmedia.com> (raw)
In-Reply-To: <20241112021517.121-1-jackson.lee@chipsnmedia.com>
In multistream decode case when polling is used, a hang can occur in two
different locations. Firstly, the work function that is called every 5ms to
service any possible interrupts triggered by the VPU. While handling VPU
IRQ, there is corner case where another decoded picture IRQ event could
occur. Before marking command as handled on the VPU, make sure that another
decoded picture IRQ event hasn't occurred so the event isn't lost.
Secondly, during stop_streaming, there is a check in place to see if any
decoded pictures remain. If there are, a call is made to wait for the
interrupt to trigger in order to service the decoded picture. However, this
interrupt won't be seen since polling is being used. A timeout will then
occur after one minute. Remove this wait and allow work handler to keep
running until last picture is serviced.
Signed-off-by: Jackson.lee <jackson.lee@chipsnmedia.com>
Signed-off-by: Nas Chung <nas.chung@chipsnmedia.com>
---
.../media/platform/chips-media/wave5/wave5-vpu.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/drivers/media/platform/chips-media/wave5/wave5-vpu.c b/drivers/media/platform/chips-media/wave5/wave5-vpu.c
index a9bd96cbf9ac..9bc216052a15 100644
--- a/drivers/media/platform/chips-media/wave5/wave5-vpu.c
+++ b/drivers/media/platform/chips-media/wave5/wave5-vpu.c
@@ -51,6 +51,7 @@ static void wave5_vpu_handle_irq(void *dev_id)
u32 seq_done;
u32 cmd_done;
u32 irq_reason;
+ u32 irq_subreason;
struct vpu_instance *inst, *tmp;
struct vpu_device *dev = dev_id;
@@ -81,8 +82,17 @@ static void wave5_vpu_handle_irq(void *dev_id)
irq_reason & BIT(INT_WAVE5_ENC_PIC)) {
if (cmd_done & BIT(inst->id)) {
cmd_done &= ~BIT(inst->id);
- wave5_vdi_write_register(dev, W5_RET_QUEUE_CMD_DONE_INST,
- cmd_done);
+ if (dev->irq < 0) {
+ irq_subreason =
+ wave5_vdi_read_register(dev, W5_VPU_VINT_REASON);
+ if (!(irq_subreason & BIT(INT_WAVE5_DEC_PIC)))
+ wave5_vdi_write_register(dev,
+ W5_RET_QUEUE_CMD_DONE_INST,
+ cmd_done);
+ } else {
+ wave5_vdi_write_register(dev, W5_RET_QUEUE_CMD_DONE_INST,
+ cmd_done);
+ }
inst->ops->finish_process(inst);
}
}
--
2.43.0
next prev parent reply other threads:[~2024-11-12 2:15 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-12 2:15 [PATCH v0 0/6] Improve decoder performance and fix critical bugs Jackson.lee
2024-11-12 2:15 ` [PATCH v0 1/6] media: chips-media: wave5: Fix to display gray color on screen Jackson.lee
2024-11-12 2:15 ` [PATCH v0 2/6] media: chips-media: wave5: Avoid race condition for interrupt handling Jackson.lee
2024-11-12 2:15 ` [PATCH v0 3/6] media: chips-media: wave5: Improve performance of decoder Jackson.lee
2024-11-29 15:52 ` Sebastian Fricke
2024-12-02 3:31 ` jackson.lee
2024-11-12 2:15 ` Jackson.lee [this message]
2024-11-12 2:15 ` [PATCH v0 5/6] media: chips-media: wave5: Fix hang after seeking Jackson.lee
2024-11-12 2:15 ` [PATCH v0 6/6] media: chips-media: wave5: Fix timeout while testing 10bit hevc fluster Jackson.lee
2024-11-22 3:54 ` [PATCH v0 0/6] Improve decoder performance and fix critical bugs jackson.lee
2024-11-26 8:09 ` sebastian.fricke
2024-11-27 1:21 ` jackson.lee
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=20241112021517.121-5-jackson.lee@chipsnmedia.com \
--to=jackson.lee@chipsnmedia.com \
--cc=b-brnich@ti.com \
--cc=hverkuil@xs4all.nl \
--cc=lafley.kim@chipsnmedia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=nas.chung@chipsnmedia.com \
--cc=nicolas@ndufresne.ca \
--cc=sebastian.fricke@collabora.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®