Commit 467bf30
regulator: push allocation in regulator_ena_gpio_request() out of lock
Move another allocation out of regulator_list_mutex-protected region, as
reclaim might want to take the same lock.
WARNING: possible circular locking dependency detected
5.7.13+ torvalds#534 Not tainted
------------------------------------------------------
kswapd0/383 is trying to acquire lock:
c0e5d920 (regulator_list_mutex){+.+.}-{3:3}, at: regulator_lock_dependent+0x54/0x2c0
but task is already holding lock:
c0e38518 (fs_reclaim){+.+.}-{0:0}, at: __fs_reclaim_acquire+0x0/0x50
which lock already depends on the new lock.
the existing dependency chain (in reverse order) is:
-> #1 (fs_reclaim){+.+.}-{0:0}:
fs_reclaim_acquire.part.11+0x40/0x50
fs_reclaim_acquire+0x24/0x28
kmem_cache_alloc_trace+0x40/0x1e8
regulator_register+0x384/0x1630
devm_regulator_register+0x50/0x84
reg_fixed_voltage_probe+0x248/0x35c
[...]
other info that might help us debug this:
Possible unsafe locking scenario:
CPU0 CPU1
---- ----
lock(fs_reclaim);
lock(regulator_list_mutex);
lock(fs_reclaim);
lock(regulator_list_mutex);
*** DEADLOCK ***
[...]
2 locks held by kswapd0/383:
#0: c0e38518 (fs_reclaim){+.+.}-{0:0}, at: __fs_reclaim_acquire+0x0/0x50
#1: cb70e5e0 (hctx->srcu){....}-{0:0}, at: hctx_lock+0x60/0xb8
[...]
Fixes: 541d052 ("regulator: core: Only support passing enable GPIO descriptors")
[this commit only changes context]
Fixes: f8702f9 ("regulator: core: Use ww_mutex for regulators locking")
[this is when the regulator_list_mutex was introduced in reclaim locking path]
Signed-off-by: Michał Mirosław <[email protected]>
Link: https://lore.kernel.org/r/41fe6a9670335721b48e8f5195038c3d67a3bf92.1597195321.git.mirq-linux@rere.qmqm.pl
Signed-off-by: Mark Brown <[email protected]>1 parent 73a3212 commit 467bf30
1 file changed
+14
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2230 | 2230 | | |
2231 | 2231 | | |
2232 | 2232 | | |
2233 | | - | |
| 2233 | + | |
2234 | 2234 | | |
2235 | 2235 | | |
2236 | 2236 | | |
| 2237 | + | |
| 2238 | + | |
| 2239 | + | |
2237 | 2240 | | |
2238 | 2241 | | |
2239 | 2242 | | |
| |||
2242 | 2245 | | |
2243 | 2246 | | |
2244 | 2247 | | |
2245 | | - | |
2246 | | - | |
| 2248 | + | |
| 2249 | + | |
2247 | 2250 | | |
| 2251 | + | |
| 2252 | + | |
| 2253 | + | |
| 2254 | + | |
2248 | 2255 | | |
2249 | 2256 | | |
2250 | 2257 | | |
2251 | 2258 | | |
2252 | 2259 | | |
2253 | 2260 | | |
2254 | 2261 | | |
| 2262 | + | |
| 2263 | + | |
| 2264 | + | |
| 2265 | + | |
2255 | 2266 | | |
2256 | 2267 | | |
2257 | 2268 | | |
| |||
5209 | 5220 | | |
5210 | 5221 | | |
5211 | 5222 | | |
5212 | | - | |
5213 | 5223 | | |
5214 | | - | |
5215 | 5224 | | |
5216 | 5225 | | |
5217 | 5226 | | |
| |||
0 commit comments