* [PATCH] spi: pci1xxxx: propagate controller resume failures
@ 2026-11-29 12:33 Jiawen Liu
0 siblings, 0 replies; only message in thread
From: Jiawen Liu @ 2026-11-29 12:33 UTC (permalink / raw)
To: Mark Brown; +Cc: linux-spi, linux-kernel
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@qq.com>
---
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-11-29 14:16 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-29 12:33 [PATCH] spi: pci1xxxx: propagate controller resume failures Jiawen Liu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®