Re: [alsa-devel] [PATCH v2] ASoC: soc-core: defer card probe until all component is added to list

From: Pierre-Louis Bossart
Date: Fri Jan 11 2019 - 00:11:12 EST


While debugging Skylake audio stuff, I came across a kernel oops introduced by this commit.

It's quite late here and my brain is fried, submitting as is but my money is on the use of link->platform->of_node which is quite unlikely to work on ACPI platforms.

and btw you may want to fix the typos, it's registration, not registartion.

-Pierre

8780cf1142a59568a3aa77959cbd76b2edb6fd81 is the first bad commit
commit 8780cf1142a59568a3aa77959cbd76b2edb6fd81
Author: Ajit Pandey <ajitp@xxxxxxxxxxxxxx>
Date:ÂÂ Wed Jan 9 14:17:07 2019 +0530

ÂÂÂ ASoC: soc-core: defer card probe until all component is added to list

ÂÂÂ DAI component probe is not called if it is not present
ÂÂÂ in component list during sound card registration.
ÂÂÂ Check if component is available in component list for
ÂÂÂ platform and cpu dai before soundcard registration.

ÂÂÂ Signed-off-by: Ajit Pandey <ajitp@xxxxxxxxxxxxxx>
ÂÂÂ Signed-off-by: Rohit kumar <rohitkr@xxxxxxxxxxxxxx>
ÂÂÂ Signed-off-by: Mark Brown <broonie@xxxxxxxxxx>

:040000 040000 98da59b0a73551030a0c9030b8cd58114003c82b 48f0618f37a16dcfea5999ecd9743edbb0763594 MÂÂÂ sound

[ÂÂÂ 2.686029] HDMI HDA Codec ehdaudio0D2: Max dais supported: 3
[ÂÂÂ 2.687854] BUG: unable to handle kernel NULL pointer dereference at 0000000000000000
[ÂÂÂ 2.687858] PGD 0 P4D 0
[ÂÂÂ 2.687862] Oops: 0000 [#1] SMP PTI
[ÂÂÂ 2.687866] CPU: 1 PID: 1647 Comm: systemd-udevd Not tainted 4.20.0-rc7-test+ #88
[ÂÂÂ 2.687867] Hardware name: Dell Inc. XPS 13 9350/07TYC2, BIOS 1.0.0 09/10/2015
[ÂÂÂ 2.687872] RIP: 0010:strcmp+0xc/0x20
[ÂÂÂ 2.687875] Code: 75 f7 48 83 c6 01 0f b6 4e ff 48 83 c2 01 84 c9 88 4a ff 75 ed f3 c3 0f 1f 80 00 00 00 00 48 83 c7 01 0f b6 47 ff 48 83 c6 01 <3a> 46 ff 75 07 84 c0 75 eb 31 c0 c3 19 c0 83 c8 01 c3 66 90 48 85
[ÂÂÂ 2.687877] RSP: 0018:ffff9fadc104bb18 EFLAGS: 00010202
[ÂÂÂ 2.687880] RAX: 0000000000000065 RBX: ffff9d6834ba5428 RCX: 0000000000000001
[ÂÂÂ 2.687882] RDX: ffffffffc0288d00 RSI: 0000000000000001 RDI: ffff9d68351b5a61
[ÂÂÂ 2.687883] RBP: 0000000000000000 R08: 0000000000000001 R09: ffff9d6836dbfd80
[ÂÂÂ 2.687885] R10: 0000000000000000 R11: ffff9d6835e65648 R12: 0000000000000000
[ÂÂÂ 2.687887] R13: 0000000000000000 R14: 0000000000000000 R15: ffff9fadc104be98
[ÂÂÂ 2.687889] FS:Â 00007f976806a8c0(0000) GS:ffff9d6838a80000(0000) knlGS:0000000000000000
[ÂÂÂ 2.687891] CS:Â 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ÂÂÂ 2.687893] CR2: 0000000000000000 CR3: 00000002b4286002 CR4: 00000000003606e0
[ÂÂÂ 2.687895] Call Trace:
[ÂÂÂ 2.687902]Â soc_find_component+0x4c/0x70 [snd_soc_core]
[ÂÂÂ 2.687908]Â soc_init_dai_link+0x124/0x280 [snd_soc_core]
[ÂÂÂ 2.687913]Â snd_soc_register_card+0x6b/0x1f0 [snd_soc_core]
[ÂÂÂ 2.687918]Â ? __devres_alloc_node+0x2c/0x60
[ÂÂÂ 2.687922]Â devm_snd_soc_register_card+0x3e/0x80 [snd_soc_core]
[ÂÂÂ 2.687926]Â platform_drv_probe+0x35/0x90
[ÂÂÂ 2.687930]Â ? driver_sysfs_add+0x70/0xd0
[ÂÂÂ 2.687932]Â really_probe+0xee/0x2e0
[ÂÂÂ 2.687935]Â driver_probe_device+0x4a/0xe0
[ÂÂÂ 2.687938]Â __driver_attach+0xac/0xb0
[ÂÂÂ 2.687941]Â ? driver_probe_device+0xe0/0xe0
[ÂÂÂ 2.687943]Â bus_for_each_dev+0x71/0xb0
[ÂÂÂ 2.687946]Â bus_add_driver+0x191/0x210
[ÂÂÂ 2.687948]Â ? 0xffffffffc01bf000
[ÂÂÂ 2.687951]Â driver_register+0x56/0xe0
[ÂÂÂ 2.687953]Â ? 0xffffffffc01bf000
[ÂÂÂ 2.687956]Â do_one_initcall+0x41/0x1b8
[ÂÂÂ 2.687960]Â ? kobject_uevent_env+0x101/0x680
[ÂÂÂ 2.687962]Â ? _cond_resched+0x10/0x40
[ÂÂÂ 2.687966]Â ? kmem_cache_alloc_trace+0x35/0x160
[ÂÂÂ 2.687969]Â do_init_module+0x56/0x1db
[ÂÂÂ 2.687973]Â load_module+0x1e7c/0x2560
[ÂÂÂ 2.687976]Â ? vfs_read+0x10a/0x130
[ÂÂÂ 2.687979]Â ? __do_sys_finit_module+0xba/0xe0
[ÂÂÂ 2.687983]Â __do_sys_finit_module+0xba/0xe0
[ÂÂÂ 2.687988]Â do_syscall_64+0x43/0xf0
[ÂÂÂ 2.687992]Â entry_SYSCALL_64_after_hwframe+0x44/0xa9
[ÂÂÂ 2.687995] RIP: 0033:0x7f9768aef219
[ÂÂÂ 2.687998] Code: 00 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 47 fc 0c 00 f7 d8 64 89 01 48
[ÂÂÂ 2.688000] RSP: 002b:00007ffccf3a4c98 EFLAGS: 00000246 ORIG_RAX: 0000000000000139
[ÂÂÂ 2.688003] RAX: ffffffffffffffda RBX: 000055991cf57970 RCX: 00007f9768aef219
[ÂÂÂ 2.688006] RDX: 0000000000000000 RSI: 00007f97689d3cad RDI: 000000000000000f
[ÂÂÂ 2.688008] RBP: 00007f97689d3cad R08: 0000000000000000 R09: 0000000000000000
[ÂÂÂ 2.688010] R10: 000000000000000f R11: 0000000000000246 R12: 0000000000000000
[ÂÂÂ 2.688012] R13: 000055991cf49930 R14: 0000000000020000 R15: 000055991cf57970
[ÂÂÂ 2.688015] Modules linked in: snd_soc_skl_hda_dsp(+) snd_soc_hdac_hdmi snd_soc_dmic ax88179_178a(+) usbnet snd_hda_codec_realtek snd_hda_codec_generic snd_soc_skl snd_soc_hdac_hda snd_hda_ext_core snd_soc_skl_ipc x86_pkg_temp_thermal snd_soc_sst_ipc snd_soc_sst_dsp snd_soc_acpi_intel_match snd_soc_acpi snd_soc_core snd_compress snd_hda_codec snd_hwdep snd_hda_core snd_pcm efivarfs intel_lpss_pci xhci_pci intel_lpss mfd_core xhci_hcd
[ÂÂÂ 2.688031] CR2: 0000000000000000
[ÂÂÂ 2.688034] ---[ end trace 8b96d01935d9effd ]---
[ÂÂÂ 2.688037] RIP: 0010:strcmp+0xc/0x20
[ÂÂÂ 2.688039] Code: 75 f7 48 83 c6 01 0f b6 4e ff 48 83 c2 01 84 c9 88 4a ff 75 ed f3 c3 0f 1f 80 00 00 00 00 48 83 c7 01 0f b6 47 ff 48 83 c6 01 <3a> 46 ff 75 07 84 c0 75 eb 31 c0 c3 19 c0 83 c8 01 c3 66 90 48 85
[ÂÂÂ 2.688042] RSP: 0018:ffff9fadc104bb18 EFLAGS: 00010202
[ÂÂÂ 2.688044] RAX: 0000000000000065 RBX: ffff9d6834ba5428 RCX: 0000000000000001
[ÂÂÂ 2.688046] RDX: ffffffffc0288d00 RSI: 0000000000000001 RDI: ffff9d68351b5a61
[ÂÂÂ 2.688048] RBP: 0000000000000000 R08: 0000000000000001 R09: ffff9d6836dbfd80
[ÂÂÂ 2.688050] R10: 0000000000000000 R11: ffff9d6835e65648 R12: 0000000000000000
[ÂÂÂ 2.688052] R13: 0000000000000000 R14: 0000000000000000 R15: ffff9fadc104be98
[ÂÂÂ 2.688055] FS:Â 00007f976806a8c0(0000) GS:ffff9d6838a80000(0000) knlGS:0000000000000000
[ÂÂÂ 2.688057] CS:Â 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ÂÂÂ 2.688059] CR2: 0000000000000000 CR3: 00000002b4286002 CR4: 00000000003606e0