linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] ASoC: meson: aiu: fix duplicate debugfs directory error
@ 2022-03-09 20:20 Heiner Kallweit
  2022-03-09 20:21 ` [PATCH v2 1/2] ASoC: soc-core: add debugfs_prefix member to snd_soc_component_driver Heiner Kallweit
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Heiner Kallweit @ 2022-03-09 20:20 UTC (permalink / raw)
  To: Jerome Brunet, Liam Girdwood, Mark Brown, Jaroslav Kysela,
	Takashi Iwai, Neil Armstrong, Kevin Hilman, Martin Blumenstingl
  Cc: alsa-devel, linux-arm-kernel, open list:ARM/Amlogic Meson...

On a S905W-based system I get the following error:
debugfs: Directory 'c1105400.audio-controller' with parent 'P230-Q200' already present!

Turned out that multiple components having the same name triggers this
error in soc_init_component_debugfs(). The proposed solution allows
other drivers to adopt the same approach with minimal effort.
With the patch the error is gone and that's the debugfs entries.

/sys/kernel/debug/asoc/P230-Q200/acodec:c1105400.audio-controller
/sys/kernel/debug/asoc/P230-Q200/hdmi:c1105400.audio-controller
/sys/kernel/debug/asoc/P230-Q200/cpu:c1105400.audio-controller

v2:
- Reworked approach based on [0]

[0] https://www.spinics.net/lists/arm-kernel/msg960881.html

Heiner Kallweit (2):
  ASoC: soc-core: add debugfs_prefix member to snd_soc_component_driver
  ASoC: meson: aiu: fix duplicate debugfs directory error

 include/sound/soc-component.h     | 4 ++++
 sound/soc/meson/aiu-acodec-ctrl.c | 3 +++
 sound/soc/meson/aiu-codec-ctrl.c  | 3 +++
 sound/soc/meson/aiu.c             | 3 +++
 sound/soc/soc-core.c              | 5 +++++
 5 files changed, 18 insertions(+)

-- 
2.35.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v2 1/2] ASoC: soc-core: add debugfs_prefix member to snd_soc_component_driver
  2022-03-09 20:20 [PATCH v2 0/2] ASoC: meson: aiu: fix duplicate debugfs directory error Heiner Kallweit
@ 2022-03-09 20:21 ` Heiner Kallweit
  2022-03-09 20:23 ` [PATCH v2 2/2] ASoC: meson: aiu: fix duplicate debugfs directory error Heiner Kallweit
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Heiner Kallweit @ 2022-03-09 20:21 UTC (permalink / raw)
  To: Jerome Brunet, Liam Girdwood, Mark Brown, Jaroslav Kysela,
	Takashi Iwai, Neil Armstrong, Kevin Hilman, Martin Blumenstingl
  Cc: alsa-devel, linux-arm-kernel, open list:ARM/Amlogic Meson...

Allow the component debugfs_prefix to be set from
snd_soc_component_driver. First use case is avoiding a duplicate
debugfs entry error in case a device has multiple components
which have the same name therefore.

Note that we don't set component->debugfs_prefix if it's set already.
That's needed because partially component->debugfs_prefix is set
before calling snd_soc_component_initialize().

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
 include/sound/soc-component.h | 4 ++++
 sound/soc/soc-core.c          | 5 +++++
 2 files changed, 9 insertions(+)

diff --git a/include/sound/soc-component.h b/include/sound/soc-component.h
index a52080407..766dc6f00 100644
--- a/include/sound/soc-component.h
+++ b/include/sound/soc-component.h
@@ -179,6 +179,10 @@ struct snd_soc_component_driver {
 				  struct snd_pcm_hw_params *params);
 	bool use_dai_pcm_id;	/* use DAI link PCM ID as PCM device number */
 	int be_pcm_base;	/* base device ID for all BE PCMs */
+
+#ifdef CONFIG_DEBUG_FS
+	const char *debugfs_prefix;
+#endif
 };
 
 struct snd_soc_component {
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index a088bc9f7..11cb15319 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -2586,6 +2586,11 @@ int snd_soc_component_initialize(struct snd_soc_component *component,
 	component->dev		= dev;
 	component->driver	= driver;
 
+#ifdef CONFIG_DEBUG_FS
+	if (!component->debugfs_prefix)
+		component->debugfs_prefix = driver->debugfs_prefix;
+#endif
+
 	return 0;
 }
 EXPORT_SYMBOL_GPL(snd_soc_component_initialize);
-- 
2.35.1



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v2 2/2] ASoC: meson: aiu: fix duplicate debugfs directory error
  2022-03-09 20:20 [PATCH v2 0/2] ASoC: meson: aiu: fix duplicate debugfs directory error Heiner Kallweit
  2022-03-09 20:21 ` [PATCH v2 1/2] ASoC: soc-core: add debugfs_prefix member to snd_soc_component_driver Heiner Kallweit
@ 2022-03-09 20:23 ` Heiner Kallweit
  2022-03-31  5:56 ` [PATCH v2 0/2] " Heiner Kallweit
  2022-04-06 13:28 ` Mark Brown
  3 siblings, 0 replies; 6+ messages in thread
From: Heiner Kallweit @ 2022-03-09 20:23 UTC (permalink / raw)
  To: Jerome Brunet, Liam Girdwood, Mark Brown, Jaroslav Kysela,
	Takashi Iwai, Neil Armstrong, Kevin Hilman, Martin Blumenstingl
  Cc: alsa-devel, linux-arm-kernel, open list:ARM/Amlogic Meson...

On a S905W-based system I get the following error:
debugfs: Directory 'c1105400.audio-controller' with parent 'P230-Q200' already present!

Turned out that multiple components having the same name triggers this
error in soc_init_component_debugfs(). With the patch the error is gone
and that's the debugfs entries.

/sys/kernel/debug/asoc/P230-Q200/acodec:c1105400.audio-controller
/sys/kernel/debug/asoc/P230-Q200/hdmi:c1105400.audio-controller
/sys/kernel/debug/asoc/P230-Q200/cpu:c1105400.audio-controller

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
 sound/soc/meson/aiu-acodec-ctrl.c | 3 +++
 sound/soc/meson/aiu-codec-ctrl.c  | 3 +++
 sound/soc/meson/aiu.c             | 3 +++
 3 files changed, 9 insertions(+)

diff --git a/sound/soc/meson/aiu-acodec-ctrl.c b/sound/soc/meson/aiu-acodec-ctrl.c
index 27a6d3259..22e181646 100644
--- a/sound/soc/meson/aiu-acodec-ctrl.c
+++ b/sound/soc/meson/aiu-acodec-ctrl.c
@@ -193,6 +193,9 @@ static const struct snd_soc_component_driver aiu_acodec_ctrl_component = {
 	.of_xlate_dai_name	= aiu_acodec_of_xlate_dai_name,
 	.endianness		= 1,
 	.non_legacy_dai_naming	= 1,
+#ifdef CONFIG_DEBUG_FS
+	.debugfs_prefix		= "acodec",
+#endif
 };
 
 int aiu_acodec_ctrl_register_component(struct device *dev)
diff --git a/sound/soc/meson/aiu-codec-ctrl.c b/sound/soc/meson/aiu-codec-ctrl.c
index c3ea733fc..59ee66fc2 100644
--- a/sound/soc/meson/aiu-codec-ctrl.c
+++ b/sound/soc/meson/aiu-codec-ctrl.c
@@ -140,6 +140,9 @@ static const struct snd_soc_component_driver aiu_hdmi_ctrl_component = {
 	.of_xlate_dai_name	= aiu_hdmi_of_xlate_dai_name,
 	.endianness		= 1,
 	.non_legacy_dai_naming	= 1,
+#ifdef CONFIG_DEBUG_FS
+	.debugfs_prefix		= "hdmi",
+#endif
 };
 
 int aiu_hdmi_ctrl_register_component(struct device *dev)
diff --git a/sound/soc/meson/aiu.c b/sound/soc/meson/aiu.c
index d299a70db..88e611e64 100644
--- a/sound/soc/meson/aiu.c
+++ b/sound/soc/meson/aiu.c
@@ -103,6 +103,9 @@ static const struct snd_soc_component_driver aiu_cpu_component = {
 	.pointer		= aiu_fifo_pointer,
 	.probe			= aiu_cpu_component_probe,
 	.remove			= aiu_cpu_component_remove,
+#ifdef CONFIG_DEBUG_FS
+	.debugfs_prefix		= "cpu",
+#endif
 };
 
 static struct snd_soc_dai_driver aiu_cpu_dai_drv[] = {
-- 
2.35.1



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v2 0/2] ASoC: meson: aiu: fix duplicate debugfs directory error
  2022-03-09 20:20 [PATCH v2 0/2] ASoC: meson: aiu: fix duplicate debugfs directory error Heiner Kallweit
  2022-03-09 20:21 ` [PATCH v2 1/2] ASoC: soc-core: add debugfs_prefix member to snd_soc_component_driver Heiner Kallweit
  2022-03-09 20:23 ` [PATCH v2 2/2] ASoC: meson: aiu: fix duplicate debugfs directory error Heiner Kallweit
@ 2022-03-31  5:56 ` Heiner Kallweit
  2022-04-05 18:08   ` Mark Brown
  2022-04-06 13:28 ` Mark Brown
  3 siblings, 1 reply; 6+ messages in thread
From: Heiner Kallweit @ 2022-03-31  5:56 UTC (permalink / raw)
  To: Jerome Brunet, Liam Girdwood, Mark Brown, Jaroslav Kysela,
	Takashi Iwai, Neil Armstrong, Kevin Hilman, Martin Blumenstingl
  Cc: alsa-devel, linux-arm-kernel, open list:ARM/Amlogic Meson...

On 09.03.2022 21:20, Heiner Kallweit wrote:
> On a S905W-based system I get the following error:
> debugfs: Directory 'c1105400.audio-controller' with parent 'P230-Q200' already present!
> 
> Turned out that multiple components having the same name triggers this
> error in soc_init_component_debugfs(). The proposed solution allows
> other drivers to adopt the same approach with minimal effort.
> With the patch the error is gone and that's the debugfs entries.
> 
> /sys/kernel/debug/asoc/P230-Q200/acodec:c1105400.audio-controller
> /sys/kernel/debug/asoc/P230-Q200/hdmi:c1105400.audio-controller
> /sys/kernel/debug/asoc/P230-Q200/cpu:c1105400.audio-controller
> 
> v2:
> - Reworked approach based on [0]
> 
> [0] https://www.spinics.net/lists/arm-kernel/msg960881.html
> 
> Heiner Kallweit (2):
>   ASoC: soc-core: add debugfs_prefix member to snd_soc_component_driver
>   ASoC: meson: aiu: fix duplicate debugfs directory error
> 
>  include/sound/soc-component.h     | 4 ++++
>  sound/soc/meson/aiu-acodec-ctrl.c | 3 +++
>  sound/soc/meson/aiu-codec-ctrl.c  | 3 +++
>  sound/soc/meson/aiu.c             | 3 +++
>  sound/soc/soc-core.c              | 5 +++++
>  5 files changed, 18 insertions(+)
> 

Any feedback here?

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2 0/2] ASoC: meson: aiu: fix duplicate debugfs directory error
  2022-03-31  5:56 ` [PATCH v2 0/2] " Heiner Kallweit
@ 2022-04-05 18:08   ` Mark Brown
  0 siblings, 0 replies; 6+ messages in thread
From: Mark Brown @ 2022-04-05 18:08 UTC (permalink / raw)
  To: Heiner Kallweit
  Cc: Jerome Brunet, Liam Girdwood, Jaroslav Kysela, Takashi Iwai,
	Neil Armstrong, Kevin Hilman, Martin Blumenstingl, alsa-devel,
	linux-arm-kernel, open list:ARM/Amlogic Meson...


[-- Attachment #1.1: Type: text/plain, Size: 855 bytes --]

On Thu, Mar 31, 2022 at 07:56:03AM +0200, Heiner Kallweit wrote:

> Any feedback here?

Please don't send content free pings and please allow a reasonable time
for review.  People get busy, go on holiday, attend conferences and so 
on so unless there is some reason for urgency (like critical bug fixes)
please allow at least a couple of weeks for review.  If there have been
review comments then people may be waiting for those to be addressed.

Sending content free pings adds to the mail volume (if they are seen at
all) which is often the problem and since they can't be reviewed
directly if something has gone wrong you'll have to resend the patches
anyway, so sending again is generally a better approach though there are
some other maintainers who like them - if in doubt look at how patches
for the subsystem are normally handled.

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2 0/2] ASoC: meson: aiu: fix duplicate debugfs directory error
  2022-03-09 20:20 [PATCH v2 0/2] ASoC: meson: aiu: fix duplicate debugfs directory error Heiner Kallweit
                   ` (2 preceding siblings ...)
  2022-03-31  5:56 ` [PATCH v2 0/2] " Heiner Kallweit
@ 2022-04-06 13:28 ` Mark Brown
  3 siblings, 0 replies; 6+ messages in thread
From: Mark Brown @ 2022-04-06 13:28 UTC (permalink / raw)
  To: tiwai, narmstrong, khilman, perex, jbrunet, lgirdwood,
	hkallweit1, martin.blumenstingl
  Cc: linux-amlogic, linux-arm-kernel, alsa-devel

On Wed, 9 Mar 2022 21:20:01 +0100, Heiner Kallweit wrote:
> On a S905W-based system I get the following error:
> debugfs: Directory 'c1105400.audio-controller' with parent 'P230-Q200' already present!
> 
> Turned out that multiple components having the same name triggers this
> error in soc_init_component_debugfs(). The proposed solution allows
> other drivers to adopt the same approach with minimal effort.
> With the patch the error is gone and that's the debugfs entries.
> 
> [...]

Applied to

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

Thanks!

[1/2] ASoC: soc-core: add debugfs_prefix member to snd_soc_component_driver
      commit: d462f6ed2aeac30c0b440a91fb05d964956935f9
[2/2] ASoC: meson: aiu: fix duplicate debugfs directory error
      commit: 89bac792faf03fae5a9564bebfaacab53a029932

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

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-04-06 13:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-09 20:20 [PATCH v2 0/2] ASoC: meson: aiu: fix duplicate debugfs directory error Heiner Kallweit
2022-03-09 20:21 ` [PATCH v2 1/2] ASoC: soc-core: add debugfs_prefix member to snd_soc_component_driver Heiner Kallweit
2022-03-09 20:23 ` [PATCH v2 2/2] ASoC: meson: aiu: fix duplicate debugfs directory error Heiner Kallweit
2022-03-31  5:56 ` [PATCH v2 0/2] " Heiner Kallweit
2022-04-05 18:08   ` Mark Brown
2022-04-06 13:28 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).