summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorHaibo Chen <haibo.chen@nxp.com>2021-06-10 17:24:33 +0800
committerSasha Levin <sashal@kernel.org>2021-06-30 08:46:54 -0400
commit0869bd265b8a5c2f04bacc8c3dbe9f5410cec4c9 (patch)
tree3269cc7d1e1dc34f142a00d77e1e5d610c6997dd /drivers
parent82fde4cde569f203f8f75afae06fd390c7d1ef0f (diff)
downloadlinux-0869bd265b8a5c2f04bacc8c3dbe9f5410cec4c9.tar.gz
linux-0869bd265b8a5c2f04bacc8c3dbe9f5410cec4c9.tar.bz2
linux-0869bd265b8a5c2f04bacc8c3dbe9f5410cec4c9.zip
spi: spi-nxp-fspi: move the register operation after the clock enable
[ Upstream commit f422316c8e9d3c4aff3c56549dfb44a677d02f14 ] Move the register operation after the clock enable, otherwise system will stuck when this driver probe. Fixes: 71d80563b076 ("spi: spi-nxp-fspi: fix fspi panic by unexpected interrupts") Signed-off-by: Haibo Chen <haibo.chen@nxp.com> Link: https://lore.kernel.org/r/1623317073-25158-1-git-send-email-haibo.chen@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/spi/spi-nxp-fspi.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/spi/spi-nxp-fspi.c b/drivers/spi/spi-nxp-fspi.c
index ab9035662717..bcc0b5a3a459 100644
--- a/drivers/spi/spi-nxp-fspi.c
+++ b/drivers/spi/spi-nxp-fspi.c
@@ -1033,12 +1033,6 @@ static int nxp_fspi_probe(struct platform_device *pdev)
goto err_put_ctrl;
}
- /* Clear potential interrupts */
- reg = fspi_readl(f, f->iobase + FSPI_INTR);
- if (reg)
- fspi_writel(f, reg, f->iobase + FSPI_INTR);
-
-
/* find the resources - controller memory mapped space */
if (is_acpi_node(f->dev->fwnode))
res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
@@ -1076,6 +1070,11 @@ static int nxp_fspi_probe(struct platform_device *pdev)
}
}
+ /* Clear potential interrupts */
+ reg = fspi_readl(f, f->iobase + FSPI_INTR);
+ if (reg)
+ fspi_writel(f, reg, f->iobase + FSPI_INTR);
+
/* find the irq */
ret = platform_get_irq(pdev, 0);
if (ret < 0)