[alsa-devel] [PATCH resend 25/47] ASoC: samsung: snow: don't select unnecessary Platform

Marek Szyprowski m.szyprowski at samsung.com
Wed Jun 26 08:48:08 CEST 2019


Hi again,

On 2019-06-26 08:41, Marek Szyprowski wrote:
> Hi Kuninori,
>
> On 2019-06-26 03:15, Kuninori Morimoto wrote:
>> Hi Marek, again
>>
>>> Thank you for your test.
>>> And so sorry to bother you.
>>> I will fixup this issue.
>>>
>>>>>>> I have no idea so far, but one capability is that if your system
>>>>>>> used / based dummy platform, and if your CPU driver didn't use/have
>>>>>>> snd_soc_set_runtime_hwparams() / snd_pcm_lib_ioctl,
>>>>>>> it might be happen, but this patch seems not related to it...
>>>>>> Reverting this patch fixes the issue, so it is definitely related 
>>>>>> somehow.
>>>>> Ahh... OK now I think I could understand your issue.
>>>>> Your CPU is using devm_snd_dmaengine_pcm_register() with same *dev.
>>>>> In such case, indeed this patch breaks sound card.
>> I'm now negotiating to Mark to reverting issue patches.
>> But, as alternative idea, I think below patch can solve this issue.
>> Can you please test it ?
>>
>> ----------------------
>> diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
>> index 358f1fb..79b9cc4 100644
>> --- a/sound/soc/soc-core.c
>> +++ b/sound/soc/soc-core.c
>> @@ -931,9 +931,11 @@ static int soc_bind_dai_link(struct snd_soc_card 
>> *card,
>>       rtd->codec_dai = rtd->codec_dais[0];
>>         /* Find PLATFORM from registered PLATFORMs */
>> +    /* CPU driver might has both DAI and PLATFORM */
>>       for_each_component(component) {
>>           if (!snd_soc_is_matching_component(dai_link->platforms,
>> -                           component))
>> +                           component) &&
>> +            !snd_soc_is_matching_component(dai_link->cpus, component))
>>               continue;
>>             snd_soc_rtdcom_add(rtd, component);
>> ----------------------
>
> Yes, the above change fixes the issue on Samsung Snow, Peach-Pit and 
> Peach-Pi Chromebooks, but causes regression on the other boards, for 
> example here is the log from Odroid U3:
>
> max98090 1-0010: MAX98090 REVID=0x43
> max98090 1-0010: use default 2.8v micbias
> odroid-audio sound: snd-soc-dummy-dai <-> samsung-i2s mapping ok
> odroid-audio sound: multicodec <-> snd-soc-dummy-dai mapping ok
> ------------[ cut here ]------------
> WARNING: CPU: 3 PID: 88 at fs/proc/generic.c:361 proc_register+0xf8/0x12c
> proc_dir_entry 'sub0/prealloc' already registered
> Modules linked in:
> CPU: 3 PID: 88 Comm: kworker/3:1 Not tainted 
> 5.2.0-rc6-next-20190624-00004-g5611edb05c36-dirty #6233
> Hardware name: SAMSUNG EXYNOS (Flattened Device Tree)
> Workqueue: events deferred_probe_work_func
> [<c0112548>] (unwind_backtrace) from [<c010e004>] (show_stack+0x10/0x14)
> usb 1-3: new high-speed USB device number 3 using exynos-ehci
> [<c010e004>] (show_stack) from [<c0aa63bc>] (dump_stack+0x98/0xc4)
> [<c0aa63bc>] (dump_stack) from [<c01274d8>] (__warn+0x10c/0x124)
> [<c01274d8>] (__warn) from [<c0127534>] (warn_slowpath_fmt+0x44/0x68)
> [<c0127534>] (warn_slowpath_fmt) from [<c031f8b8>] 
> (proc_register+0xf8/0x12c)
> [<c031f8b8>] (proc_register) from [<c031fb88>] 
> (proc_create_data+0x38/0x44)
> [<c031fb88>] (proc_create_data) from [<c07a88a4>] 
> (snd_info_register+0xe4/0x13c)
> [<c07a88a4>] (snd_info_register) from [<c07a8804>] 
> (snd_info_register+0x44/0x13c)
> irq event stamp: 12923
> hardirqs last  enabled at (12941): [<c01976a8>] 
> console_unlock+0x4b8/0x6a8
> hardirqs last disabled at (12958): [<c01972bc>] console_unlock+0xcc/0x6a8
> softirqs last  enabled at (12956): [<c01026d8>] __do_softirq+0x4f0/0x5e0
> softirqs last disabled at (12977): [<c012f6f8>] irq_exit+0x160/0x16c
> ---[ end trace 9e0864d90e2e08ab ]---
> odroid-audio sound: ASoC: failed to register soundcard -12
> odroid-audio sound: snd_soc_register_card() failed: -12
> odroid-audio: probe of sound failed with error -12
>
> here is the component list reported by your previous patch for that 
> board:
>
> [    3.012781] -----3830000.i2s : samsung-i2s
> [    3.015736] -----snd-soc-dummy : (null)
> [    3.019588] -----3830000.i2s : snd_dmaengine_pcm
> [    3.024122] -----snd-soc-dummy : (null)
> [    3.027991] -----hdmi-audio-codec.0.auto : (null)
> [    3.032620] -----max98090.1-0010 : (null)
> [    3.078865] max98090 1-0010: MAX98090 REVID=0x43
> [    3.085038] max98090 1-0010: use default 2.8v micbias
> [    3.113438] odroid-audio sound: snd-soc-dummy-dai <-> samsung-i2s 
> mapping ok
> [    3.123849] odroid-audio sound: multicodec <-> snd-soc-dummy-dai 
> mapping ok
> [    3.263208] ALSA device list:
> [    3.264234]   #0: Odroid-U3


Just one more thing. Here is the component list with the above patch 
applied:

[    2.970127] -----3830000.i2s : samsung-i2s
[    2.973029] -----snd-soc-dummy : (null)
[    2.976851] -----hdmi-audio-codec.0.auto : (null)
[    2.981476] -----3830000.i2s-sec : snd_dmaengine_pcm
[    2.986459] -----3830000.i2s : snd_dmaengine_pcm
[    2.991022] -----max98090.1-0010 : (null)
[    2.995065] -----snd-soc-dummy : (null)
[    2.998866] -----hdmi-audio-codec.0.auto : (null)
[    3.003523] -----max98090.1-0010 : (null)
[    3.047448] max98090 1-0010: MAX98090 REVID=0x43
[    3.052177] max98090 1-0010: use default 2.8v micbias
[    3.085090] odroid-audio sound: snd-soc-dummy-dai <-> samsung-i2s 
mapping ok
[    3.089691] odroid-audio sound: multicodec <-> snd-soc-dummy-dai 
mapping ok
[    3.099545] ------------[ cut here ]------------
[    3.099799] WARNING: CPU: 2 PID: 33 at fs/proc/generic.c:361 
proc_register+0xe4/0x118
[    3.106497] proc_dir_entry 'sub0/prealloc' already registered
[    3.112118] Modules linked in:
[    3.115162] CPU: 2 PID: 33 Comm: kworker/2:1 Not tainted 
5.2.0-rc6-next-20190624-00004-g5611edb05c36-dirty #6238
[    3.125310] Hardware name: SAMSUNG EXYNOS (Flattened Device Tree)
[    3.131399] Workqueue: events deferred_probe_work_func
[    3.136533] [<c0112530>] (unwind_backtrace) from [<c010e070>] 
(show_stack+0x10/0x14)
[    3.144249] [<c010e070>] (show_stack) from [<c0aa2a2c>] 
(dump_stack+0xa8/0xd4)
[    3.151447] [<c0aa2a2c>] (dump_stack) from [<c01271f4>] 
(__warn+0x10c/0x124)
[    3.158472] [<c01271f4>] (__warn) from [<c0127250>] 
(warn_slowpath_fmt+0x44/0x68)
[    3.165937] [<c0127250>] (warn_slowpath_fmt) from [<c031cf5c>] 
(proc_register+0xe4/0x118)
[    3.174094] [<c031cf5c>] (proc_register) from [<c031d23c>] 
(proc_create_data+0x38/0x4c)
[    3.182095] [<c031d23c>] (proc_create_data) from [<c07a3bb0>] 
(snd_info_register+0xe4/0x13c)
[    3.190500] [<c07a3bb0>] (snd_info_register) from [<c07a3b10>] 
(snd_info_register+0x44/0x13c)
[    3.199072] irq event stamp: 12863
[    3.202401] hardirqs last  enabled at (12871): [<c0196d60>] 
console_unlock+0x464/0x6d0
[    3.210328] hardirqs last disabled at (12888): [<c01969a4>] 
console_unlock+0xa8/0x6d0
[    3.218140] softirqs last  enabled at (12904): [<c01026fc>] 
__do_softirq+0x4fc/0x5f8
[    3.225834] softirqs last disabled at (12897): [<c012f52c>] 
irq_exit+0x160/0x16c
[    3.233242] ---[ end trace 09e9050a97457376 ]---
[    3.237863] odroid-audio sound: ASoC: failed to register soundcard -12
[    3.253458] odroid-audio sound: snd_soc_register_card() failed: -12
[    3.254216] odroid-audio: probe of sound failed with error -12

Best regards
-- 
Marek Szyprowski, PhD
Samsung R&D Institute Poland



More information about the Alsa-devel mailing list