Skip to content

Commit

Permalink
ASoC: Intel: correct the fixed free block allocation
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
  • Loading branch information
keyonjie authored and broonie committed Dec 24, 2014
1 parent c6905d6 commit 25f9754
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion sound/soc/intel/sst-firmware.c
Original file line number Diff line number Diff line change
Expand Up @@ -763,8 +763,12 @@ static int block_alloc_fixed(struct sst_dsp *dsp, struct sst_block_allocator *ba
/* does block span more than 1 section */
if (ba->offset >= block->offset && ba->offset < block_end) {

/* add block */
list_move(&block->list, &dsp->used_block_list);
list_add(&block->module_list, block_list);
/* align ba to block boundary */
ba->offset = block->offset;
ba->size -= block_end - ba->offset;
ba->offset = block_end;

err = block_alloc_contiguous(dsp, ba, block_list);
if (err < 0)
Expand Down

0 comments on commit 25f9754

Please sign in to comment.