forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 140
ASoC: SOF: ipc3-topology: overwrite ALH dai index #4036
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
Closed
Closed
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 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
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.
How we are not counting dai indexes with this change? This patch does something else than the commit message tells?
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.
Currently, we calculate dai index in topology, like eval(UAJ_LINK * 256 + 2). That is to match the formula data.dai_index = (params_data->link_id << 8) | d->id; in
sdw_params_stream. With this commit, we will get dai_index fromsdw_params_streamand that's why we don't need to calculate dai index in topology.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.
Right, but I don't see this calculation. Is it in the firmware's topology section or where?
It is confusing to mention something which is not visible.
Can there be disconnect (and issue) if the somewhere calculated dai_index is not matching with dai_index calculated and stored via
sdw_params_stream?And btw, I don't see any
sdw_params_streamin this patch either..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.
Yes, the calculation is in topology. We use link id and data port id to calculate the dai index and the formula is dai_index = (link_id * 256 + data_port_id)
It is not visible in the patch because the calculation is already on kernel side but we didn't use it.
I will try to explain it more in the commit message.
Yes, the firmware will be disconnected if the dai index is not correct. The firmware needs dai index to get SoundWire link id and data port. Just like SSP dai index matches SSP port.
sdw_params_streamis in sound/soc/sof/intel/hda.c, and the patch doesn't touch it.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.
@bardliao, hrm, so this was pretty much broken before, right?
I mean currently we use two numbers as dai_index, coming from independent sources and they are identical "by luck" (I know, it is a bit more than luck).
It would have been correct if:
So taking the dai_index for both struct from the same source.
I would further clarify the commit message to:
or something.
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.
Commit message updated.
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.
@bardliao I'd still argue that this change is not really needed. But if you insist, I'd go one step further and also remove the dai_index setting on line 1540 to absolutely make sure that we do not use the index coming from topology.
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.
@bardliao it would help to get a bit more context on what we do on topology.
I see that we use the arithmetic in multiple places
I have no idea which ones of those evals are required....
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.
The above is for dai index, so it is required.
And the other seems to be not required. I changed it and the topology still worked.