Linux USB
 help / color / mirror / Atom feed
* [RFC PATCH] thunderbolt: icm: report switch runtime resume timeout
@ 2026-06-23  6:18 Pengpeng Hou
  2026-06-23 12:36 ` Mika Westerberg
  0 siblings, 1 reply; 2+ messages in thread
From: Pengpeng Hou @ 2026-06-23  6:18 UTC (permalink / raw)
  To: Andreas Noever, Mika Westerberg, Yehezkel Bernat, linux-usb,
	linux-kernel
  Cc: Pengpeng Hou

icm_runtime_resume_switch() waits for firmware to signal switch runtime-
resume completion. If the wait expires, it only prints a debug message
and still returns success to the runtime PM path.

Return -ETIMEDOUT when the completion does not arrive so runtime PM
callers can observe the failed switch resume instead of using the device
as if resume had completed.

Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
---
 drivers/thunderbolt/icm.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/thunderbolt/icm.c b/drivers/thunderbolt/icm.c
index 10fefac3b1d9..46d491627970 100644
--- a/drivers/thunderbolt/icm.c
+++ b/drivers/thunderbolt/icm.c
@@ -2179,6 +2179,7 @@ static int icm_runtime_resume_switch(struct tb_switch *sw)
 		if (!wait_for_completion_timeout(&sw->rpm_complete,
 						 msecs_to_jiffies(500))) {
 			dev_dbg(&sw->dev, "runtime resuming timed out\n");
+			return -ETIMEDOUT;
 		}
 	}
 	return 0;
-- 
2.50.1 (Apple Git-155)


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

end of thread, other threads:[~2026-06-23 12: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  6:18 [RFC PATCH] thunderbolt: icm: report switch runtime resume timeout Pengpeng Hou
2026-06-23 12:36 ` Mika Westerberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox