[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAA+D8APjyq74FECmH6ZzyVKHOz6MEV0bt+D4-Xkfc-6C5n9hZg@mail.gmail.com>
Date: Tue, 7 Sep 2021 10:43:26 +0800
From: Shengjiu Wang <shengjiu.wang@...il.com>
To: Mark Brown <broonie@...nel.org>
Cc: Shengjiu Wang <shengjiu.wang@....com>, alsa-devel@...a-project.org,
Timur Tabi <timur@...nel.org>, Xiubo Li <Xiubo.Lee@...il.com>,
linuxppc-dev <linuxppc-dev@...ts.ozlabs.org>,
Takashi Iwai <tiwai@...e.com>,
Nicolin Chen <nicoleotsuka@...il.com>,
Fabio Estevam <festevam@...il.com>,
linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH for-5.15 0/5] ASoC: fsl: register platform component
before registering cpu dai
Hi Mark
On Mon, Sep 6, 2021 at 7:48 PM Mark Brown <broonie@...nel.org> wrote:
>
> On Fri, Sep 03, 2021 at 06:30:01PM +0800, Shengjiu Wang wrote:
>
> > There is no defer probe when adding platform component to
> > snd_soc_pcm_runtime(rtd), the code is in snd_soc_add_pcm_runtime()
>
> ...
>
> > So if the platform component is not ready at that time, then the
> > sound card still registered successfully, but platform component
> > is empty, the sound card can't be used.
>
> This sounds like a bug which should be fixed there?
It is hard.
In cpu dai driver we always register two components, one is for
cpu dai, another is for platform, so for sound card platform and
cpu share the same node.
/* Find PLATFORM from registered PLATFORMs */
for_each_link_platforms(dai_link, i, platform) {
for_each_component(component) {
if (!snd_soc_is_matching_component(platform, component))
continue;
snd_soc_rtd_add_component(rtd, component);
}
}
Above code in snd_soc_add_pcm_runtime() checks components
for the platform, because there are two components for the node,
the first one is the component of cpu dai, which is added by
registering dai, it is already added in the beginning, so it is
duplicated, but the second one (which is for platform) is not ready,
then issue happens.
It is hard to add conditions here for defer probe. And maybe
some drivers need the same components for cpu and platform.
Do you have any suggestions?
(The easy way is to fix in each drivers:))
Best Regards
Wang Shengjiu
Powered by blists - more mailing lists