summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClark Wang <xiaoning.wang@nxp.com>2023-05-05 14:35:57 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-06-28 10:28:15 +0200
commit9138ed7e2b439b9f8f393194861e5b7967b50716 (patch)
tree7e94cb328b5085ac48a45092bc93c7eaa16c4f26
parent97b6c4c1d1a8483818e5fd46112409cead4ac0f7 (diff)
downloadlinux-9138ed7e2b439b9f8f393194861e5b7967b50716.tar.gz
linux-9138ed7e2b439b9f8f393194861e5b7967b50716.tar.bz2
linux-9138ed7e2b439b9f8f393194861e5b7967b50716.zip
spi: lpspi: disable lpspi module irq in DMA mode
[ Upstream commit 9728fb3ce11729aa8c276825ddf504edeb00611d ] When all bits of IER are set to 0, we still can observe the lpspi irq events when using DMA mode to transfer data. So disable irq to avoid the too much irq events. Signed-off-by: Clark Wang <xiaoning.wang@nxp.com> Link: https://lore.kernel.org/r/20230505063557.3962220-1-xiaoning.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--drivers/spi/spi-fsl-lpspi.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/spi/spi-fsl-lpspi.c b/drivers/spi/spi-fsl-lpspi.c
index 5d98611dd999..c5ff6e8c45be 100644
--- a/drivers/spi/spi-fsl-lpspi.c
+++ b/drivers/spi/spi-fsl-lpspi.c
@@ -906,9 +906,14 @@ static int fsl_lpspi_probe(struct platform_device *pdev)
ret = fsl_lpspi_dma_init(&pdev->dev, fsl_lpspi, controller);
if (ret == -EPROBE_DEFER)
goto out_pm_get;
-
if (ret < 0)
dev_err(&pdev->dev, "dma setup error %d, use pio\n", ret);
+ else
+ /*
+ * disable LPSPI module IRQ when enable DMA mode successfully,
+ * to prevent the unexpected LPSPI module IRQ events.
+ */
+ disable_irq(irq);
ret = devm_spi_register_controller(&pdev->dev, controller);
if (ret < 0) {