Skip to content

Commit aa00a63

Browse files
robclarkintel-lab-lkp
authored andcommitted
PM / QoS: Teach lockdep about dev_pm_qos_mtx locking order
Annotate dev_pm_qos_mtx to teach lockdep to scream about allocations that could trigger reclaim under dev_pm_qos_mtx. Signed-off-by: Rob Clark <[email protected]>
1 parent d308a44 commit aa00a63

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

drivers/base/power/qos.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1017,3 +1017,14 @@ void dev_pm_qos_hide_latency_tolerance(struct device *dev)
10171017
pm_runtime_put(dev);
10181018
}
10191019
EXPORT_SYMBOL_GPL(dev_pm_qos_hide_latency_tolerance);
1020+
1021+
static int __init dev_pm_qos_init(void)
1022+
{
1023+
/* Teach lockdep about lock ordering wrt. shrinker: */
1024+
fs_reclaim_acquire(GFP_KERNEL);
1025+
might_lock(&dev_pm_qos_mtx);
1026+
fs_reclaim_release(GFP_KERNEL);
1027+
1028+
return 0;
1029+
}
1030+
early_initcall(dev_pm_qos_init);

0 commit comments

Comments
 (0)