From: Jia-Ju Bai <baijiaju1990@gmail.com>
To: stanimir.varbanov@linaro.org, agross@kernel.org,
bjorn.andersson@linaro.org,
Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: Linux Media Mailing List <linux-media@vger.kernel.org>,
linux-arm-msm@vger.kernel.org,
linux-kernel <linux-kernel@vger.kernel.org>
Subject: [BUG] media: platform: qcom: venus: possible ABBA deadlock in venus_event_notify() and venus_helper_vb2_buf_queue()
Date: Mon, 23 Aug 2021 19:50:31 +0800 [thread overview]
Message-ID: <b5c2a28b-9c67-05d1-0bed-eac8af508d07@gmail.com> (raw)
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
reply other threads:[~2021-08-23 11:50 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=b5c2a28b-9c67-05d1-0bed-eac8af508d07@gmail.com \
--to=baijiaju1990@gmail.com \
--cc=agross@kernel.org \
--cc=bjorn.andersson@linaro.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=stanimir.varbanov@linaro.org \
/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