-
Notifications
You must be signed in to change notification settings - Fork 318
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
module_adapter: return error if get_conf is not implemented #9045
Merged
kv2019i
merged 1 commit into
thesofproject:main
from
johnylin76:main-module-adapter-get-bytes
Apr 18, 2024
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I realized this leads to a special case that by calling this -EIO will be returned for CMD_SET_DATA if
set_configuration
is not implemented. It's beyond my purpose that returning -EIO for CMD_GET_DATA only.Hi @LaurentiuM1234 , I just saw your comment saying that
cadence.c
doesn't implement bothget_configuration
andset_configuration
, is that correct? If the non-implementedset_configuration
is intentional, I think this line should be fixed to keep CMD_SET_DATA behavior as is.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK, so now
get_configuration()
becomes mandatory andset_configuration()
remains optional. Might be out of scope for this, but did you consider adding all theinterface->set/get_configuration()
logic into some wrapper functions?i.e: something like:
Since this is also used by the IPC4 stuff, having a centralized view showing which operation is optional and which isn't might be helpful?
The
cadence
module doesn't implement theget_configuration()
stuff so if we make it mandatory the issue will still persist. Can't really tell you why it's not implemented but we can probably get around the issue by just implementing a dummyget_configuration()
if we really don't need a proper one. Anyways, IMO not a blocker for this.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Some contexts below for clearer statement:
The commit doesn't mean to make
get_configuration
mandatory (in a literal manner). Instead, the intention is to fix the use case of SOF build which integrates the instance withoutget_configuration
in module_adapter.Consider a host running the IPC command to read blob data from the module_adapter bytes control, if module_adapter doesn't return error while the instance doesn't implement
get_configuration
, the host will consider the blob data is read back successfully, leading to problems on wrong (or illegal) data blob access. As a consequence, it should be better to return error than zero, provided that the host has no clue whetherget_configuration
is implemented by instance or not.