daedalus-v4l2-dkms: 79256dc -> 6ffe92b — fix kernel panic regression from #67 #69

Merged
marfrit merged 1 commits from claude-noether/marfrit-packages:noether/daedalus-dkms-bump-6ffe92b into main 2026-05-21 12:00:16 +00:00
Owner

Kernel-only bump. Fixes the hard-reboot regression introduced by daedalus-v4l2 PR #7 (the split-completion design landed via marfrit-packages PR #67).

What broke

On higgs (Pi CM5, 6.18.29+rpt-rpi-2712), the first mpv --hwdec=vaapi-copy playback of a 720p H.264 clip after installing daedalus-v4l2{,-dkms} 0.1.0+r28+g79256dc-1 hard-rebooted the box. No persistent journal on this host, no recoverable trace.

Root cause

device_run previously left both src and dst in m2m_ctx's rdy_queue between pickup and buf_done, relying on the old v4l2_m2m_buf_done_and_job_finish helper to remove them at completion. The new split-completion path (HAS_PIXELS / SRC_CONSUMED separate) calls v4l2_m2m_job_finish on SRC_CONSUMED even when the dst_buf is still parked. job_finish moves the m2m_ctx back to IDLE; the scheduler dispatches the next device_run; v4l2_m2m_next_dst_buf returns the head of the rdy_queue — which is still our parked dst_buf. Two inflight entries on the same vb2_buffer. Later HAS_PIXELS triggers v4l2_m2m_dst_buf_remove_by_buflist_del on an already-detached list_head → memory corruption, panic.

Fix (daedalus-v4l2#8, merged at 6ffe92b)

device_run now calls v4l2_m2m_src_buf_remove_by_buf + v4l2_m2m_dst_buf_remove_by_buf as soon as it has peeked the buffers and all validation passes, BEFORE adding them to the inflight list. After that, the daemon owns both halves; the m2m scheduler can't re-issue them. Completion path drops the redundant _remove_by_buf calls.

Matches the amphion vdec.c/venc.c pattern.

Wire compat

DAEDALUS_PROTO_VERSION stays at 1. The daemon doesn't need to bumpdaedalus-v4l2 0.1.0+r28+g79256dc-1 (already deployed on higgs) is wire-compatible with this new DKMS module. apt install daedalus-v4l2-dkms alone is sufficient.

Deployment on higgs

sudo apt update
sudo systemctl stop daedalus-v4l2  # may already be stopped/masked
sudo apt install daedalus-v4l2-dkms
sudo rmmod daedalus_v4l2
sudo modprobe daedalus_v4l2
sudo systemctl unmask daedalus-v4l2   # if previously masked
sudo systemctl start daedalus-v4l2

Refs

**Kernel-only bump.** Fixes the hard-reboot regression introduced by daedalus-v4l2 PR #7 (the split-completion design landed via marfrit-packages PR #67). ## What broke On higgs (Pi CM5, 6.18.29+rpt-rpi-2712), the first `mpv --hwdec=vaapi-copy` playback of a 720p H.264 clip after installing `daedalus-v4l2{,-dkms} 0.1.0+r28+g79256dc-1` hard-rebooted the box. No persistent journal on this host, no recoverable trace. ## Root cause `device_run` previously left both src and dst in `m2m_ctx`'s rdy_queue between pickup and `buf_done`, relying on the old `v4l2_m2m_buf_done_and_job_finish` helper to remove them at completion. The new split-completion path (`HAS_PIXELS` / `SRC_CONSUMED` separate) calls `v4l2_m2m_job_finish` on `SRC_CONSUMED` even when the dst_buf is still parked. `job_finish` moves the m2m_ctx back to IDLE; the scheduler dispatches the next `device_run`; `v4l2_m2m_next_dst_buf` returns the head of the rdy_queue — which is still our parked dst_buf. Two inflight entries on the same `vb2_buffer`. Later `HAS_PIXELS` triggers `v4l2_m2m_dst_buf_remove_by_buf` → `list_del` on an already-detached `list_head` → memory corruption, panic. ## Fix (daedalus-v4l2#8, merged at 6ffe92b) `device_run` now calls `v4l2_m2m_src_buf_remove_by_buf` + `v4l2_m2m_dst_buf_remove_by_buf` as soon as it has peeked the buffers and all validation passes, BEFORE adding them to the inflight list. After that, the daemon owns both halves; the m2m scheduler can't re-issue them. Completion path drops the redundant `_remove_by_buf` calls. Matches the amphion `vdec.c`/`venc.c` pattern. ## Wire compat `DAEDALUS_PROTO_VERSION` stays at 1. **The daemon doesn't need to bump** — `daedalus-v4l2 0.1.0+r28+g79256dc-1` (already deployed on higgs) is wire-compatible with this new DKMS module. `apt install daedalus-v4l2-dkms` alone is sufficient. ## Deployment on higgs ```sh sudo apt update sudo systemctl stop daedalus-v4l2 # may already be stopped/masked sudo apt install daedalus-v4l2-dkms sudo rmmod daedalus_v4l2 sudo modprobe daedalus_v4l2 sudo systemctl unmask daedalus-v4l2 # if previously masked sudo systemctl start daedalus-v4l2 ``` ## Refs - reauktion/daedalus-v4l2 PR #8: https://git.reauktion.de/reauktion/daedalus-v4l2/pulls/8 (merged) - Predecessor bump (the one that introduced the panic): marfrit-packages PR #67
marfrit added 1 commit 2026-05-21 11:57:21 +00:00
Kernel-only bump.  Fixes the hard-reboot regression introduced by
the daedalus-v4l2#7 split-completion design and observed on higgs
(Pi CM5) during the first mpv vaapi-copy playback of 720p H.264:
device_run now removes src + dst from m2m_ctx's rdy_queue at the
moment it picks them up, not at buf_done time.  Without this, a
parked dst_buf (waiting for libavcodec's display-order release)
stayed in the rdy_queue and got re-picked by the next device_run
after SRC_CONSUMED's job_finish released the scheduler — two
inflight entries on the same vb2_buffer, later HAS_PIXELS calls
list_del on an already-detached list_head, panic.

DAEDALUS_PROTO_VERSION stays at 1 — daemon (userspace
daedalus-v4l2) need NOT bump in lockstep with this DKMS update.
The existing daedalus-v4l2 0.1.0+r28+g79256dc is wire-compatible
with daedalus-v4l2-dkms 0.1.0+r30+g6ffe92b.

Refs:
  * reauktion/daedalus-v4l2#8
marfrit merged commit 1c8c186681 into main 2026-05-21 12:00:16 +00:00
marfrit deleted branch noether/daedalus-dkms-bump-6ffe92b 2026-05-21 12:00:16 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: marfrit/marfrit-packages#69