You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[CML] ASoC: Both platform name/of_node are set #515
When SOF start with load tplg, there will be a error with : " cml_rt5682 cml_rt5682: ASoC: Both platform name/of_node are set for SSP1-Codec",
but after the kernel start, manually modprobe the module, the module can be load.
another way to make it auto load, is change the devm_kzalloc to kzalloc in snd_soc_init_platform.
On 1/9/19 1:19 AM, Zhu, Yingjiang wrote:
When SOF start with load tplg, there will be a error with : "
cml_rt5682 cml_rt5682: ASoC: Both platform name/of_node are set for
SSP1-Codec",
This is odd. I've seen this message before and it's been discussed this
week on the alsa mailing list, look for "[alsa-devel] [PATCH] ASoC:
core: Fix deferral of machine drivers"
but after the kernel start, manually modprobe the module, the module
can be load.
Loading the module driver manually will not execute the probe and create
a card, so that's not a solution.
another way to make it auto load, is change the devm_kzalloc to
kzalloc in snd_soc_init_platform.
@zhuyingjiang when you provide logs, it's good if their names are self-explanatory. "why_not_load_mod.txt" and "why_not_load_mod_2.txt" don't tell me what you are trying to do, and how they relate to your bug description
Also you may want to check why the codec is not registered in the first place:
[ 3.366721] cml_rt5682 cml_rt5682: ASoC: CODEC DAI rt5682-aif1 not registered
[ 3.381978] cml_rt5682 cml_rt5682: ASoC: CODEC DAI rt5682-aif1 not registered
Looks to me like you didn't look at the root cause: the machine driver was selected based on the presence of an ACPI ID but the codec driver didn't probe successfully, so things won't work at this point.
another way to make it auto load, is change the devm_kzalloc to
kzalloc in snd_soc_init_platform.
why would that help?
The root cause is the "platform" is dynamic allocated by devm_kzalloc() and it will be freed automatically on error. And It will not be freed automatically If we use kzalloc(). But it will not be freed at all if we don't add a appropriate kfree() for it.
@plbossart I am now report the issues first and I will go deep into the bugs, when the issues are reported.
And OK, I will change the filename and the descriptions.
Bard said he still find this problem before. @bardliao Could you provide some comments?
It's even worse, it creates issues with the way we use .platform_name in
all machine drivers.
At any rate I don't get why we have this issue only on CML so I would
err on the side of a mistake in the CML support.
@plbossart I can see this issue on ICL. APL, and BYT. An easy way to reproduce it is to use an invalid .codec_dai_name on any dai link. So bind dai link will get error, and it is easy to see the issue when the soc core retry to bind dai link.
@bardliao I have never seen this issue on APL/BYT so you will have to provide me with a configuration and log for me to believe it. My money is on a missing configuration of your machine driver. There are actually no usable logs for this issue, we'd need to progress on what the root cause before speculating further.
@plbossart attached the .config and dmesg. the specific config can reproduce the issue on Up2.
Which is made by scripts/kconfig/merge_config.sh .config <PATH>/kconfig/base-defconfig <PATH>/kconfig/sof-defconfig <PATH>/kconfig/hdaudio-codecs-defconfig
with the following change.
# CONFIG_SND_HDA_INTEL is not set
+CONFIG_DEBUG_KMEMLEAK=y
+CONFIG_DEBUG_KMEMLEAK_EARLY_LOG_SIZE=4000
However I can't find a working for CNL. I am checking if there is anything wrong on machine driver.
@plbossart I think I get the reason why the issue is always seen with rt5682 codec. There are so many sleep in rt5682_i2c_probe(), and snd_soc_register_component() will not called before dai link binding. So dai link binding won't success in the first try, and we will meet the issue in the second try. We don't see this issue on other platforms since we can bind dai link successfully at the first try and the issue can only be seen after second try of dai link binding.
@zhuyingjiang No the sleep are necessary for rt5682. ASoC allows retry on dal link binding. The issue is as ASoC: core: Fix deferral of machine drivers says the "platform" is dynamic allocated by devm_kzalloc() and it will be freed automatically on error. So now we will see the "ASoC: Both platform name/of_node are set" error after second try in dai link binding.
@plbossart Yes, I have saw a illegal name of platform, why the name is set should be root cause
====plat name: ;ݱ\xffffffff\xffffffff\xffffffff\xffffffff0�2\xffffffb2\xffffffff\xffffffff\xffffffff\xffffffff====of_node (null)===
Activity
zhuyingjiang commentedon Jan 9, 2019
log
why_not_load_mod_2.txt
why_not_load_mod.txt
plbossart commentedon Jan 9, 2019
plbossart commentedon Jan 9, 2019
@zhuyingjiang when you provide logs, it's good if their names are self-explanatory. "why_not_load_mod.txt" and "why_not_load_mod_2.txt" don't tell me what you are trying to do, and how they relate to your bug description
Also you may want to check why the codec is not registered in the first place:
[ 3.366721] cml_rt5682 cml_rt5682: ASoC: CODEC DAI rt5682-aif1 not registered
[ 3.381978] cml_rt5682 cml_rt5682: ASoC: CODEC DAI rt5682-aif1 not registered
Looks to me like you didn't look at the root cause: the machine driver was selected based on the presence of an ACPI ID but the codec driver didn't probe successfully, so things won't work at this point.
bardliao commentedon Jan 10, 2019
Thanks @plbossart for the information. I read ASoC: core: Fix deferral of machine drivers. I think that is exactly what we meet now. I applied the patch manually and it solved the issue.
The root cause is the "platform" is dynamic allocated by devm_kzalloc() and it will be freed automatically on error. And It will not be freed automatically If we use kzalloc(). But it will not be freed at all if we don't add a appropriate kfree() for it.
zhuyingjiang commentedon Jan 10, 2019
@plbossart I am now report the issues first and I will go deep into the bugs, when the issues are reported.
And OK, I will change the filename and the descriptions.
Bard said he still find this problem before. @bardliao Could you provide some comments?
zhuyingjiang commentedon Jan 11, 2019
@plbossart @bardliao Thanks, this fixed the issue, will wait when it merged , and verify again.
mengdonglin commentedon Jan 15, 2019
@plbossart could you help to merge patch ASoC: core: Fix deferral of machine drivers to close this issue?
bardliao commentedon Jan 15, 2019
@mengdonglin It seems the patch has not been applied to upstream yet.
plbossart commentedon Jan 15, 2019
bardliao commentedon Jan 16, 2019
@plbossart I can see this issue on ICL. APL, and BYT. An easy way to reproduce it is to use an invalid .codec_dai_name on any dai link. So bind dai link will get error, and it is easy to see the issue when the soc core retry to bind dai link.
plbossart commentedon Jan 16, 2019
@bardliao I have never seen this issue on APL/BYT so you will have to provide me with a configuration and log for me to believe it. My money is on a missing configuration of your machine driver. There are actually no usable logs for this issue, we'd need to progress on what the root cause before speculating further.
bardliao commentedon Jan 16, 2019
@plbossart attached the .config and dmesg. the specific config can reproduce the issue on Up2.
Which is made by
scripts/kconfig/merge_config.sh .config <PATH>/kconfig/base-defconfig <PATH>/kconfig/sof-defconfig <PATH>/kconfig/hdaudio-codecs-defconfigwith the following change.
However I can't find a working for CNL. I am checking if there is anything wrong on machine driver.
config.txt
dmesg.txt
bardliao commentedon Jan 16, 2019
@plbossart I think I get the reason why the issue is always seen with rt5682 codec. There are so many sleep in rt5682_i2c_probe(), and snd_soc_register_component() will not called before dai link binding. So dai link binding won't success in the first try, and we will meet the issue in the second try. We don't see this issue on other platforms since we can bind dai link successfully at the first try and the issue can only be seen after second try of dai link binding.
zhuyingjiang commentedon Jan 16, 2019
@bardliao So this is a issue/bug of rt5682?
bardliao commentedon Jan 16, 2019
@zhuyingjiang No the sleep are necessary for rt5682. ASoC allows retry on dal link binding. The issue is as ASoC: core: Fix deferral of machine drivers says the "platform" is dynamic allocated by devm_kzalloc() and it will be freed automatically on error. So now we will see the "ASoC: Both platform name/of_node are set" error after second try in dai link binding.
zhuyingjiang commentedon Jan 16, 2019
@plbossart Yes, I have saw a illegal name of platform, why the name is set should be root cause
====plat name: ;ݱ\xffffffff\xffffffff\xffffffff\xffffffff0�2\xffffffb2\xffffffff\xffffffff\xffffffff\xffffffff====of_node (null)===
kbuild: link lib-y objects to vmlinux forcibly when CONFIG_MODULES=y
UPSTREAM: kbuild: link lib-y objects to vmlinux forcibly when CONFIG_…
smb: smbdirect: introduce smbdirect_public.h with prototypes