Skip to content

Commit df4ff47

Browse files
sergey-senozhatskyhverkuil
authored andcommitted
media: venus: destroy hfi session after m2m_ctx release
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: 45b1a1b ("media: venus: sync with threaded IRQ during inst destruction") Cc: [email protected] Reported-by: Nathan Hebert <[email protected]> Signed-off-by: Sergey Senozhatsky <[email protected]> Signed-off-by: Stanimir Varbanov <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
1 parent ab2fd4a commit df4ff47

File tree

1 file changed

+2
-6
lines changed
  • drivers/media/platform/qcom/venus

1 file changed

+2
-6
lines changed

drivers/media/platform/qcom/venus/core.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -506,18 +506,14 @@ static __maybe_unused int venus_runtime_suspend(struct device *dev)
506506
void venus_close_common(struct venus_inst *inst)
507507
{
508508
/*
509-
* First, remove the inst from the ->instances list, so that
510-
* to_instance() will return NULL.
511-
*/
512-
hfi_session_destroy(inst);
513-
/*
514-
* Second, make sure we don't have IRQ/IRQ-thread currently running
509+
* Make sure we don't have IRQ/IRQ-thread currently running
515510
* or pending execution, which would race with the inst destruction.
516511
*/
517512
synchronize_irq(inst->core->irq);
518513

519514
v4l2_m2m_ctx_release(inst->m2m_ctx);
520515
v4l2_m2m_release(inst->m2m_dev);
516+
hfi_session_destroy(inst);
521517
v4l2_fh_del(&inst->fh);
522518
v4l2_fh_exit(&inst->fh);
523519
v4l2_ctrl_handler_free(&inst->ctrl_handler);

0 commit comments

Comments
 (0)