[PATCH 1/2] spi: qcom-geni: Add shutdown callback to quiesce hardware on reboot

From: Praveen Talari

Date: Wed Aug 05 2026 - 06:43:29 EST


During system reboot, an active SPI transfer can leave the GENI Serial
Engine in an indeterminate state. On VM-based platforms, if a DMA
transfer is in progress when the VM is shut down, the SMMU can raise
context faults as the DMA engine continues to access IOVAs that have
already been invalidated during VM teardown.

Add a shutdown callback to suspend the SPI controller and abort any
in-progress transfer, ensuring the DMA engine is idle and all IOVA
mappings are retired before the system resets.

Signed-off-by: Praveen Talari <praveen.talari@xxxxxxxxxxxxxxxx>
---
drivers/spi/spi-geni-qcom.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/spi/spi-geni-qcom.c b/drivers/spi/spi-geni-qcom.c
index 6566975eb24f..39d67f19244c 100644
--- a/drivers/spi/spi-geni-qcom.c
+++ b/drivers/spi/spi-geni-qcom.c
@@ -1066,6 +1066,13 @@ static int spi_geni_target_abort(struct spi_controller *spi)
return 0;
}

+static void spi_geni_shutdown(struct platform_device *pdev)
+{
+ struct spi_controller *spi = platform_get_drvdata(pdev);
+
+ spi_controller_suspend(spi);
+}
+
static int spi_geni_probe(struct platform_device *pdev)
{
int ret, irq;
@@ -1242,7 +1249,8 @@ static const struct of_device_id spi_geni_dt_match[] = {
MODULE_DEVICE_TABLE(of, spi_geni_dt_match);

static struct platform_driver spi_geni_driver = {
- .probe = spi_geni_probe,
+ .probe = spi_geni_probe,
+ .shutdown = spi_geni_shutdown,
.driver = {
.name = "geni_spi",
.pm = &spi_geni_pm_ops,

--
2.34.1