[SteamOS 3.9.5 / cecd] S3 suspend/resume race conditions: immediate re-suspend on wake, user.slice freeze before TV standby TX, and HDMI 2.1 link training failure against cold TV

未关闭
#2,997 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
25/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
linux

调研方向

Start by tracing cecd's PrepareForSleep handling and CEC transmit completion, then inspect the suspend and resume logs in the issue. The report also points to amdgpu_dm_handle_vrr_transition, connector hotplug handling, and DRM link retraining. Done means validating the proposed grace period, sleep delay inhibitor, and post-wake retraining across all three reported failures.

由索引模型根据 Issue 内容生成。

描述

System Information
  • SteamOS Version: 3.9.5 (20261023.100)
  • Kernel: 7.2.7-valve2-2-neptune-72-g31504582a073
  • Dock: Official Steam Deck Docking Station (4.0.0.0, DP-1)
  • Display: Samsung Q90A Neo QLED (0.0.0.0, HDMI 4, 2560x1440 @ 120Hz VRR HDR)
  • Audio: Samsung HW-S800B eARC Soundbar (3.0.0.0, HDMI 3)

Summary

Following up on #2968 (which fixed cecd deactivating when an eARC soundbar is present on the bus), we've hit three interrelated suspend/resume race conditions in cecd and amdgpu/Dock link training during S3 sleep/wake transitions:


1. False-Standby Bounce Loop on Resume (allow_standby = true)

When waking the Steam Deck from S3 sleep (e.g. via wireless controller while the TV is in standby), cecd thaws with user.slice and immediately processes either a buffered STANDBY (0x36) frame or a transitional standby state from the TV before the TV has finished waking up. Within ~1 second of PM: suspend exit, cecd requests systemd-logind to suspend the Steam Deck right back to sleep:

Oct 27 16:52:15 steamdeck kernel: PM: suspend exit
Oct 27 16:52:15 steamdeck cecd[1898]: INFO cecd::device: TV did not respond to wake immediately
Oct 27 16:52:15 steamdeck systemd-sleep[107509]: Successfully thawed unit 'user.slice'.
Oct 27 16:52:15 steamdeck systemd-logind[1138]: Operation 'suspend' finished.
Oct 27 16:52:16 steamdeck systemd-logind[1138]: suspend requested from client PID 1898 ('cecd') (unit [email protected])...
Oct 27 16:52:16 steamdeck systemd-logind[1138]: The system will suspend now!

Suggested Fix (Zero downside for working TVs):
Add a short post-resume grace window (e.g. 5–10 seconds after PrepareForSleep(false) / waking) during which incoming CEC STANDBY broadcasts from the TV are ignored by cecd.


2. user.slice Freeze Race Before STANDBY TX Completes (suspend_tv = true)

When putting the Steam Deck to sleep, cecd runs inside [email protected] (user.slice). Because CEC bus transmission + retries take ~200–600ms (especially if bus arbitration is busy), systemd-sleep frequently freezes user.slice or tears down the display topology before cecd's STANDBY transmission completes, leaving the TV turned on.

Suggested Fix (Zero downside for working TVs):
Hold the systemd-logind sleep delay inhibitor lock in cecd until the kernel CEC_TX_STATUS callback confirms the STANDBY message has finished transmitting (or timed out) before releasing the lock.


3. Cold-Boot HDMI 2.1 Link Training Failure ("Mode Not Supported" at 1440p@120Hz HDR)

When resuming from S3 sleep while connected to a TV in cold standby:

  1. At T+0.0s, kernel dm_resume immediately attempts DisplayPort/HDMI 2.1 link training (2560x1440 @ 120Hz HDR) via the Official Dock before the TV's high-bandwidth HDMI 2.1 receiver (Samsung Input Signal Plus) has booted:
    Oct 27 16:52:15 steamdeck kernel: WARNING: drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:10439 at amdgpu_dm_handle_vrr_transition+0x1d5/0x1e0 [amdgpu]
    Oct 27 16:52:18 steamdeck kernel: amdgpu 0000:04:00.0: [drm] *ERROR* dpcd_set_link_settings:1123: core_link_write_dpcd (DP_DOWNSPREAD_CTRL) failed
    Oct 27 16:52:18 steamdeck kernel: amdgpu 0000:04:00.0: [drm] *ERROR* dpcd_set_link_settings:1128: core_link_write_dpcd (DP_LANE_COUNT_SET) failed
    
  2. cecd wakes the TV (IMAGE_VIEW_ON), and ~2.5s later the TV's HDMI 2.1 receiver finishes booting and switches to the Deck's input (ACTIVE_SOURCE).
  3. However, because the TV keeps +5V/HPD asserted during standby and the Dock's DP-to-HDMI bridge does not fire a new HPD interrupt once the TV's scaler finishes booting, amdgpu never re-trains the failed link—resulting in a permanent "Mode Not Supported" error on the TV until the cable is replugged or hotplug is forced.

Workaround / Suggested Fix:
If the TV was in standby (pwr-state != on) prior to wake, triggering a DRM connector hotplug/re-train (trigger_hotplug / KMS link re-verification) ~1.5s after the TV finishes waking and accepts ACTIVE_SOURCE cleanly re-trains the 2-lane HBR3 link and resolves the "Mode Not Supported" error 100% of the time without affecting TVs that were already powered on.

主要语言
没有语言数据
星标
2.7k
派生
89
PR 合并指标
30 天内没有已合并 PR

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

ValveSoftware/SteamOS 的其他 Issue

查看 ValveSoftware/SteamOS 的全部 Issue

相似的 Issue

更多 Backend & API Design Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。