ASoC: hdmi-codec: use RTD ID instead of DAI ID for ELD entry
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Mon, 7 Apr 2025 22:39:39 +0000 (22:39 +0000)
committerMark Brown <broonie@kernel.org>
Mon, 7 Apr 2025 23:53:50 +0000 (00:53 +0100)
commitd639e7fd9aa038f46728206bdb23cf7109b3b53b
treefceafad88c325cfaf815235e8d5c350a13d76bfb
parentf2f847461fb7620e299be873cdd9437ddecd2266
ASoC: hdmi-codec: use RTD ID instead of DAI ID for ELD entry

commit 0ecd24a6d8b2 ("ASoC: hdmi-codec: dump ELD through procfs") adds
"eld#%d" entry for sound proc. It is using DAI ID. But it is possible to
have duplicate DAI ID on same Sound Card. In such case, we will get below
error. To avoid duplicate entry name, use RTD ID instead of DAI ID.

proc_dir_entry 'card0/eld#0' already registered
WARNING: CPU: 3 PID: 74 at fs/proc/generic.c:377 proc_register+0x11c/0x1a4
Modules linked in:
CPU: 3 UID: 0 PID: 74 Comm: kworker/u33:5 Not tainted 6.14.0-rc1-next-20250206-arm64-renesas #174
Hardware name: Renesas Salvator-X 2nd version board based on r8a77951 (DT)
Workqueue: events_unbound deferred_probe_work_func
pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : proc_register+0x11c/0x1a4
ata1: SATA link down (SStatus 0 SControl 300)
lr : proc_register+0x11c/0x1a4
sp : ffff8000847db880
x29: ffff8000847db880 x28: 0000000000000000 x27: ffff0004c3403c98
x26: 0000000000000005 x25: ffff0004c14b03e4 x24: 0000000000000005
x23: ffff0004c361adb8 x22: ffff800082f24860 x21: ffff0004c361ad00
x20: ffff0004c14b0300 x19: ffff0004c14b02c0 x18: 00000000ffffffff
x17: 0000000000000000 x16: 00400034b5503510 x15: ffff8001047db447
x14: 0000000000000000 x13: 6465726574736967 x12: ffff800082e66d30
x11: 000000000000028e x10: ffff800082e66d30 x9 : 00000000ffffefff
x8 : ffff800082ebed30 x7 : 0000000000017fe8 x6 : 0000000000000000
x5 : 80000000fffff000 x4 : 0000000000000000 x3 : 0000000000000000
x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffff0004c15b3600
Call trace:
 proc_register+0x11c/0x1a4 (P)
 proc_create_data+0x3c/0x60
 snd_info_register+0xd0/0x130
 snd_info_register+0x30/0x130
 snd_info_card_register+0x1c/0xbc
 snd_card_register+0x194/0x1ec
 snd_soc_bind_card+0x7f8/0xad0
 snd_soc_register_card+0xe8/0xfc
 devm_snd_soc_register_card+0x48/0x98
 audio_graph_parse_of+0x1c4/0x1f8
 graph_probe+0x6c/0x80
...

Fixes: 0ecd24a6d8b2 ("ASoC: hdmi-codec: dump ELD through procfs")
Reported-by: Thuan Nguyen <thuan.nguyen-hong@banvien.com.vn>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Thuan Nguyen <thuan.nguyen-hong@banvien.com.vn>
Acked-by: Mark Brown <broonie@kernel.org>
Link: https://patch.msgid.link/87a58roatw.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/hdmi-codec.c