Forensic Root-Cause Analysis & Automated Remediation for Ubuntu 24.04 HWE / Linux Mint 22.x
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:
- Incomplete Hardware Power-Off (ACPI
S5Hang): Duringsystemctl 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. - Pre-Shutdown
amdgpuDMCUB Console Flood: Immediately prior to panel power-off on affected cycles, the kernel console floods withError queueing DMUB command: status=2anddc_dmub_srv_log_diagnostic_data: DMCUB error.
| 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) |
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 0x08006500).
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]
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.
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): Setsdc->debug.disable_stutter = true, preventing Hubbub DET/compbuf dynamic resizing during idle stutter entry.0x800(DC_DISABLE_IPS): Setsdc->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(2050decimal).
Review and run apply_dmcub_s5_fix.sh:
chmod +x apply_dmcub_s5_fix.sh
sudo ./apply_dmcub_s5_fix.sh --applySupported flags:
sudo ./apply_dmcub_s5_fix.sh --status— Inspect loaded DMUB firmware version, initramfs state, and activedcdebugmask.sudo ./apply_dmcub_s5_fix.sh --apply— Back up stock firmware & GRUB config, install upstreamdcn_3_1_4_dmcub.bin.zst(0x08006500), setamdgpu.dcdebugmask=0x802, and rebuildinitramfs+grub.cfg.sudo ./apply_dmcub_s5_fix.sh --rollback— Restore original stock firmware and GRUB configuration.
# 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.binRemoving 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 allsudo 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- 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.