Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/sh
# Workaround for RK3566 DRM VBlank hang on reboot/shutdown (kernel 7.0.2).
#
# Root cause: drm_atomic_helper_wait_for_vblanks() has no timeout. It is called
# from the DRM reboot notifier chain, which runs for both normal reboots and
# sysrq-b (machine_emergency_restart does NOT bypass the notifier chain on this
# kernel/platform). If the display is powered off before reboot, hardware vblank
# interrupts stop and this wait hangs for ~5 minutes until an internal timeout.
#
# Fix: do NOT power off the display before rebooting. With the display active
# and hardware vblanks still occurring, the DRM notifier completes in <100ms.
#
# Verified with persistent systemd journal across reboots:
# Before fix: shutdown → new boot = ~6 minutes
# After fix: shutdown → new boot = ~17 seconds
#
# Device: RG ARC-D (RK3566), ROCKNIX 20260601, kernel 7.0.2
echo 128 > /proc/sys/kernel/sysrq
echo s > /proc/sysrq-trigger
sleep 1
echo b > /proc/sysrq-trigger
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[Unit]
Description=RK3566 reboot workaround: clean DRM state before shutdown
Documentation=https://github.com/ROCKNIX/distribution/issues/
# Without this service, drm_atomic_helper_wait_for_vblanks() in the Rockchip
# DRM driver hangs indefinitely during shutdown (no timeout), blocking the
# reboot notifier chain and preventing the device from rebooting.
DefaultDependencies=no
Conflicts=shutdown.target reboot.target halt.target
Before=shutdown.target reboot.target halt.target
After=multi-user.target essway.service sway.service

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/bin/true
ExecStop=/usr/bin/rk3566-reboot-fix
TimeoutStopSec=20s

[Install]
WantedBy=multi-user.target