]> git.baikalelectronics.ru Git - kernel.git/commit
ptdma: pt_core_execute_cmd() should use spinlock
authorEric Pilmore <epilmore@gigaio.com>
Thu, 19 Jan 2023 03:39:08 +0000 (19:39 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 1 Feb 2023 07:34:25 +0000 (08:34 +0100)
commitf379576a40f401314835941fa727a9a373895473
tree5faa351bca7e316efe4239e7960cb4571a74b004
parente93762eb35c60b0106e17189e1f8b3dfa67c66e4
ptdma: pt_core_execute_cmd() should use spinlock

[ Upstream commit 64dcf6b9e158ed653b8af805a06c41646270e821 ]

The interrupt handler (pt_core_irq_handler()) of the ptdma
driver can be called from interrupt context. The code flow
in this function can lead down to pt_core_execute_cmd() which
will attempt to grab a mutex, which is not appropriate in
interrupt context and ultimately leads to a kernel panic.
The fix here changes this mutex to a spinlock, which has
been verified to resolve the issue.

Fixes: 754ddfe37916 ("dmaengine: ptdma: Initial driver for the AMD PTDMA")
Signed-off-by: Eric Pilmore <epilmore@gigaio.com>
Link: https://lore.kernel.org/r/20230119033907.35071-1-epilmore@gigaio.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/dma/ptdma/ptdma-dev.c
drivers/dma/ptdma/ptdma.h