Skip to content

drm/apple: afk: one initializer for an endpoint's locks and queues - #1444

Merged
RyanTheTide merged 1 commit into
integration/aurorafrom
fix/afk-ep-init-state
Nov 10, 2026
Merged

RyanTheTide merged 1 commit into
integration/aurorafrom
fix/afk-ep-init-state

Conversation

@RyanTheTide

Copy link
Copy Markdown
Contributor

afk_fail_commands_locked() wakes the endpoint's compact_orphan_wq, which afk_init() initializes. The AV lifetime KUnit fixtures build endpoints by hand and never initialized it, so the first av_audiosrv_cleanup() through afk_quiesce() woke a zeroed wait queue (NULL dereference in __wake_up_common from afk_fail_commands_locked), and every later suite in the run crashed with it.

This adds afk_ep_init_state() for the locks, command list, wait queues and completions every endpoint needs before use. afk_init() starts from it, and the endpoints the KUnit fixtures build use it, so a field added to the endpoint is initialized there too. afk_init() itself initializes the same state as before.

Tested on integration/aurora aab4394 + this commit, KUnit arm64:

  • apple-av-audio-lifetime: 17/17 (before: 2 passed, 15 crashed).
  • apple-*: 298/299, one skipped, no build warnings.
  • Fleet config: afk.o and av.o build with -Werror.

🤖 Generated with Claude Code

afk_fail_commands_locked() wakes the endpoint's compact_orphan_wq, which
afk_init() initializes. The AV lifetime KUnit fixtures build endpoints
by hand and never initialized it, so the first av_audiosrv_cleanup()
through afk_quiesce() woke a zeroed wait queue:

  Unable to handle kernel NULL pointer dereference at virtual address 0
  pc : __wake_up_common+0x40/0xe8
   __wake_up+0x44/0x78
   afk_fail_commands_locked+0xb0/0xc4
   afk_quiesce+0x60/0x100
   av_audiosrv_cleanup+0x88/0x100

and every later suite in the run crashed with it (2 of 17 passed).

Add afk_ep_init_state() for the locks, command list, wait queues and
completions every endpoint needs before use, start afk_init() from it,
and use it for the endpoints the KUnit fixtures build, so a field added
to the endpoint is initialized for them too.

KUnit (arm64): apple-av-audio-lifetime 17/17 (was 2 passed, 15
crashed); apple-* 298/299, one skipped.

Assisted-by: LLM
Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant