linux-stable/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>
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
crypto
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
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
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
net net/sched: transition act_pedit to rcu and percpu stats 2023-03-11 13:50:33 +01:00
pcmcia
ras
rdma
rv
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
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
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