Repository navigation
drm/apple: audio: make the legacy test's DMA channel private - #4036
Merged
Merged
Conversation
The kernel-release smoke on main fails in apple-dcpaud-legacy:
dcpaud_legacy_plugged_close_unplug_reopen_vmalloc: ASSERTION FAILED at
drivers/gpu/drm/apple/audio-legacy-test.c:698
Expected dcpaud->chan == &t->channel, but dcpaud->chan == NULL
__dma_async_device_channel_unregister called while 1 clients hold a
reference
The case registers a fake DMA device without DMA_PRIVATE. The dmaengine
core hands the channels of such a device to dmaengine_get() users: if
there is one, dma_async_device_register() takes a reference on every
channel for it. async_tx is such a user, so once async_tx.ko is loaded
the channel is busy before the case can request it, and the reference
is still there when the device is unregistered.
apple-sio, the DMA controller the driver really uses, sets DMA_PRIVATE,
so the DP audio driver never sees this. Set it in the test as well.
This is the order the modules are loaded in, not a race: in each of the
six main runs checked, the case fails in the smoke guest that loads
async_tx before appledrm, and passes in the one that loads it later and
in the one that does not load it.
Fixes: 9f33c3f ("drm/apple: select DP audio buffer ownership per PCM open")
Signed-off-by: DjDeveloperr <hey@djdev.me>
DjDeveloperr
marked this pull request as ready for review
December 3, 2026 02:27
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
RyanTheTide
approved these changes
Dec 3, 2026
RyanTheTide
left a comment
Contributor
There was a problem hiding this comment.
Reviewed 0078f0d. The fake channel now uses the private capability of the actual SIO controller, so async_tx cannot reserve it before the test. The reported 20/20 UML pass with async_tx and unchanged clean control without it isolate the fix. Runtime code is untouched.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What:
main's kernel-release smoke fails in the KUnit suiteapple-dcpaud-legacy, so nothing is published. The test's fake DMA device is public, so a loadedasync_txtakes its only channel before the test can. Make it private, likeapple-sio, the DMA controller the driver really uses. Two lines, test only.Tested: no runtime change (KUnit only). At
0078f0d25287,apple-dcpaud-legacyon UML withasync_txpresent:mainfails 20 of 20 boots, this passes 20 of 20 (11/11 cases each). Withoutasync_tx: 10 of 10 pass on both. arm64W=1ofaudio.owith the test built in: 0 warnings. checkpatch--strict: 0/0/0.Risk: two-way door · none. Test-only:
audio.cand everything a Mac runs are the same.Not yet: the kernel-release smoke, which runs on
mainafter the merge. No hardware row is needed.Details
dma_request_channel(), before any plug or unplug in the case. The driver has not toucheddcpaud->chanyet, so it is not a teardown that clears the channel.dma_async_device_register()takes a reference on every channel of a device withoutDMA_PRIVATEwhen admaengine_get()user exists.async_txis the only one in the tree (crypto/async_tx/async_tx.c,CONFIG_ASYNC_TX_DMA=yinaurora_defconfig).dma_request_channel()then skips the busy channel and returns NULL. The cleanup WARN, "1 clients hold a reference", is that same reference.drivers/dma/apple-sio.csetsDMA_PRIVATE, soasync_txnever gets its channels.KUnit dcp-displaydoes not haveasync_tx, so it passes with and without this.Evidence
UML (x86_64, clang 23.1.3, uniprocessor), source
main1ab453e8b404,ASYNC_TX_DMA=y,async_txbuilt in.audio.cand its tests are compiled from the tree; the rest of appledrm is stubbed andaudio-no-sio-test.cis left out, becauseDRM_APPLEneeds arm64.async_txoff =initcall_blacklist=async_tx_init. The two kernels differ only inaudio-legacy-test.c.async_txonasync_txonasync_txoffasync_txoffSmoke runs on
main:Boot times in seconds of
async_tx: api initializedand of the suite, from thesmoke-edge-*artifacts. Three guests run the suite in each run.