Manivannan Sadhasivam
f41fef7a81
bus: mhi: ep: Change state_lock to mutex
...
[ Upstream commit 1ddc761829 ]
state_lock, the spinlock type is meant to protect race against concurrent
MHI state transitions. In mhi_ep_set_m0_state(), while the state_lock is
being held, the channels are resumed in mhi_ep_resume_channels() if the
previous state was M3. This causes sleeping in atomic bug, since
mhi_ep_resume_channels() use mutex internally.
Since the state_lock is supposed to be held throughout the state change,
it is not ideal to drop the lock before calling mhi_ep_resume_channels().
So to fix this issue, let's change the type of state_lock to mutex. This
would also allow holding the lock throughout all state transitions thereby
avoiding any potential race.
Cc: <stable@vger.kernel.org > # 5.19
Fixes: e4b7b5f0f3 ("bus: mhi: ep: Add support for suspending and resuming channels")
Reported-by: Dan Carpenter <error27@gmail.com >
Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com >
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2023-03-17 08:57:49 +01:00
..
2023-02-02 13:40:23 +01:00
2023-01-01 09:27:12 +00:00
2023-01-20 10:54:05 +01:00
2022-12-15 09:45:51 -08:00
2022-12-11 21:25:58 +01:00
2023-03-11 13:50:33 +01:00
2022-12-21 09:19:24 -08:00
2023-03-10 09:28:24 +01:00
2023-02-07 19:01:06 -08:00
2023-01-02 12:08:53 +01:00
2023-01-02 15:10:05 +01:00
2023-02-16 21:23:52 +00:00
2023-01-12 19:42:53 +01:00
2022-12-08 13:02:37 +00:00
2022-12-17 14:06:53 -06:00
2023-01-10 23:05:26 +01:00
2022-12-19 08:47:33 -06:00
2023-01-07 10:38:11 -08:00
2022-12-12 15:05:30 +01:00
2023-01-24 13:41:57 +01:00
2023-01-04 14:43:27 -07:00
2022-12-07 09:43:12 -07:00
2022-12-13 10:43:59 -08:00
2022-12-13 10:43:59 -08:00
2023-03-11 11:04:54 +01:00
2023-03-11 13:50:38 +01:00
2022-12-04 12:59:58 -08:00
2022-12-10 13:20:53 -08:00
2023-03-10 09:28:22 +01:00
2022-12-07 13:49:21 -08:00
2022-12-12 15:48:36 -08:00
2022-12-07 13:54:01 -08:00
2023-03-10 09:29:09 +01:00
2023-03-10 09:29:09 +01:00
2022-12-06 16:55:18 +01:00
2023-03-10 09:29:06 +01:00
2022-12-12 18:18:34 -08:00
2022-12-13 15:47:48 -08:00
2022-12-13 19:29:45 -08:00
2022-12-11 18:12:17 -08:00
2023-03-10 09:28:55 +01:00
2023-01-09 22:05:54 +01:00
2023-01-05 15:12:12 +00:00
2022-12-13 10:33:08 -08:00
2023-02-10 11:03:37 +01:00
2022-12-17 14:06:53 -06:00
2022-12-14 12:20:00 -08:00
2022-12-13 09:47:48 -08:00
2023-01-02 12:27:25 +01:00
2023-03-10 09:28:55 +01:00
2023-03-17 08:57:48 +01:00
2023-01-31 16:44:09 -08:00
2022-12-02 13:10:36 -08:00
2023-02-17 15:07:05 -08:00
2022-12-04 16:45:02 -08:00
2023-03-10 09:29:36 +01:00
2023-01-04 13:49:54 -07:00
2022-12-07 06:47:13 -07:00
2022-12-11 19:30:19 -08:00
2023-03-11 13:50:38 +01:00
2022-12-16 03:54:54 -08:00
2022-12-05 22:22:34 +01:00
2022-12-05 19:21:01 +01:00
2022-12-08 21:49:25 -05:00
2022-12-11 19:30:20 -08:00
2023-03-10 09:28:04 +01:00
2023-03-10 09:29:35 +01:00
2022-12-15 11:12:21 -08:00
2023-03-10 09:29:42 +01:00
2022-12-13 09:47:48 -08:00
2022-12-13 09:47:48 -08:00
2022-12-08 21:49:25 -05:00
2023-01-31 16:44:10 -08:00
2023-03-17 08:57:49 +01:00
2023-01-11 16:14:20 -08:00
2023-01-11 16:14:22 -08:00
2023-02-03 17:52:24 -08:00
2022-12-13 19:29:45 -08:00
2022-12-13 12:28:51 +01:00
2022-12-13 15:47:48 -08:00
2022-12-05 22:22:34 +01:00
2023-03-10 09:29:48 +01:00
2023-02-16 11:53:47 +01:00
2023-03-11 13:50:30 +01:00
2022-12-07 10:56:29 +08:00
2022-12-10 11:01:12 -05:00
2023-03-10 09:28:41 +01:00
2023-02-25 11:13:28 +01:00
2022-12-28 06:26:31 -10:00
2023-01-28 14:36:29 +01:00
2023-01-11 16:14:22 -08:00
2022-12-15 11:12:21 -08:00
2022-12-11 18:12:12 -08:00
2022-12-11 18:12:08 -08:00
2022-12-02 13:04:44 -08:00
2023-03-11 13:50:45 +01:00
2023-03-11 13:50:41 +01:00
2022-12-05 09:31:46 +01:00
2022-12-12 16:07:04 -08:00
2022-12-17 14:06:53 -06:00
2023-01-01 11:56:22 +00:00
2023-01-04 14:44:13 -07:00
2023-03-10 09:29:05 +01:00
2022-12-20 03:13:45 +01:00
2022-12-16 03:54:54 -08:00
2022-12-21 09:41:28 -08:00
2022-12-20 03:13:45 +01:00
2023-03-10 09:29:07 +01:00
2022-12-12 09:01:36 -08:00
2022-12-09 17:39:33 +00:00
2022-12-09 10:42:56 +00:00
2023-03-10 09:29:48 +01:00
2022-12-13 19:29:45 -08:00
2022-12-02 11:33:48 -08:00
2022-12-13 09:47:48 -08:00
2022-12-08 09:18:58 -07:00
2022-12-16 03:31:56 -08:00
2022-12-15 10:37:27 -08:00
2023-02-09 15:56:51 -08:00
2022-12-09 19:47:41 -08:00
2022-12-12 09:13:06 -08:00
2023-01-31 20:37:18 +01:00
2023-01-30 07:21:25 +00:00
2023-01-31 16:44:07 -08:00
2022-12-09 19:31:11 -08:00
2023-01-13 17:15:17 +01:00
2023-02-12 10:23:39 -05:00
2022-12-10 13:36:05 -05:00
2023-03-10 09:28:52 +01:00
2023-03-10 09:29:12 +01:00
2022-12-13 10:43:59 -08:00
2023-01-17 17:39:13 +01:00
2023-01-24 21:32:55 -08:00
2022-12-15 13:12:15 -08:00
2022-12-12 09:29:56 +00:00
2022-12-13 10:08:36 -08:00