vc4: HVS FIFO frame counter stalls after DPMS cycles, stale DLIST entries never freed, display goes white

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

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
32/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
c, linux

调研方向

Start with vc4_hvs_alloc_dlist_entry() and vc4_hvs_mark_dlist_entry_stale() in the vc4 HVS driver, then inspect the HVS frame-counter and channel-reset paths. Reproduce or instrument the stalled FRCNT/DISPSTAT state, including DPMS wake cycles and debugfs output. Done means the root cause of the counter stall is identified or a safe stale-entry recovery and channel-restart mechanism is implemented with regression coverage.

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

描述

Summary

On CM4 Rev 1.1 (BCM2711) with a DSI panel behind an ICN6211 bridge, the HVS FIFO frame counter (FRCNT in SCALER_DISPSTATx) stops advancing after some uptime. Stale DLIST entries are never freed by the normal path (which waits for FRCNT to advance past the target frame), the 4064-word DLIST fills up, and the display goes permanently white with vertical colored bars. Only a full reboot recovers.

The fallback flush in vc4_hvs_alloc_dlist_entry() does fire (the "Failed to allocate DLIST entry" error is logged before the retry), but since the HVS channel is no longer producing frames, the display shows nothing useful.

Hardware / Software

  • SoC: BCM2711 (Compute Module 4 Rev 1.1)
  • Display: DSI → ICN6211 (DSI-to-DPI bridge, i2c-1 @0x2c) → 480×854 panel (custom panel-maxen driver)
  • Kernel: 6.6.78-v8 (rpi-6.6.y, built Mar 2025)
  • Compositor: weston (DRM backend, single DSI-1 output)
  • Display power management: weston DPMS cycle — idle timeout triggers panel disable (GPIO sequence: en5, env, reset, vdd off), wake triggers full re-init (vdd, reset, en5, env, ICN6211 register programming via i2c, DSI clock recalc, panel enable + 200ms settle)

Observations

Incident 1 — Lab device, October 2026
  • Uptime at first DLIST error: 1,195,716s (~13.8 days)
  • 22 DLIST errors total, recurring every ~26s when the screen is on
  • DISPCTRL frozen at 0xaa00008e
  • hvs_dlist_allocs debugfs showed stale entries with frame counter stuck (values 52, 54, 55)
  • hvs_underrun = 0
  • 9 clean DPMS cycles before the fault, 8 cycles with DLIST errors after
  • Reboot fixed it; screen worked immediately
Incident 2 — Production device, November 2026
  • Same hardware (CM4 Rev 1.1), same kernel (6.6.78-v8)
  • Uptime at first DLIST error: 14,511s (~4 hours) — dramatically faster onset
  • 27 DLIST errors in the journal
  • DISPCTRL frozen at 0xaa00008e (identical to incident 1)
  • 33 clean DPMS on/off cycles before the fault (uptime 0–14300s), errors on every cycle after
  • First error occurred during a wake triggered by an incoming call with video
  • Overnight gap (screen off for ~15 hours): no DLIST errors
  • Morning: errors resume on the very first wake
  • The DSI/ICN6211/panel re-init sequence is byte-for-byte identical before and after the fault: same DSI clock (28892→29411), same ICN6211 registers, same MIPI PHY clock (176,472,000 Hz), same panel GPIO sequence. The fault is not in the panel path.
  • Previous boot ended abnormally (FAT-fs "not properly unmounted" on 3 partitions, EXT4 recovery on /data) — likely a forced power cycle to recover from the same display issue
Pattern
Incident 1 Incident 2
Onset 13.8 days 4 hours
DISPCTRL aa00008e aa00008e
Error interval ~26s ~21s
Clean cycles before 9 33
Underrun 0 not captured (no debugfs dump)
Fix reboot reboot

The ~21–26s error interval matches the time to fill 4064 words at 9 words/frame at the compositor's frame rate — confirming that stale entries are never freed by the frame-counter path.

Analysis

What's broken

The DLIST deallocation path in vc4_hvs_alloc_dlist_entry() / vc4_hvs_mark_dlist_entry_stale() relies on vc4_hvs_get_fifo_frame_count() returning an advancing value. When the frame counter stalls, entries marked stale at frame N are never freed because vc4_hvs_frcnt_lte(target, current) never becomes true.

The driver already has a comment acknowledging this:

/*
 * Eventually the frame count will wrap around, and
 * vc4_hvs_frcnt_lte(target, current) will start
 * returning true. However we've seen this fail for
 * reasons currently unknown.
 */
What's NOT broken
  • The DSI link, ICN6211 bridge, and panel are fully re-initialized on every DPMS wake. The init sequence is identical before and after the fault. The problem is upstream of the panel path, in the HVS.
  • __vc4_hvs_stop_channel() resets DISPCTRLX (writes RESET then 0) but does NOT touch DISPSTAT where FRCNT lives. Since FRCNT is documented as free-running, this shouldn't matter — but something makes it stop.
  • All known fixes from #5674 (PRs #5684, #5733, #5935) are present in our kernel. Those fix a different bug: a R-M-W race on SCALER_DISPCTRL between underrun and EOF IRQ handlers that could lose an EOF interrupt. Our bug is that the frame counter itself stops advancing.
What we don't know
  • Why the frame counter stops. Is the HVS channel itself stuck (not compositing), or is the counter frozen while compositing continues?
  • Whether SCALER_DISPSTATx shows a stuck line counter as well, or only a stuck frame counter. In incident 1, the debugfs snapshot was taken with the screen off. In incident 2, no debugfs dump was available.
  • Whether explicitly stopping and restarting the HVS channel (without a full reboot) would recover.

Related issues

  • #5674 — DLIST stale entry bug (R-M-W race), fixed by #5935. Different root cause.
  • #7757 — Recent discussion where @6by9 confirms FRCNT is free-running and "there are no statements over when it gets reset"

What would help

  1. A way to force-free stale DLIST entries when FRCNT hasn't advanced after N attempts (a watchdog in vc4_hvs_alloc_dlist_entry or a periodic check)
  2. Better understanding of what makes FRCNT stop — is there a hardware errata, or a software state that can disable it?
  3. Optionally, a debugfs knob to force-reset the HVS channel (stop + restart compositing) as a recovery mechanism short of rebooting

Steps to reproduce

We cannot reproduce on demand. The fault occurs after variable uptime (4 hours to 13.8 days) on CM4 Rev 1.1 with DSI output and frequent DPMS on/off cycles (weston idle timeout). We have seen it on 3 devices so far (2 production, 1 lab).

Kernel config

Standard rpi-6.6.y defconfig for bcm2711 (aarch64), vc4-kms-dsi-maxen-chipone-icn6211-4lane overlay. Single display on DSI-1, no HDMI connected.

主要语言
C
星标
13.4k
派生
5.5k
平均合并
1 天 8 小时
30 天内合并 PR
37

环境准备

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

从这里开始

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

raspberrypi/linux 的其他 Issue

查看 raspberrypi/linux 的全部 Issue

相似的 Issue

更多 C Issue

把新 issue 发到你的邮箱

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