From: Jiawen Liu <1298662399@qq.com>
To: Yinbo Zhu <zhuyinbo@loongson.cn>, Mark Brown <broonie@kernel.org>
Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 2/2] spi: loongson: handle suspend failures before saving registers
Date: Sun, 29 Nov 2026 16:38:07 +0400 [thread overview]
Message-ID: <tencent_AA4757DB890E10E977AE52B19EA0C80D9205@qq.com> (raw)
In-Reply-To: <a98d03272ed5f075ecf0.1.20261129141643073183@1298662399.qq.com>
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
next parent reply other threads:[~2026-11-29 14:18 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <a98d03272ed5f075ecf0.1.20261129141643073183@1298662399.qq.com>
2026-11-29 12:38 ` Jiawen Liu [this message]
2026-12-01 13:36 ` Markus Elfring
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=tencent_AA4757DB890E10E977AE52B19EA0C80D9205@qq.com \
--to=1298662399@qq.com \
--cc=broonie@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=zhuyinbo@loongson.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®