Skip to content

Commit 25f9754

Browse files
keyonjiebroonie
authored andcommitted
ASoC: Intel: correct the fixed free block allocation
For block span more than 1 section, when allocate it from a free block, we need allocate the remain buffers within the block, and then continue alloc the rest of needed size buffer. Here also make sure this free block is moved from free list to used list, and add it to block_list which may be used for power gating disabling later. Signed-off-by: Jie Yang <yang.jie@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent c6905d6 commit 25f9754

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

sound/soc/intel/sst-firmware.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -763,8 +763,12 @@ static int block_alloc_fixed(struct sst_dsp *dsp, struct sst_block_allocator *ba
763763
/* does block span more than 1 section */
764764
if (ba->offset >= block->offset && ba->offset < block_end) {
765765

766+
/* add block */
767+
list_move(&block->list, &dsp->used_block_list);
768+
list_add(&block->module_list, block_list);
766769
/* align ba to block boundary */
767-
ba->offset = block->offset;
770+
ba->size -= block_end - ba->offset;
771+
ba->offset = block_end;
768772

769773
err = block_alloc_contiguous(dsp, ba, block_list);
770774
if (err < 0)

0 commit comments

Comments
 (0)