]> git.baikalelectronics.ru Git - kernel.git/commit
remoteproc: stm32_rproc: Add mutex protection for workqueue
authorArnaud Pouliquen <arnaud.pouliquen@foss.st.com>
Fri, 31 Mar 2023 16:06:34 +0000 (18:06 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 24 May 2023 16:32:35 +0000 (17:32 +0100)
commit5d6a166676c1dad40eb576da625909f311311b25
treee991da4853d986f454f54588de5a5e4fe490513c
parent98db4f2a1e36f8ce23ab5d6dbbc5c07d2531b8cb
remoteproc: stm32_rproc: Add mutex protection for workqueue

[ Upstream commit 35bdafda40cc343ad2ba2cce105eba03a70241cc ]

The workqueue may execute late even after remoteproc is stopped or
stopping, some resources (rpmsg device and endpoint) have been
released in rproc_stop_subdevices(), then rproc_vq_interrupt()
accessing these resources will cause kernel dump.

Call trace:
virtqueue_add_inbuf
virtqueue_add_inbuf
rpmsg_recv_single
rpmsg_recv_done
vring_interrupt
stm32_rproc_mb_vq_work
process_one_work
worker_thread
kthread

Suggested-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
Link: https://lore.kernel.org/r/20230331160634.3113031-1-arnaud.pouliquen@foss.st.com
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/remoteproc/stm32_rproc.c