mbox series

[0/6] ASoC: remove unnecessary dai_link->platform

Message ID 878rfyjz4p.wl-kuninori.morimoto.gx@renesas.com
Headers show
Series ASoC: remove unnecessary dai_link->platform | expand

Message

Kuninori Morimoto March 15, 2023, 6:40 a.m. UTC
Hi Mark

Current ASoC will ignore already connected component when binding Card.
This will happen mainly "CPU Component" is handled as "Platform Component",
which was needed before.

	static int snd_soc_rtd_add_component(...)
	{
		...
		for_each_rtd_components(rtd, i, comp) {
			/* already connected */
			if (comp == component)
				return 0;
		}
		...
	}

Some drivers are still using CPU or Dummy Component as Platform Component,
but these are no meaning or ignored.
This patch-set remove these.

Kuninori Morimoto (6):
  ASoC: fsl: remove unnecessary dai_link->platform
  ASoC: atmel: remove unnecessary dai_link->platform
  ASoC: ti: remove unnecessary dai_link->platform
  ASoC: soc-topology.c: remove unnecessary dai_link->platform
  ASoC: simple-card-utils.c: remove unnecessary dai_link->platform
  ASoC: simple-card.c: add missing of_node_put()

 include/sound/simple_card_utils.h     |  2 --
 sound/soc/atmel/atmel-classd.c        |  5 +---
 sound/soc/atmel/atmel-pdmic.c         |  5 +---
 sound/soc/fsl/imx-audmix.c            | 14 +++------
 sound/soc/fsl/imx-spdif.c             |  5 +---
 sound/soc/generic/audio-graph-card.c  |  6 ----
 sound/soc/generic/audio-graph-card2.c |  9 ++----
 sound/soc/generic/simple-card-utils.c |  9 ------
 sound/soc/generic/simple-card.c       | 41 ++++++++++++++++-----------
 sound/soc/soc-topology.c              |  8 ++----
 sound/soc/ti/omap-hdmi.c              |  5 +---
 11 files changed, 36 insertions(+), 73 deletions(-)

Comments

Mark Brown March 20, 2023, 5:49 p.m. UTC | #1
On Wed, Mar 15, 2023 at 06:42:10AM +0000, Kuninori Morimoto wrote:
> dai_link->platform is no longer needed if CPU and Platform are
> same Component. This patch removes unnecessary dai_link->platform.

I've not poked at things to try to figure out if it's this specific
patch yet but this series is breaking BeagleBone Black in my CI, none of
the sample rates covered by pcm-test are supported:

  https://lava.sirena.org.uk/scheduler/job/195516#L1430

some should be skipped due to being unsupported but we should see 48kHz
playback covered:

  https://lava.sirena.org.uk/scheduler/job/195338#L1433
Mark Brown March 20, 2023, 8:56 p.m. UTC | #2
On Wed, Mar 15, 2023 at 06:42:44AM +0000, Kuninori Morimoto wrote:
> dai_link->platform is no longer needed if CPU and Platform are
> same Component. This patch removes unnecessary dai_link->platform.
> 
> Simple-Card (Normal) is supporting platform, but
> Simple-Cadd (DPCM), Audio-Graph-Card/Card2 (Normal/DPCM) are not
> for now.

A bisect tells me that this patch rather than the TI one is responsible
for the issues I'm seeing on BeagleBone Black.
Kuninori Morimoto March 22, 2023, 12:13 a.m. UTC | #3
Hi Mark

Thank you for your test

> > dai_link->platform is no longer needed if CPU and Platform are
> > same Component. This patch removes unnecessary dai_link->platform.
> > 
> > Simple-Card (Normal) is supporting platform, but
> > Simple-Cadd (DPCM), Audio-Graph-Card/Card2 (Normal/DPCM) are not
> > for now.
> 
> A bisect tells me that this patch rather than the TI one is responsible
> for the issues I'm seeing on BeagleBone Black.

I see. I don't have BeagleBone thus this is my guess.
I think BeagleBone is using soc-generic-dmaengine-pcm.c.
This means, CPU and Platform are different Component,
but are using same dev (= component->dev).

In this case, this patch assumes BeagleBone need to have "plat = <&xxx>"
on DT (but it doesn't).
And Simple Card have been covered it automatically (It assumes Platform == CPU
if no Platform was selected).

Hmm... I recalled similar things happen before.
OK, please drop this patch. We want to keep existing DT as-is.

But instead, I want to post other patch which add comment to Simple-Card that
indicates Simple-Card is caring soc-generic-dmaengine-pcm automatically.
Otherwise I will forget it again, and will repost same/similar patch again :)

Thank you for your help !!

Best regards
---
Kuninori Morimoto
Mark Brown March 28, 2023, 2:51 p.m. UTC | #4
On Wed, 15 Mar 2023 06:40:39 +0000, Kuninori Morimoto wrote:
> Current ASoC will ignore already connected component when binding Card.
> This will happen mainly "CPU Component" is handled as "Platform Component",
> which was needed before.
> 
> 	static int snd_soc_rtd_add_component(...)
> 	{
> 		...
> 		for_each_rtd_components(rtd, i, comp) {
> 			/* already connected */
> 			if (comp == component)
> 				return 0;
> 		}
> 		...
> 	}
> 
> [...]

Applied to

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

Thanks!

[1/6] ASoC: fsl: remove unnecessary dai_link->platform
      commit: 33683cbf49b5412061cb1e4c876063fdef86def4
[2/6] ASoC: atmel: remove unnecessary dai_link->platform
      commit: 2f650f87c03cab72e751fc739f42a1e257bdc6b9
[3/6] ASoC: ti: remove unnecessary dai_link->platform
      commit: 3b0db249cf8fe0027e2a4161d27a8566d82fcd80
[4/6] ASoC: soc-topology.c: remove unnecessary dai_link->platform
      commit: e7098ba9b3785d626326040d300f95fec79aa765
[5/6] ASoC: simple-card-utils.c: remove unnecessary dai_link->platform
      (no commit info)
[6/6] ASoC: simple-card.c: add missing of_node_put()
      commit: 92405802a7d6aa1953915af869192296d1792d18

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