Skip to content

Conversation

@ranj063
Copy link
Collaborator

@ranj063 ranj063 commented May 12, 2025

No description provided.

Copilot AI review requested due to automatic review settings May 12, 2025 20:55
Copy link

Copilot AI left a comment

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 removes redundant buffer validation checks across multiple audio processing components by consolidating and repositioning validity checks in prepare functions and removing duplicate assignments.

  • Consolidated buffer validity checks in prepare routines
  • Removed duplicate reassignments for source and sink buffers
  • Improved consistency in error handling for missing buffers

Reviewed Changes

Copilot reviewed 30 out of 30 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/audio/rtnr/rtnr.c Removed redundant buffer reassignments and added a buffer validity check
src/audio/multiband_drc/multiband_drc_ipc4.c Added sink buffer validation before parameter setup
src/audio/multiband_drc/multiband_drc.c Introduced source buffer validation
src/audio/module_adapter/module/waves/waves.c Added buffer existence check before processing
src/audio/mixer/mixer.c Added sink buffer validation; note slight inconsistency in error message phrasing
src/audio/mfcc/mfcc.c Added combined source/sink buffer check
src/audio/igo_nr/igo_nr.c Added combined source/sink buffer check before processing
src/audio/google/google_ctc_audio_processing.c Added source buffer validation in prepare routine
src/audio/eq_iir/eq_iir_ipc4.c Clarified via comment that buffer connectivity is assumed valid
src/audio/eq_iir/eq_iir_ipc3.c Clarified via comment that buffer connectivity is assumed valid
src/audio/eq_iir/eq_iir.c Consolidated buffer checks and removed redundant reassignments
src/audio/eq_fir/eq_fir_ipc4.c Added comment to note buffer validation performed by caller
src/audio/eq_fir/eq_fir.c Consolidated buffer checks and removed redundant reassignments
src/audio/drc/drc.c Moved buffer validation prior to parameter setup; eliminated duplicate checks
src/audio/dcblock/dcblock_ipc4.c Added comment clarifying buffer connectivity assumption
src/audio/dcblock/dcblock.c Added buffer validation check before calling parameters
src/audio/crossover/crossover_ipc4.c Updated comment to indicate that source buffer validity has been verified
src/audio/crossover/crossover.c Added source buffer check and removed a redundant reassignment
src/audio/asrc/asrc.c Added source/sink buffer check and clarified redundant check comment
src/audio/aria/aria.c Inserted a buffer validation check before setting stream parameters
Comments suppressed due to low confidence (1)

src/audio/mixer/mixer.c:218

  • [nitpick] Consider using a consistent error message (e.g. "no sink buffer") to match the phrasing used in other modules.
comp_err(dev, "no sink");

@ranj063 ranj063 force-pushed the main-051225 branch 2 times, most recently from 7b62669 to ed43ad0 Compare May 12, 2025 20:57
pm_state_force() sets the forced state and always returns true. So
remove the redundant check for failure.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
tr_err(&zephyr_tr, "failed to set PM_STATE_SOFT_OFF on core %d", id);
return;
}
pm_state_force(id, &(struct pm_state_info){PM_STATE_SOFT_OFF, 0, 0});
Copy link
Collaborator

Choose a reason for hiding this comment

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

yeah, but the function returns a "success status" supposedly. Should we add an assert in case the implementation changes? And in production builds it will be removed anyway

Copy link
Member

Choose a reason for hiding this comment

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

I think its wise keeping the check - its safe for future API changes, and its non time critical code.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ok ill close this PR. Anyway, I want to remove the call for pm_state_force() during disable and use sys_poweroff() instead.

Copy link
Contributor

@tmleman tmleman left a comment

Choose a reason for hiding this comment

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

I made a PR to Zephyr that checks if a given state was successfully set; let's see what the PM maintainers from Zephyr say about it (zephyrproject-rtos/zephyr#89876).

tr_err(&zephyr_tr, "failed to set PM_STATE_SOFT_OFF on core %d", id);
return;
}
pm_state_force(id, &(struct pm_state_info){PM_STATE_SOFT_OFF, 0, 0});
Copy link
Contributor

Choose a reason for hiding this comment

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

If I remember correctly, at the time it was written, it was possible to receive false. But currently, that possibility no longer exists; the function returns true even if the specified state cannot be set.

@ranj063 ranj063 closed this May 15, 2025
Sign up for free to 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.

4 participants