* [PATCH 2/2] spi: loongson: handle suspend failures before saving registers
[not found] <a98d03272ed5f075ecf0.1.20261129141643073183@1298662399.qq.com>
@ 2026-11-29 12:38 ` Jiawen Liu
2026-12-01 13:36 ` Markus Elfring
0 siblings, 1 reply; 2+ messages in thread
From: Jiawen Liu @ 2026-11-29 12:38 UTC (permalink / raw)
To: Yinbo Zhu, Mark Brown; +Cc: linux-spi, linux-kernel
loongson_spi_suspend() ignores a failure to stop the controller queue,
saves registers, and reports successful suspend. Queued I/O can still be
active, and saving PARA can overwrite the value needed by the in-flight
message cleanup.
Propagate a queue-stop failure before reading any registers. The SPI core
now leaves the controller usable when that attempt fails.
Fixes: 6c7a864007b6 ("spi: loongson: add bus driver for the loongson spi controller")
Signed-off-by: Jiawen Liu <1298662399@qq.com>
---
drivers/spi/spi-loongson-core.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/spi/spi-loongson-core.c b/drivers/spi/spi-loongson-core.c
index 6ba7c56b1bdda..d6f644a00a9bf 100644
--- a/drivers/spi/spi-loongson-core.c
+++ b/drivers/spi/spi-loongson-core.c
@@ -233,9 +233,12 @@ static int loongson_spi_suspend(struct device *dev)
{
struct loongson_spi *loongson_spi;
struct spi_controller *controller;
+ int ret;
controller = dev_get_drvdata(dev);
- spi_controller_suspend(controller);
+ ret = spi_controller_suspend(controller);
+ if (ret)
+ return ret;
loongson_spi = spi_controller_get_devdata(controller);
--
2.34.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH 2/2] spi: loongson: handle suspend failures before saving registers
2026-11-29 12:38 ` [PATCH 2/2] spi: loongson: handle suspend failures before saving registers Jiawen Liu
@ 2026-12-01 13:36 ` Markus Elfring
0 siblings, 0 replies; 2+ messages in thread
From: Markus Elfring @ 2026-12-01 13:36 UTC (permalink / raw)
To: Jiawen Liu, linux-spi, Mark Brown, Yinbo Zhu; +Cc: LKML
> loongson_spi_suspend() ignores a failure to stop the controller queue,
…
I suggest to refine the summary phrase for the final commit.
Regards,
Markus
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-12-01 13:36 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <a98d03272ed5f075ecf0.1.20261129141643073183@1298662399.qq.com>
2026-11-29 12:38 ` [PATCH 2/2] spi: loongson: handle suspend failures before saving registers Jiawen Liu
2026-12-01 13:36 ` Markus Elfring
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®