Skip to content
Merged
Changes from 1 commit
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
5 changes: 4 additions & 1 deletion src/lib/dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,10 @@ void dma_put(struct dma *dma)
k_spinlock_key_t key;

key = k_spin_lock(&dma->lock);
--dma->sref;
if (--dma->sref == 0) {
rfree(dma->chan);
dma->chan = NULL;
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without this, we lose one "dma->chan = rzalloc(SOF_MEM_ZONE_RUNTIME_SHARED" worth of memory whenever sref goes to 1->0 and back.


tr_info(&dma_tr, "dma_put(), dma = %p, sref = %d",
dma, dma->sref);
Expand Down