mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [RFC PATCH] soundwire: amd: report clock-stop exit failures
@ 2026-06-23 14:03 Pengpeng Hou
  2026-06-23 14:35 ` Mukunda,Vijendar
  0 siblings, 1 reply; 2+ messages in thread
From: Pengpeng Hou @ 2026-06-23 14:03 UTC (permalink / raw)
  To: Vinod Koul, Bard Liao, Pierre-Louis Bossart, Vijendar Mukunda,
	Mastan Katragadda
  Cc: Pengpeng Hou, linux-sound, linux-kernel

amd_sdw_clock_stop_exit() requests SoundWire clock-stop exit and waits
for AMD_SDW_CLK_RESUME_DONE, but timeout handling only leaves
clk_stopped set and returns 0. It also logs sdw_bus_exit_clk_stop()
failures without propagating them.

Return the hardware wait error and the bus clock-stop-exit error so
runtime resume does not report success while the manager remains in
clock-stop state.

This is sent as RFC because clock-stop exit is part of AMD SoundWire
runtime/system PM recovery and the expected timeout policy needs
maintainer confirmation before changing the resume return value.

Fixes: 81ff58ff71ad ("soundwire: amd: add runtime pm ops for AMD SoundWire manager driver")
Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
---
 drivers/soundwire/amd_manager.c | 24 +++++++++++++-----------
 1 file changed, 13 insertions(+), 11 deletions(-)

diff --git a/drivers/soundwire/amd_manager.c b/drivers/soundwire/amd_manager.c
index a3316efdf..7d82fad0d 100644
--- a/drivers/soundwire/amd_manager.c
+++ b/drivers/soundwire/amd_manager.c
@@ -1206,18 +1206,20 @@ static int amd_sdw_clock_stop_exit(struct amd_sdw_manager *amd_manager)
 		ret = readl_poll_timeout(amd_manager->mmio + ACP_SW_CLK_RESUME_CTRL, val,
 					 (val & AMD_SDW_CLK_RESUME_DONE), ACP_DELAY_US,
 					 AMD_SDW_TIMEOUT);
-		if (val & AMD_SDW_CLK_RESUME_DONE) {
-			writel(0, amd_manager->mmio + ACP_SW_CLK_RESUME_CTRL);
-			ret = sdw_bus_exit_clk_stop(&amd_manager->bus);
-			if (ret < 0)
-				dev_err(amd_manager->dev, "bus failed to exit clock stop %d\n",
-					ret);
-			amd_manager->clk_stopped = false;
+		if (ret) {
+			dev_err(amd_manager->dev, "SDW%x clock stop exit failed\n",
+				amd_manager->instance);
+			return ret;
 		}
-	}
-	if (amd_manager->clk_stopped) {
-		dev_err(amd_manager->dev, "SDW%x clock stop exit failed\n", amd_manager->instance);
-		return 0;
+
+		writel(0, amd_manager->mmio + ACP_SW_CLK_RESUME_CTRL);
+		ret = sdw_bus_exit_clk_stop(&amd_manager->bus);
+		if (ret < 0) {
+			dev_err(amd_manager->dev, "bus failed to exit clock stop %d\n",
+				ret);
+			return ret;
+		}
+		amd_manager->clk_stopped = false;
 	}
 	dev_dbg(amd_manager->dev, "SDW%x clock stop exit successful\n", amd_manager->instance);
 	return 0;
-- 
2.50.1 (Apple Git-155)


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-06-23 14:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-23 14:03 [RFC PATCH] soundwire: amd: report clock-stop exit failures Pengpeng Hou
2026-06-23 14:35 ` Mukunda,Vijendar

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®