Skip to content

About

Forensic root-cause analysis & automated remediation for AMD Ryzen 7040/8040 (Phoenix / Hawk Point DCN 3.1.4) DMCUB firmware deadlock & ACPI S5 shutdown hang on Ubuntu 24.04 HWE / Linux Mint 22.x

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

AMD Phoenix / Hawk Point (DCN 3.1.4) DMCUB Firmware Deadlock & ACPI S5 Shutdown Fix

Forensic Root-Cause Analysis & Automated Remediation for Ubuntu 24.04 HWE / Linux Mint 22.x

License: MIT Platform: Ubuntu 24.04 HWE / Mint 22.x Architecture: AMD DCN 3.1.4


1. Executive Summary & Symptoms

Laptops equipped with AMD Ryzen 7040 (Phoenix) and Ryzen 8040 (Hawk Point) APUs utilizing Display CoreNext DCN 3.1.4 (Radeon 740M / 760M / 780M) experience an intermittent incomplete ACPI S5 (Soft Off) shutdown hang on Ubuntu 24.04 LTS HWE and Linux Mint 22.x:

  1. Incomplete Hardware Power-Off (ACPI S5 Hang): During systemctl poweroff, user-space services terminate cleanly, Wi-Fi disconnects, all filesystems unmount read-only (EXT4-fs: re-mounted ro), and the eDP display panel powers off—but the keyboard backlight and power LED remain lit indefinitely, requiring a 4-second hardware power-button override.
  2. Pre-Shutdown amdgpu DMCUB Console Flood: Immediately prior to panel power-off on affected cycles, the kernel console floods with Error queueing DMUB command: status=2 and dc_dmub_srv_log_diagnostic_data: DMCUB error.

Affected Hardware & Software Matrix

Component Affected Specification
APU Families AMD Ryzen 7040 Series (Phoenix) & Ryzen 8040 Series (Hawk Point)
Integrated GPU AMD Radeon 780M / 760M / 740M (PCI ID 1002:1900 rev c1/c2/c3 et al.)
Display Engine AMD Display CoreNext DCN 3.1.4 (dcn_3_1_4_dmcub.bin.zst)
Verified Reference Chassis Lenovo IdeaPad Slim 3 15AHP10 (83KA), AMD Ryzen 7 8840HS
Kernel Package linux-image-generic-hwe-24.04 (7.0.0-38-generic, amdgpu Display Core v3.2.369)
Stale Firmware Package linux-firmware-amd-graphics (20240318.git3b128b60-0ubuntu3.3, DMUB 0x08004800)

2. Forensic Root Cause (HWE Kernel vs. Firmware Version Skew)

Ubuntu's Hardware Enablement (HWE) stack advances the kernel amdgpu Display Core driver to v3.2.369, while leaving linux-firmware-amd-graphics in noble-updates pinned to the March 2024 snapshot (20240318). That package loads legacy DCN 3.1.4 DMUB microcontroller firmware version=0x08004800 (/lib/firmware/amdgpu/dcn_3_1_4_dmcub.bin.zst), missing 17+ subsequent upstream AMD firmware bugfix releases (0x08004800 $\rightarrow$ 0x08006500).

Stage 1: Runtime Hubbub Compression Buffer Timeout (dcn31_program_compbuf_size)

During runtime display power-state transitions (lid close/open, DPMS blanking, or deep-idle stutter entry), dcn20_optimize_bandwidth invokes dcn31_program_compbuf_size (drivers/gpu/drm/amd/display/dc/hubbub/dcn31/dcn31_hubbub.c:151), which polls DCHUBBUB_DET0_CTRL waiting for the DMCUB microcontroller to acknowledge the compression buffer reconfiguration. Under firmware 0x08004800, this register poll times out after 1us * 100 tries:

amdgpu 0000:05:00.0: [drm] REG_WAIT timeout 1us * 100 tries - dcn31_program_compbuf_size line:141
WARNING: drivers/gpu/drm/amd/amdgpu/../display/dc/hubbub/dcn31/dcn31_hubbub.c:151 at dcn31_program_compbuf_size+0xce/0x230 [amdgpu]
Call Trace:
 <TASK>
 dcn20_optimize_bandwidth+0x106/0x290 [amdgpu]
 dc_commit_state_no_check+0xb1e/0xfb0 [amdgpu]
 dc_commit_streams+0x3da/0x7b0 [amdgpu]
 amdgpu_dm_commit_streams+0x658/0x8b0 [amdgpu]
 amdgpu_dm_atomic_commit_tail+0xba/0xde0 [amdgpu]

Stage 2: DMCUB Command Ring Deadlock Blocking ACPI S5

Once the 0x08004800 DMCUB microcontroller deadlocks its inbox ring buffer, the system continues operating in user space until shutdown is requested. During shutdown teardown (drm_mode_rmfb_work_fn and amdgpu_pci_shutdown), every Display Core attempt to flush or power down the eDP pipe fails with DMUB_STATUS_TIMEOUT (status=2):

amdgpu 0000:05:00.0: [drm] *ERROR* Error queueing DMUB command: status=2
amdgpu 0000:05:00.0: [drm] *ERROR* dc_dmub_srv_log_diagnostic_data: DMCUB error - collecting diagnostic data

Because amdgpu PCIe device shutdown blocks waiting on the wedged DMCUB microcontroller after systemd-shutdown has already unmounted all filesystems, the kernel never completes the PCI .shutdown() callback chain to invoke the final hardware ACPI S5 (Soft Off) transition.

Stage 3: Binary Disassembly of amdgpu.ko (dcdebugmask Gate Verification)

Disassembly of amdgpu_dm_init inside amdgpu.ko (7.0.0-38-generic) confirms the exact dc_debug_options bitmask mappings evaluated via amdgpu.dcdebugmask:

  • 0x2 (DC_DISABLE_STUTTER): Sets dc->debug.disable_stutter = true, preventing Hubbub DET/compbuf dynamic resizing during idle stutter entry.
  • 0x800 (DC_DISABLE_IPS): Sets dc->debug.disable_ips = DMUB_IPS_DISABLE_ALL, preventing buggy DCN 3.1.4 Idle Power State handshakes between Display Core and DMCUB.
  • Combined bitmask: 0x802 (2050 decimal).

3. Remediation (apply_dmcub_s5_fix.sh or Manual Steps)

Option A: Automated Remediation Script

Review and run apply_dmcub_s5_fix.sh:

chmod +x apply_dmcub_s5_fix.sh
sudo ./apply_dmcub_s5_fix.sh --apply

Supported flags:

  • sudo ./apply_dmcub_s5_fix.sh --status — Inspect loaded DMUB firmware version, initramfs state, and active dcdebugmask.
  • sudo ./apply_dmcub_s5_fix.sh --apply — Back up stock firmware & GRUB config, install upstream dcn_3_1_4_dmcub.bin.zst (0x08006500), set amdgpu.dcdebugmask=0x802, and rebuild initramfs + grub.cfg.
  • sudo ./apply_dmcub_s5_fix.sh --rollback — Restore original stock firmware and GRUB configuration.

Option B: Manual Step-by-Step Commands

Step 1: Upgrade dcn_3_1_4_dmcub.bin.zst to Upstream linux-firmware (0x08006500 / Release 0.1.80.0)

# 1. Back up the stock Ubuntu 20240318 DCN 3.1.4 DMCUB firmware
sudo cp -a /lib/firmware/amdgpu/dcn_3_1_4_dmcub.bin.zst \
           /lib/firmware/amdgpu/dcn_3_1_4_dmcub.bin.zst.bak-08004800

# 2. Download upstream DCN 3.1.4 DMCUB binary from kernel.org and compress with zstd
curl -fsSL "https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/plain/amdgpu/dcn_3_1_4_dmcub.bin" \
  -o /tmp/dcn_3_1_4_dmcub.bin
sudo zstd -f -q /tmp/dcn_3_1_4_dmcub.bin -o /lib/firmware/amdgpu/dcn_3_1_4_dmcub.bin.zst
sudo chown root:root /lib/firmware/amdgpu/dcn_3_1_4_dmcub.bin.zst
sudo chmod 644 /lib/firmware/amdgpu/dcn_3_1_4_dmcub.bin.zst
rm -f /tmp/dcn_3_1_4_dmcub.bin

Step 2: Configure amdgpu.dcdebugmask=0x802 and Disable Plymouth Framebuffer Thrashing on Shutdown

Removing splash prevents plymouthd from re-acquiring DRM master and thrashing eDP framebuffers during final shutdown, while amdgpu.dcdebugmask=0x802 disables DCN deep-idle IPS (0x800) and stutter compression-buffer resizing (0x2):

sudo cp -a /etc/default/grub /etc/default/grub.bak-dmcub
sudo sed -i 's/^GRUB_CMDLINE_LINUX_DEFAULT=.*/GRUB_CMDLINE_LINUX_DEFAULT="quiet amdgpu.dcdebugmask=0x802"/' /etc/default/grub
sudo update-grub
sudo update-initramfs -u -k all

Step 3: Reboot and Verify

sudo dmesg | grep -iE "dmub|dmcub"
# Expected output:
# [drm] Loading DMUB firmware via PSP: version=0x08006500
# [drm] DMUB hardware initialized: version=0x08006500

cat /sys/module/amdgpu/parameters/dcdebugmask
# Expected output:
# 2050

4. Provenance & License

  • Engineering & Hardware Verification: Bill Fullen (@Tethtibis)
  • Diagnostic & Packaging Orchestration: Diagnosed, stress-tested, and verified via The Rykr Framework (v4.0) — a deterministic Linux systems-diagnostic and modular DevOps orchestration architecture engineered by Bill Fullen (utilizing a Gemini reasoning backend under the 4-Stage Genesis Pipeline).
  • License: Released under the MIT License.

About

Forensic root-cause analysis & automated remediation for AMD Ryzen 7040/8040 (Phoenix / Hawk Point DCN 3.1.4) DMCUB firmware deadlock & ACPI S5 shutdown hang on Ubuntu 24.04 HWE / Linux Mint 22.x

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages