Commit bd62c0b
cpufreq: Initialize cpufreq-based invariance before subsys
[ Upstream commit 8ffe28b4e8d8b18cb2f2933410322c24f039d5d6 ]
commit 2a6c72738706 ("cpufreq: Initialize cpufreq-based
frequency-invariance later") postponed the frequency invariance
initialization to avoid disabling it in the error case.
This isn't locking safe, instead move the initialization up before
the subsys interface is registered (which will rebuild the
sched_domains) and add the corresponding disable on the error path.
Observed lockdep without this patch:
[ 0.989686] ======================================================
[ 0.989688] WARNING: possible circular locking dependency detected
[ 0.989690] 6.17.0-rc4-cix-build+ deepin-community#31 Tainted: G S
[ 0.989691] ------------------------------------------------------
[ 0.989692] swapper/0/1 is trying to acquire lock:
[ 0.989693] ffff800082ada7f8 (sched_energy_mutex){+.+.}-{4:4}, at: rebuild_sched_domains_energy+0x30/0x58
[ 0.989705]
but task is already holding lock:
[ 0.989706] ffff000088c89bc8 (&policy->rwsem){+.+.}-{4:4}, at: cpufreq_online+0x7f8/0xbe0
[ 0.989713]
which lock already depends on the new lock.
Fixes: 2a6c72738706 ("cpufreq: Initialize cpufreq-based frequency-invariance later")
Signed-off-by: Christian Loehle <[email protected]>
Signed-off-by: Rafael J. Wysocki <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
(cherry picked from commit 6017196aabf1dfd1cffa7d9a109317eabf8c477e)1 parent 0a514b6 commit bd62c0b
1 file changed
+11
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2950 | 2950 | | |
2951 | 2951 | | |
2952 | 2952 | | |
| 2953 | + | |
| 2954 | + | |
| 2955 | + | |
| 2956 | + | |
| 2957 | + | |
| 2958 | + | |
| 2959 | + | |
| 2960 | + | |
| 2961 | + | |
2953 | 2962 | | |
2954 | 2963 | | |
2955 | 2964 | | |
| |||
2971 | 2980 | | |
2972 | 2981 | | |
2973 | 2982 | | |
2974 | | - | |
2975 | | - | |
2976 | | - | |
2977 | | - | |
2978 | | - | |
2979 | | - | |
2980 | | - | |
2981 | | - | |
2982 | | - | |
2983 | 2983 | | |
2984 | 2984 | | |
2985 | 2985 | | |
2986 | 2986 | | |
2987 | 2987 | | |
2988 | 2988 | | |
| 2989 | + | |
| 2990 | + | |
2989 | 2991 | | |
2990 | 2992 | | |
2991 | 2993 | | |
| |||
0 commit comments