linux/include
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>
History 2023-03-17 08:57:49 +01:00
..
acpi PCI/ACPI: Account for _S0W of the target bridge in acpi_pci_bridge_d3() 2023-03-11 13:50:38 +01:00
asm-generic arch: fix broken BuildID for arm64 and riscv 2022-12-30 17:21:51 +09:00
clocksource Updates for timers, timekeeping and drivers: 2022-12-12 12:52:02 -08:00
crypto crypto: acomp - define max size for destination 2022-12-09 18:45:00 +08:00
drm drm/display/dp_mst: Handle old/new payload states in drm_dp_remove_payload() 2023-03-11 13:50:49 +01:00
dt-bindings remoteproc updates for v6.2 2022-12-21 09:37:14 -08:00
keys certs: Move load_certificate_list() to be with the asymmetric keys code 2022-06-21 16:05:06 +01:00
kunit kunit: fix kunit_test_init_section_suites(...) 2023-01-31 09:10:38 -07:00
kvm KVM: arm64: Add helper vgic_write_guest_lock() 2023-01-29 18:46:11 +00:00
linux bus: mhi: ep: Change state_lock to mutex 2023-03-17 08:57:49 +01:00
math-emu powerpc/math-emu: Remove -w build flag and fix warnings 2022-09-05 17:28:25 +10:00
media media: uvcvideo: Add GUID for BGRA/X 8:8:8:8 2023-03-11 13:50:41 +01:00
memory memory: renesas-rpc-if: Split-off private data from struct rpcif 2023-03-11 13:50:21 +01:00
misc cxl: fix typo in comment 2022-11-24 23:12:19 +11:00
net net/sched: transition act_pedit to rcu and percpu stats 2023-03-11 13:50:33 +01:00
pcmcia ARM: pxa/sa1100: move I/O space to PCI_IOBASE 2022-05-07 22:56:17 +02:00
ras mm, hwpoison: enable memory error handling on 1GB hugepage 2022-08-08 18:06:44 -07:00
rdma RDMA: Extend RDMA kernel verbs ABI to support flush 2022-12-09 19:36:01 -04:00
rv Documentation/rv: Add deterministic automata monitor synthesis documentation 2022-07-30 14:01:29 -04:00
scsi scsi: iscsi_tcp: Fix UAF during logout when accessing the shost ipaddress 2023-01-18 19:14:56 -05:00
soc firmware: raspberrypi: Fix type assignment 2023-01-10 13:44:04 -08:00
sound ASoC: soc-dapm.h: fixup warning struct snd_pcm_substream not declared 2023-03-10 09:28:40 +01:00
target scsi: target: core: Send max transfer length in blocks 2022-11-24 02:16:19 +00:00
trace f2fs: introduce trace_f2fs_replace_atomic_write_block 2023-03-11 13:50:22 +01:00
uapi usb: uvc: Enumerate valid values for color matching 2023-03-11 13:50:44 +01:00
ufs scsi: ufs: exynos: Fix DMA alignment for PAGE_SIZE != 4096 2023-03-10 09:28:31 +01:00
vdso time64.h: Consolidated PSEC_PER_SEC definition 2021-04-06 16:32:17 -07:00
video fbdev: omapfb: connector-analog-tv: remove support for platform data 2022-12-14 20:01:49 +01:00
xen xen: make remove callback of xen driver void returned 2022-12-15 16:06:10 +01:00