Skip to content

Commit feec214

Browse files
frextriteolofj
authored andcommitted
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/[email protected] Signed-off-by: Amol Grover <[email protected]> Acked-by: Santosh Shilimkar <[email protected]> Signed-off-by: Olof Johansson <[email protected]>
1 parent 2ced5a3 commit feec214

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

drivers/soc/ti/knav_qmss_queue.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525

2626
static struct knav_device *kdev;
2727
static DEFINE_MUTEX(knav_dev_lock);
28+
#define knav_dev_lock_held() \
29+
lockdep_is_held(&knav_dev_lock)
2830

2931
/* Queue manager register indices in DTS */
3032
#define KNAV_QUEUE_PEEK_REG_INDEX 0
@@ -52,8 +54,9 @@ static DEFINE_MUTEX(knav_dev_lock);
5254
#define knav_queue_idx_to_inst(kdev, idx) \
5355
(kdev->instances + (idx << kdev->inst_shift))
5456

55-
#define for_each_handle_rcu(qh, inst) \
56-
list_for_each_entry_rcu(qh, &inst->handles, list)
57+
#define for_each_handle_rcu(qh, inst) \
58+
list_for_each_entry_rcu(qh, &inst->handles, list, \
59+
knav_dev_lock_held())
5760

5861
#define for_each_instance(idx, inst, kdev) \
5962
for (idx = 0, inst = kdev->instances; \

0 commit comments

Comments
 (0)