[PATCH 2/5] spi: spi-zynqmp-gqspi: Mask the interrupt before gating clocks on remove

From: Srikanth Boyapally

Date: Sun Nov 15 2026 - 11:58:03 EST


From: Mohammad Zeeshan <zeeshan.mohammad2@xxxxxxx>

zynqmp_qspi_remove() clears GQSPI_EN, then gates both clocks, while the
IRQ is only released by devres after remove() returns. An interrupt
raised in that window enters the handler and reads registers with pclk
gated.

Mask at the interrupt controller instead of relying on the device-level
write to have already silenced the source: disable_irq() closes this
regardless of what GQSPI_EN or any other register says once it returns,
whereas the write below cannot recall a handler the GIC already
dispatched.

Fixes: dfe11a11d523 ("spi: Add support for Zynq Ultrascale+ MPSoC GQSPI controller")
Signed-off-by: Mohammad Zeeshan <zeeshan.mohammad2@xxxxxxx>
Signed-off-by: Srikanth Boyapally <srikanth.boyapally@xxxxxxx>
---
drivers/spi/spi-zynqmp-gqspi.c | 7 +++++++
1 file changed, 7 insertions(+)

diff --git a/drivers/spi/spi-zynqmp-gqspi.c b/drivers/spi/spi-zynqmp-gqspi.c
index 0da44ebaf39c..cf22ae8d2163 100644
--- a/drivers/spi/spi-zynqmp-gqspi.c
+++ b/drivers/spi/spi-zynqmp-gqspi.c
@@ -1377,6 +1377,13 @@ static void zynqmp_qspi_remove(struct platform_device *pdev)

spi_unregister_controller(xqspi->ctlr);

+ /*
+ * Mask at the interrupt controller, same reasoning as
+ * zynqmp_qspi_shutdown(): the write below cannot recall a handler
+ * the GIC already dispatched.
+ */
+ disable_irq(xqspi->irq);
+
zynqmp_gqspi_write(xqspi, GQSPI_EN_OFST, 0x0);

pm_runtime_disable(&pdev->dev);

--
2.43.0