[PATCH] spi: pci1xxxx: propagate controller resume failures
From: Jiawen Liu
Date: Sun Nov 29 2026 - 09:16:52 EST
pci1xxxx_spi_resume() ignores the result of spi_controller_resume() and
always reports success. If a previous suspend timed out waiting for the
SPI queue to drain, the next queue restart returns -EBUSY, but device
resume completes without recording the failure.
Keep the first controller error while restoring every hardware instance,
then return it after all instances have been processed.
Fixes: 7ba63521a1e9 ("spi: microchip: pci1xxxx: Add suspend and resume support for PCI1XXXX SPI driver")
Signed-off-by: Jiawen Liu <1298662399@xxxxxx>
---
drivers/spi/spi-pci1xxxx.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/spi/spi-pci1xxxx.c b/drivers/spi/spi-pci1xxxx.c
index e00b59ed823ab..e6e71358d9235 100644
--- a/drivers/spi/spi-pci1xxxx.c
+++ b/drivers/spi/spi-pci1xxxx.c
@@ -1041,11 +1041,14 @@ static int pci1xxxx_spi_resume(struct device *dev)
struct pci1xxxx_spi *spi_ptr = dev_get_drvdata(dev);
struct pci1xxxx_spi_internal *spi_sub_ptr;
u32 regval = SPI_RESUME_CONFIG;
+ int ret = 0, err;
u8 iter;
for (iter = 0; iter < spi_ptr->total_hw_instances; iter++) {
spi_sub_ptr = spi_ptr->spi_int[iter];
- spi_controller_resume(spi_sub_ptr->spi_host);
+ err = spi_controller_resume(spi_sub_ptr->spi_host);
+ if (err && !ret)
+ ret = err;
writel(regval, spi_ptr->reg_base +
SPI_MST_EVENT_MASK_REG_OFFSET(iter));
@@ -1053,7 +1056,7 @@ static int pci1xxxx_spi_resume(struct device *dev)
store_restore_config(spi_ptr, spi_sub_ptr, iter, 0);
}
- return 0;
+ return ret;
}
static int pci1xxxx_spi_suspend(struct device *dev)
--
2.34.1