audio: dai-zephyr: migrate to use dai_get_properties_copy()#10991
Open
kv2019i wants to merge 1 commit into
Open
audio: dai-zephyr: migrate to use dai_get_properties_copy()#10991kv2019i wants to merge 1 commit into
kv2019i wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the Zephyr-native DAI implementation to support user-space LL execution by avoiding direct use of driver-owned dai_properties pointers and preferring dai_get_properties_copy() to copy properties into a caller-provided buffer.
Changes:
- Introduces a shared helper (
do_dai_get_properties()) that callsdai_get_properties_copy()and conditionally falls back todai_get_properties()for kernel-LL builds. - Migrates several property consumers (
dai_get_handshake(),dai_get_fifo_depth(),dai_get_stream_id(), FIFO address helper, anddai_get_init_delay_ms()) to use stack-allocatedstruct dai_propertiespopulated via the helper.
Comment on lines
+254
to
+258
| props_p = dai_get_properties(dai->dev, direction, stream_id); | ||
| if (props_p) | ||
| *props = *props_p; | ||
| else | ||
| ret = -ENOENT; |
Collaborator
Author
There was a problem hiding this comment.
Oops, fixed in V2.
Collaborator
Author
|
For context, related to #10558 |
Modify code to allocate DAI properties object on stack and use dai_get_properties_copy() whenever available. Add a static helper function to share the implementation. This change is required to enable DAI code to run in user-space. In this scenario, it's not possible to directly use an object returned by driver, but instead data needs to be copied to user-space. As a side benefit, the need to use locking to protect the properties data is limited the fallback case when a driver does not implement the get_properties_copy() method and SOF is built with LL code running in kernel space. Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
5c60f79 to
c7ff67f
Compare
Collaborator
Author
|
V2 pushed:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Modify code to allocate DAI properties object on stack and use dai_get_properties_copy() whenever available. Add a static helper function to share the implementation.
This change is required to enable DAI code to run in user-space. In this scenario, it's not possible to directly use an object returned by driver, but instead data needs to be copied to user-space.
As a side benefit, the need to use locking to protect the properties data is limited the fallback case when a driver does not implement the get_properties_copy() method and SOF is built with LL code running in kernel space.