Skip to content

audio: volume: Memory, blob, and fast_get allocs to module API - #10323

Merged
lgirdwood merged 1 commit into
thesofproject:mainfrom
jsarha:module_api_volume
Oct 30, 2025
Merged

audio: volume: Memory, blob, and fast_get allocs to module API#10323
lgirdwood merged 1 commit into
thesofproject:mainfrom
jsarha:module_api_volume

Conversation

@jsarha

@jsarhajsarha commented Oct 23, 2025

Copy link
Copy Markdown
Contributor

Allocate all memory, blob handlers, and fast_get() buffers through module API mod_alloc() and friends.

CopilotAI review requested due to automatic review settings October 23, 2025 10:20

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

This PR transitions the volume module to use the module API's automatic memory management system. By replacing manual memory allocation functions (rzalloc, rmalloc, rfree) with module API equivalents (mod_zalloc, mod_alloc), the code leverages automatic cleanup when the module unloads, eliminating the need for manual cleanup in error paths and the free function.

Key changes:

  • Replaced manual memory allocation with module API allocation functions
  • Removed manual memory deallocation from error paths and cleanup functions
  • Removed the now-unused rtos/alloc.h include

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

FileDescription
src/audio/volume/volume_ipc4.cConverted memory allocations to mod_alloc/mod_zalloc and removed manual cleanup calls
src/audio/volume/volume_ipc3.cConverted memory allocations to mod_alloc/mod_zalloc and removed manual cleanup calls
src/audio/volume/volume.cRemoved manual rfree() calls from volume_free() function

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment threadsrc/audio/volume/volume_ipc4.c
Comment threadsrc/audio/volume/volume_ipc3.c
@lgirdwood

Copy link
Copy Markdown
Member

SOFCI TEST

Comment threadsrc/audio/volume/volume_ipc4.c
Comment threadsrc/audio/volume/volume_ipc4.c
Allocate all memory, blob handlers, and fast_get() buffers through
module API mod_alloc() and friends.
Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
@jsarha

jsarha commented Oct 28, 2025

Copy link
Copy Markdown
ContributorAuthor

This new version of volume module using module API to allocate resources still has all the resource freeing code in place.

@lgirdwoodlgirdwood left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@softwarecki fyi - now keeps the free.

@lgirdwood

Copy link
Copy Markdown
Member

@lrudyX good to merge ? other CI looks good.

@softwareckisoftwarecki left a comment

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.

Keeping mod_free as-is, we have a plan to make tracking optional, so I don't see any blockers.

@lgirdwood
lgirdwood merged commit 9ed5472 into thesofproject:mainOct 30, 2025
39 of 45 checks passed
Sign up for freeto 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.

6 participants

@jsarha@lgirdwood@lyakh@kv2019i@softwarecki