Johan Hovold
36be7afca1
regulator: core: fix deadlock on regulator enable
...
commit cb3543cff9 upstream.
When updating the operating mode as part of regulator enable, the caller
has already locked the regulator tree and drms_uA_update() must not try
to do the same in order not to trigger a deadlock.
The lock inversion is reported by lockdep as:
======================================================
WARNING: possible circular locking dependency detected
6.1.0-next-20221215 #142 Not tainted
------------------------------------------------------
udevd/154 is trying to acquire lock:
ffffc11f123d7e50 (regulator_list_mutex){+.+.}-{3:3}, at: regulator_lock_dependent+0x54/0x280
but task is already holding lock:
ffff80000e4c36e8 (regulator_ww_class_acquire){+.+.}-{0:0}, at: regulator_enable+0x34/0x80
which lock already depends on the new lock.
...
Possible unsafe locking scenario:
CPU0 CPU1
---- ----
lock(regulator_ww_class_acquire);
lock(regulator_list_mutex);
lock(regulator_ww_class_acquire);
lock(regulator_list_mutex);
*** DEADLOCK ***
just before probe of a Qualcomm UFS controller (occasionally) deadlocks
when enabling one of its regulators.
Fixes: 9243a195be ("regulator: core: Change voltage setting path")
Fixes: f8702f9e4a ("regulator: core: Use ww_mutex for regulators locking")
Cc: stable@vger.kernel.org # 5.0
Signed-off-by: Johan Hovold <johan+linaro@kernel.org >
Link: https://lore.kernel.org/r/20221215104646.19818-1-johan+linaro@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-01-14 10:16:24 +01:00
..
2020-08-21 17:28:09 +01:00
2020-05-08 18:18:13 +01:00
2019-06-19 17:09:55 +02:00
2019-06-05 17:37:07 +02:00
2019-05-30 11:29:22 -07:00
2019-05-30 11:29:22 -07:00
2020-06-25 20:11:13 +01:00
2020-05-08 18:18:13 +01:00
2020-05-08 18:18:13 +01:00
2019-05-30 11:25:18 -07:00
2020-06-18 13:47:31 +01:00
2020-05-08 18:18:13 +01:00
2020-05-08 18:18:13 +01:00
2020-05-08 18:18:13 +01:00
2020-05-08 18:18:13 +01:00
2021-03-04 11:37:58 +01:00
2020-05-08 18:18:13 +01:00
2021-06-16 12:01:43 +02:00
2021-04-14 08:42:05 +02:00
2021-05-14 09:50:10 +02:00
2020-05-08 18:18:13 +01:00
2020-05-08 18:18:13 +01:00
2023-01-14 10:16:24 +01:00
2020-06-25 20:11:16 +01:00
2021-06-23 14:42:47 +02:00
2020-06-25 15:29:21 +01:00
2021-07-14 16:55:56 +02:00
2020-09-07 18:35:25 +01:00
2020-09-07 18:35:25 +01:00
2020-09-07 18:35:25 +01:00
2020-09-07 18:35:25 +01:00
2019-05-03 15:07:39 +09:00
2020-09-07 18:35:25 +01:00
2019-05-03 15:07:39 +09:00
2020-05-06 15:16:59 +01:00
2020-08-21 17:38:49 +01:00
2019-05-30 11:29:22 -07:00
2020-07-08 17:37:54 +01:00
2020-09-14 14:24:36 +01:00
2019-05-30 11:26:32 -07:00
2020-08-21 17:28:11 +01:00
2021-07-14 16:56:06 +02:00
2018-09-17 14:32:22 -07:00
2020-09-14 14:24:37 +01:00
2020-07-20 16:31:54 +01:00
2020-06-12 14:57:17 +01:00
2021-07-14 16:56:09 +02:00
2021-07-28 14:35:36 +02:00
2020-07-22 14:43:48 +01:00
2019-11-15 12:04:20 +00:00
2019-01-28 15:30:58 +00:00
2020-01-13 15:03:06 +00:00
2020-09-28 19:26:32 +01:00
2019-07-22 13:18:13 +01:00
2020-09-07 18:49:13 +01:00
2019-06-19 17:09:55 +02:00
2020-07-22 14:43:48 +01:00
2020-01-13 15:03:06 +00:00
2019-06-19 17:09:55 +02:00
2020-09-07 18:35:25 +01:00
2020-05-08 18:18:13 +01:00
2019-09-09 10:53:48 +01:00
2020-07-22 14:43:48 +01:00
2020-09-07 18:35:25 +01:00
2020-09-07 18:35:25 +01:00
2020-09-28 19:26:32 +01:00
2020-08-21 17:28:14 +01:00
2019-06-19 17:09:55 +02:00
2019-08-15 15:09:21 +01:00
2020-06-18 13:47:34 +01:00
2019-06-19 17:09:55 +02:00
2019-06-18 19:12:47 +01:00
2018-12-11 01:04:31 +00:00
2020-06-18 13:47:35 +01:00
2020-06-26 15:34:18 +01:00
2020-06-25 20:11:17 +01:00
2021-06-16 12:01:43 +02:00
2020-05-08 18:18:13 +01:00
2019-10-07 14:02:20 +01:00
2018-08-08 10:52:50 +01:00
2019-06-10 15:40:58 +01:00
2020-08-21 17:28:15 +01:00
2019-03-04 00:01:08 +00:00
2019-05-30 11:26:32 -07:00
2019-03-04 00:01:08 +00:00
2019-03-04 00:01:08 +00:00
2020-05-08 18:18:13 +01:00
2020-08-24 14:17:53 +01:00
2020-02-17 19:13:26 +00:00
2020-05-08 18:18:13 +01:00
2020-01-14 15:25:00 +00:00
2020-01-17 15:34:31 +00:00
2020-01-13 15:03:06 +00:00
2019-04-26 10:38:23 +01:00
2020-05-08 18:18:13 +01:00
2021-07-14 16:55:56 +02:00
2020-08-27 14:55:44 +01:00
2020-05-08 18:18:13 +01:00
2020-07-02 15:25:45 +01:00
2022-08-21 15:15:36 +02:00
2020-05-08 18:18:13 +01:00
2020-07-22 14:43:48 +01:00
2021-03-25 09:04:14 +01:00
2019-10-01 12:46:37 +01:00
2019-05-30 11:26:32 -07:00
2022-09-23 14:16:59 +02:00
2020-09-07 18:35:25 +01:00
2019-05-03 15:05:52 +09:00
2020-09-07 18:35:25 +01:00
2019-05-03 15:05:52 +09:00
2020-09-07 18:35:25 +01:00
2019-05-03 15:05:52 +09:00
2020-10-05 16:54:56 +01:00
2022-10-26 13:25:09 +02:00
2022-08-21 15:15:34 +02:00
2020-10-01 21:25:23 +01:00
2020-08-18 18:38:25 +01:00
2020-10-01 21:43:16 +01:00
2021-03-30 14:31:51 +02:00
2019-05-30 11:29:52 -07:00
2020-05-08 18:18:13 +01:00
2019-12-17 13:08:41 -08:00
2021-03-04 11:38:07 +01:00
2022-04-08 14:40:30 +02:00
2021-06-23 14:42:48 +02:00
2019-06-05 17:37:18 +02:00
2021-08-08 09:05:22 +02:00
2020-01-06 20:47:42 +00:00
2020-05-08 18:18:13 +01:00
2021-11-18 14:03:45 +01:00
2019-03-26 13:25:35 +00:00
2020-05-08 18:18:13 +01:00
2022-12-14 11:31:53 +01:00
2019-05-13 11:07:43 +01:00
2020-08-21 17:28:20 +01:00
2020-08-21 17:28:17 +01:00
2020-08-21 17:28:18 +01:00
2020-09-07 18:35:25 +01:00
2020-09-14 14:24:38 +01:00
2020-08-21 17:28:19 +01:00
2020-01-13 15:03:06 +00:00
2020-08-18 17:18:40 +01:00
2020-11-18 17:59:24 +00:00
2020-09-01 15:48:52 +01:00
2020-07-22 14:43:48 +01:00
2019-04-15 09:44:41 +01:00
2020-09-01 15:48:56 +01:00
2020-09-01 15:48:51 +01:00
2020-09-01 15:48:53 +01:00
2020-08-21 17:28:21 +01:00
2020-09-01 15:48:54 +01:00
2020-09-01 15:48:55 +01:00
2020-01-13 15:03:06 +00:00
2020-07-22 14:43:48 +01:00
2020-07-22 14:43:48 +01:00
2021-09-15 09:50:23 +02:00
2020-09-01 15:48:56 +01:00
2020-04-14 16:57:44 +01:00
2022-12-14 11:31:54 +01:00
2020-05-08 18:18:13 +01:00
2021-07-14 16:55:50 +02:00
2019-05-30 11:26:32 -07:00
2021-09-15 09:50:30 +02:00
2019-11-18 12:58:24 +00:00
2019-05-30 11:26:32 -07:00
2020-01-17 15:34:21 +00:00
2020-09-07 18:35:25 +01:00
2020-09-07 18:35:25 +01:00
2020-09-07 18:35:25 +01:00
2020-09-07 18:35:25 +01:00
2020-06-26 15:34:24 +01:00
2022-04-20 09:23:22 +02:00