* [BUG] media: platform: qcom: venus: possible ABBA deadlock in venus_event_notify() and venus_helper_vb2_buf_queue()
@ 2021-08-23 11:50 Jia-Ju Bai
0 siblings, 0 replies; only message in thread
From: Jia-Ju Bai @ 2021-08-23 11:50 UTC (permalink / raw)
To: stanimir.varbanov, agross, bjorn.andersson, Mauro Carvalho Chehab
Cc: Linux Media Mailing List, linux-arm-msm, linux-kernel
Hello,
My static analysis tool reports a possible ABBA deadlock in the venus
driver in Linux 5.10:
venus_event_notify()
mutex_lock(&core->lock); --> line 37 (Lock A)
vdec_event_notify() --> via a function pointer
"inst->ops->event_notify(...)"
vdec_event_change()
mutex_lock(&inst->lock); --> line 1301 (Lock B)
venus_helper_vb2_buf_queue()
mutex_lock(&inst->lock); --> line 1346 (Lock B)
session_process_buf()
venus_pm_load_scale()
load_scale_v4() via a function pointer
"core->pm_ops->load_scale(...)"
mutex_lock(&core->lock); --> line 966 (Lock A)
Besides, if "core->pm_ops->load_scale(...)" is load_scale_v1():
load_scale_v1()
load_per_type()
mutex_lock(&core->lock); --> line 150 (Lock A)
When venus_event_notify() and venus_helper_vb2_buf_queue() are
concurrently executed, the deadlock can occur.
I am not quite sure whether this possible deadlock is real and how to
fix it if it is real.
Any feedback would be appreciated, thanks
Reported-by: TOTE Robot <oslab@tsinghua.edu.cn>
Best wishes,
Jia-Ju Bai
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-08-23 11:50 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-23 11:50 [BUG] media: platform: qcom: venus: possible ABBA deadlock in venus_event_notify() and venus_helper_vb2_buf_queue() Jia-Ju Bai
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).