[<prev] [next>] [day] [month] [year] [list]
Message-ID: <b5c2a28b-9c67-05d1-0bed-eac8af508d07@gmail.com>
Date: Mon, 23 Aug 2021 19:50:31 +0800
From: Jia-Ju Bai <baijiaju1990@...il.com>
To: stanimir.varbanov@...aro.org, agross@...nel.org,
bjorn.andersson@...aro.org,
Mauro Carvalho Chehab <mchehab@...nel.org>
Cc: Linux Media Mailing List <linux-media@...r.kernel.org>,
linux-arm-msm@...r.kernel.org,
linux-kernel <linux-kernel@...r.kernel.org>
Subject: [BUG] media: platform: qcom: venus: possible ABBA deadlock in
venus_event_notify() and venus_helper_vb2_buf_queue()
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@...nghua.edu.cn>
Best wishes,
Jia-Ju Bai
Powered by blists - more mailing lists