mbox series

[for-5.15,0/5] ASoC: fsl: register platform component before registering cpu dai

Message ID 1630665006-31437-1-git-send-email-shengjiu.wang@nxp.com
Headers show
Series ASoC: fsl: register platform component before registering cpu dai | expand

Message

Shengjiu Wang Sept. 3, 2021, 10:30 a.m. UTC
There is no defer probe when adding platform component to
snd_soc_pcm_runtime(rtd), the code is in snd_soc_add_pcm_runtime()

snd_soc_register_card()
  -> snd_soc_bind_card()
    -> snd_soc_add_pcm_runtime()
      -> adding cpu dai
      -> adding codec dai
      -> adding platform component.

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.

As there is defer probe checking for cpu dai component, then register
platform component before cpu dai to avoid such issue.

This patch set is to fix this issue for SAI, ESAI, MICFIL, SPDIF,
XCVR drivers.

Shengjiu Wang (5):
  ASoC: fsl_sai: register platform component before registering cpu dai
  ASoC: fsl_esai: register platform component before registering cpu dai
  ASoC: fsl_micfil: register platform component before registering cpu
    dai
  ASoC: fsl_spdif: register platform component before registering cpu
    dai
  ASoC: fsl_xcvr: register platform component before registering cpu dai

 sound/soc/fsl/fsl_esai.c   | 16 ++++++++++------
 sound/soc/fsl/fsl_micfil.c | 15 ++++++++++-----
 sound/soc/fsl/fsl_sai.c    | 14 +++++++++-----
 sound/soc/fsl/fsl_spdif.c  | 14 +++++++++-----
 sound/soc/fsl/fsl_xcvr.c   | 15 ++++++++++-----
 5 files changed, 48 insertions(+), 26 deletions(-)

Comments

Mark Brown Sept. 6, 2021, 11:47 a.m. UTC | #1
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?
Mark Brown Sept. 10, 2021, 10:16 a.m. UTC | #2
On Tue, Sep 07, 2021 at 10:43:26AM +0800, Shengjiu Wang wrote:

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

I would expect that in this situation the same component would be able
to fill both roles.
Mark Brown Sept. 10, 2021, 4:08 p.m. UTC | #3
On Fri, 3 Sep 2021 18:30:01 +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()
> 
> snd_soc_register_card()
>   -> snd_soc_bind_card()
>     -> snd_soc_add_pcm_runtime()
>       -> adding cpu dai
>       -> adding codec dai
>       -> adding platform component.
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/5] ASoC: fsl_sai: register platform component before registering cpu dai
      commit: 9c3ad33b5a412d8bc0a377e7cd9baa53ed52f22d
[2/5] ASoC: fsl_esai: register platform component before registering cpu dai
      commit: f12ce92e98b21c1fc669cd74e12c54a0fe3bc2eb
[3/5] ASoC: fsl_micfil: register platform component before registering cpu dai
      commit: 0adf292069dcca8bab76a603251fcaabf77468ca
[4/5] ASoC: fsl_spdif: register platform component before registering cpu dai
      commit: ee8ccc2eb5840e34fce088bdb174fd5329153ef0
[5/5] ASoC: fsl_xcvr: register platform component before registering cpu dai
      commit: c590fa80b39287a91abeb487829f3190e7ae775f

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark