summaryrefslogtreecommitdiff
path: root/drivers/media
diff options
context:
space:
mode:
authorSergey Senozhatsky <senozhatsky@chromium.org>2024-12-24 16:24:05 +0900
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-02-17 11:36:47 +0100
commit554fc25cfe6f0e88aa7b464efc8464a5a1037613 (patch)
tree0f9a1089b92c217c734b5046f1c8afb678daf42f /drivers/media
parent4e4be4fd280d41c7fded02bc7adda50a3fc40b35 (diff)
downloadlinux-554fc25cfe6f0e88aa7b464efc8464a5a1037613.tar.gz
linux-554fc25cfe6f0e88aa7b464efc8464a5a1037613.tar.bz2
linux-554fc25cfe6f0e88aa7b464efc8464a5a1037613.zip
media: venus: destroy hfi session after m2m_ctx release
commit df4ff47448fe0d392b29868e8398e3b0e587514d upstream. This partially reverts commit that made hfi_session_destroy() the first step of vdec/venc close(). The reason being is a regression report when, supposedly, encode/decoder is closed with still active streaming (no ->stop_streaming() call before close()) and pending pkts, so isr_thread cannot find instance and fails to process those pending pkts. This was the idea behind the original patch - make it impossible to use instance under destruction, because this is racy, but apparently there are uses cases that depend on that unsafe pattern. Return to the old (unsafe) behaviour for the time being (until a better fix is found). Fixes: 45b1a1b348ec ("media: venus: sync with threaded IRQ during inst destruction") Cc: stable@vger.kernel.org Reported-by: Nathan Hebert <nhebert@google.com> Signed-off-by: Sergey Senozhatsky <senozhatsky@chromium.org> Signed-off-by: Stanimir Varbanov <stanimir.k.varbanov@gmail.com> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/platform/qcom/venus/core.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c
index 2d27c5167246..807487a1f536 100644
--- a/drivers/media/platform/qcom/venus/core.c
+++ b/drivers/media/platform/qcom/venus/core.c
@@ -506,18 +506,14 @@ err_cpucfg_path:
void venus_close_common(struct venus_inst *inst)
{
/*
- * First, remove the inst from the ->instances list, so that
- * to_instance() will return NULL.
- */
- hfi_session_destroy(inst);
- /*
- * Second, make sure we don't have IRQ/IRQ-thread currently running
+ * Make sure we don't have IRQ/IRQ-thread currently running
* or pending execution, which would race with the inst destruction.
*/
synchronize_irq(inst->core->irq);
v4l2_m2m_ctx_release(inst->m2m_ctx);
v4l2_m2m_release(inst->m2m_dev);
+ hfi_session_destroy(inst);
v4l2_fh_del(&inst->fh);
v4l2_fh_exit(&inst->fh);
v4l2_ctrl_handler_free(&inst->ctrl_handler);