drivers: soc: ti: knav_qmss_queue: Pass lockdep expression to RCU lists

inst->handles is traversed using list_for_each_entry_rcu
outside an RCU read-side critical section but under the protection
of knav_dev_lock.

Hence, add corresponding lockdep expression to silence false-positive
lockdep warnings, and harden RCU lists.

Add macro for the corresponding lockdep expression.

Link: https://lore.kernel.org/r/20200118042433.4968-1-frextrite@gmail.com
Signed-off-by: Amol Grover <frextrite@gmail.com>
Acked-by: Santosh Shilimkar <ssantosh@kernel.org>
Signed-off-by: Olof Johansson <olof@lixom.net>
This commit is contained in:
Amol Grover
2020-01-18 09:54:34 +05:30
committed by Olof Johansson
parent 2ced5a3449
commit feec214afb

View File

@@ -25,6 +25,8 @@
static struct knav_device *kdev; static struct knav_device *kdev;
static DEFINE_MUTEX(knav_dev_lock); static DEFINE_MUTEX(knav_dev_lock);
#define knav_dev_lock_held() \
lockdep_is_held(&knav_dev_lock)
/* Queue manager register indices in DTS */ /* Queue manager register indices in DTS */
#define KNAV_QUEUE_PEEK_REG_INDEX 0 #define KNAV_QUEUE_PEEK_REG_INDEX 0
@@ -53,7 +55,8 @@ static DEFINE_MUTEX(knav_dev_lock);
(kdev->instances + (idx << kdev->inst_shift)) (kdev->instances + (idx << kdev->inst_shift))
#define for_each_handle_rcu(qh, inst) \ #define for_each_handle_rcu(qh, inst) \
list_for_each_entry_rcu(qh, &inst->handles, list) list_for_each_entry_rcu(qh, &inst->handles, list, \
knav_dev_lock_held())
#define for_each_instance(idx, inst, kdev) \ #define for_each_instance(idx, inst, kdev) \
for (idx = 0, inst = kdev->instances; \ for (idx = 0, inst = kdev->instances; \