Skip to content

[CML] ASoC: Both platform name/of_node are set #515

Closed

Description

@zhuyingjiang

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.

Activity

  1. zhuyingjiang commented on Jan 9, 2019

    @zhuyingjiang
    Author
  2. plbossart commented on Jan 9, 2019

    @plbossart
    Member
  3. plbossart commented on Jan 9, 2019

    @plbossart
    Member

    @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.

  4. bardliao commented on Jan 10, 2019

    @bardliao
    Collaborator

    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.

    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.

  5. zhuyingjiang commented on Jan 10, 2019

    @zhuyingjiang
    Author

    @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?

  6. zhuyingjiang commented on Jan 11, 2019

    @zhuyingjiang
    Author

    @plbossart @bardliao Thanks, this fixed the issue, will wait when it merged , and verify again.

  7. added
    bugSomething isn't working
    CMLApplies to Comet Lake platform
    on Jan 15, 2019
  8. mengdonglin commented on Jan 15, 2019

    @mengdonglin

    @plbossart could you help to merge patch ASoC: core: Fix deferral of machine drivers to close this issue?

  9. bardliao commented on Jan 15, 2019

    @bardliao
    Collaborator

    @mengdonglin It seems the patch has not been applied to upstream yet.

  10. plbossart commented on Jan 15, 2019

    @plbossart
    Member
  11. bardliao commented on Jan 16, 2019

    @bardliao
    Collaborator

    @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.

  12. plbossart commented on Jan 16, 2019

    @plbossart
    Member

    @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.

  13. bardliao commented on Jan 16, 2019

    @bardliao
    Collaborator

    @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.

    config.txt
    dmesg.txt

  14. bardliao commented on Jan 16, 2019

    @bardliao
    Collaborator

    @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.

  15. zhuyingjiang commented on Jan 16, 2019

    @zhuyingjiang
    Author

    There are so many sleep in rt5682_i2c_probe(), and snd_soc_register_component() will not called before dai link binding.

    @bardliao So this is a issue/bug of rt5682?

  16. bardliao commented on Jan 16, 2019

    @bardliao
    Collaborator

    @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.

  17. zhuyingjiang commented on Jan 16, 2019

    @zhuyingjiang
    Author

    @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)===

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    CMLApplies to Comet Lake platformbugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions