summaryrefslogtreecommitdiff
path: root/drivers/interconnect/core.c
diff options
context:
space:
mode:
authorRob Clark <robdclark@chromium.org>2023-08-07 10:11:41 -0700
committerGeorgi Djakov <djakov@kernel.org>2023-08-22 01:25:06 +0300
commit13619170303878e1dae86d9a58b039475c957fcf (patch)
tree2d3b2914caeb2fb01b1ccdfa6bcc0ca02a1bdf3c /drivers/interconnect/core.c
parentaf42269c3523492d71ebbe11fefae2653e9cdc78 (diff)
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 <robdclark@chromium.org> Link: https://lore.kernel.org/r/20230807171148.210181-8-robdclark@gmail.com Signed-off-by: Georgi Djakov <djakov@kernel.org>
Diffstat (limited to 'drivers/interconnect/core.c')
-rw-r--r--drivers/interconnect/core.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/interconnect/core.c b/drivers/interconnect/core.c
index e15a92a79df1..1afbc4f7c6e7 100644
--- a/drivers/interconnect/core.c
+++ b/drivers/interconnect/core.c
@@ -1041,13 +1041,21 @@ void icc_sync_state(struct device *dev)
}
}
}
+ mutex_unlock(&icc_bw_lock);
mutex_unlock(&icc_lock);
}
EXPORT_SYMBOL_GPL(icc_sync_state);
static int __init icc_init(void)
{
- struct device_node *root = of_find_node_by_path("/");
+ struct device_node *root;
+
+ /* Teach lockdep about lock ordering wrt. shrinker: */
+ fs_reclaim_acquire(GFP_KERNEL);
+ might_lock(&icc_bw_lock);
+ fs_reclaim_release(GFP_KERNEL);
+
+ root = of_find_node_by_path("/");
providers_count = of_count_icc_providers(root);
of_node_put(root);