-
Notifications
You must be signed in to change notification settings - Fork 140
ASoC: soc-core: filter use of 'ignore_machine' field #3236
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
ASoC: soc-core: filter use of 'ignore_machine' field #3236
Conversation
The 'ignore_machine' field is currently used to ignore all FE dailinks statically added by the machine drivers, as well as override the fixups for the BE dailinks. The motivation for this field was primarily to reuse the same machine driver on Intel devices, both with legacy and SOF-based platform drivers. SOF is now used on Mediatek platforms, where the same card uses SOF-based dailinks to deal with DSP-managed streams, as well as 'regular' dailinks. The 'ignore_machine' field set by the core SOF platform driver is too strong, with dailinks not managed by SOF being modified. This patch adds a stricter filtering so that only dailinks managed by a topology-based SOF driver are modified. Reported-by: YC Hung <yc.hung@mediatek.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
|
completely untested proof-of-concept as an alternative to PR #3217 |
|
@plbossart Thanks for providing this PR. I tried this patch. It can skip and won't modify regular dailinks but I found sof-based dailinks, dai_link->platform->of_node will be set then it will show "ASoC : Neither/both platform name/of_node are set for xxx, platform yyy" in the so_dai_link_sanity_check function. Do you have any suggestion to avoid this? Thanks! |
Thanks for testing, that's good, I had no idea if it even worked ;-)
I don't have a clue unfortunately, but this code was written by @dbaluta so that's something to be discussed between DeviceTree users: |
|
@dbaluta @plbossart |
@yaochunhung I got the exact error so for this reason I've added d971400. In your case it means that you have dai_link->platforms->name already set and with d971400 dai_link->plaforms->of_node is also set which upsets SOC core. |
|
@yaochunhung any comments on @dbaluta's feedback? should we proceed with my change? |
|
@plbossart @dbaluta I check dai_link->platforms->name will be set in sof_link_load function. Not sure if it is ok to add additional condition check as below, |
|
@plbossart I think your idea it's good. One existing problem I noticed is when using the same machine driver to create two sound cards. One for a normal sound card and one for a SOF-sound card. Here is pseudocode for So, this function will change card name no matter what! (normal card or SOF card). Here is an update to your patch which avoids this problem: |
|
@dbaluta I didn't think about the card name at all, but I really wonder what we are supposed to do if there are multiple components used by a card. Clearly it makes no sense to pick the topology prefix from one component or the other. The result would anyway dependent on the order in which components are handled, a complete nightmare. Put differently, I am not sure if the changes you suggested above would work for the 2 component case. |
|
@plbossart indeed i never thought about two components. I'm not sure the initial code was designed with that in mind. Put differently, the code has the same problem w or w/o my changes but at least it doesn't modify the card name for components not intended to be used by that card. Later edit: I think that when using multiple components they'll need to have some topology prefix. |
|
@plbossart @dbaluta |
|
@plbossart i also think we can go with your patch and fix the card name change later. because this problem exists w or w/o your patch. |
ok, then let's record your review approval and merge - standard operating procedure :-) |
|
Why was this merged with (old and) mostly failing tests? https://sof-ci.01.org/linuxpr/PR3236/build6619/devicetest/ Revert submitted in #3294 |
|
@marc-hb my fault. for some reason i thought that those were normal to fail |
|
@plbossart Do you have any suggestion about how to fix these testing? Thanks. |
Been busy with other things, will try to look into this later this week. |
BTW https://sof-ci.01.org/linuxpr/PR3236/build6619/devicetest/ had many test failures across many platforms, so it should be easy to reproduce at least some failures and start debugging to help. |
|
@plbossart Sorry to bother again. Do you have any idea about the testing fails? Thanks. + if (!dai || dai->component != component)
+ continue;Should it be + if (!dai && dai->component != component)
+ continue; |
|
@yaochunhung i can hopefully take a look later this week |
|
Seems like this is something to do with SDW skus, was able to repro on one of my TGL devices with soundwire |
|
@cujomalainey Please see the comment #3352 (comment) thanks. |
The 'ignore_machine' field is currently used to ignore all FE dailinks
statically added by the machine drivers, as well as override the
fixups for the BE dailinks. The motivation for this field was
primarily to reuse the same machine driver on Intel devices, both with
legacy and SOF-based platform drivers.
SOF is now used on Mediatek platforms, where the same card uses
SOF-based dailinks to deal with DSP-managed streams, as well as
'regular' dailinks. The 'ignore_machine' field set by the core SOF
platform driver is too strong, with dailinks not managed by SOF being
modified.
This patch adds a stricter filtering so that only dailinks managed by
a topology-based SOF driver are modified.
Reported-by: YC Hung yc.hung@mediatek.com
Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com