Skip to content

Conversation

@kv2019i
Copy link
Contributor

@kv2019i kv2019i commented Dec 17, 2025

Follow up to #99811 , with:

  • improve documentation
  • fix issues in syscall handlers and make the checks more robust
  • add missing get_properties to all Intel DAI types, allowing them all to be used from user-space

Handle the case if driver is not implementing get_properties_copy().

Document the behaviour and add a note that the method is optional and
users need to be handle the case that not all drivers will have this
method defined.

Also add documentation on error codes. Drivers should use -ENOENT if
no properties are defined for the device. This matches behaviour of
dai_get_properties() returning NULL if there are no properties.

Signed-off-by: Kai Vehmanen <[email protected]>
…copy

Fix function indentation to match coding style.

Signed-off-by: Kai Vehmanen <[email protected]>
…py()

dai_ssp_get_properties() can return NULL if there are no properties
defined for the device. Handle this case correctly in ssp driver's
dai_ssp_get_properties_copy() by returning -ENOENT in this case.

Signed-off-by: Kai Vehmanen <[email protected]>
Make a in-kernel copy of 'cfg' parameter before passing the struct
to kernel z_impl_dai_config_set() implementation. This ensures
user-space will not have access to the object when kernel part
of the syscall is running.

Also add separate handling for the case where bespoke configuration
object is NULL. While no current driver works without a bespoke
configuration, this is not forbidden in the API and the generic syscall
handler should not assume a bespoke object is passed.

Signed-off-by: Kai Vehmanen <[email protected]>
Implement get_properties_copy(). This allows the driver to be used
from user-space threads.

Signed-off-by: Kai Vehmanen <[email protected]>
Implement get_properties_copy(). This allows the driver to be used
from user-space threads.

Signed-off-by: Kai Vehmanen <[email protected]>
Implement get_properties_copy(). This allows the driver to be used
from user-space threads.

Signed-off-by: Kai Vehmanen <[email protected]>
@sonarqubecloud
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants