Skip to content

Commit 1361917

Browse files
robclarkGeorgi Djakov
authored andcommitted
interconnect: Teach lockdep about icc_bw_lock order
Teach lockdep that icc_bw_lock is needed in code paths that could deadlock if they trigger reclaim. Signed-off-by: Rob Clark <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Georgi Djakov <[email protected]>
1 parent af42269 commit 1361917

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

drivers/interconnect/core.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1041,13 +1041,21 @@ void icc_sync_state(struct device *dev)
10411041
}
10421042
}
10431043
}
1044+
mutex_unlock(&icc_bw_lock);
10441045
mutex_unlock(&icc_lock);
10451046
}
10461047
EXPORT_SYMBOL_GPL(icc_sync_state);
10471048

10481049
static int __init icc_init(void)
10491050
{
1050-
struct device_node *root = of_find_node_by_path("/");
1051+
struct device_node *root;
1052+
1053+
/* Teach lockdep about lock ordering wrt. shrinker: */
1054+
fs_reclaim_acquire(GFP_KERNEL);
1055+
might_lock(&icc_bw_lock);
1056+
fs_reclaim_release(GFP_KERNEL);
1057+
1058+
root = of_find_node_by_path("/");
10511059

10521060
providers_count = of_count_icc_providers(root);
10531061
of_node_put(root);

0 commit comments

Comments
 (0)