I did a quick test of your patches on my Tegra board and seeing issues with multiple streams. For instance, I ran it for a 2x1 mixer configuration and hitting below:
[ 277.661886] BUG: scheduling while atomic: aplay/1306/0x00000100 [ 287.713193] BUG: spinlock cpu recursion on CPU#0, aplay/1307 [ 287.719138] lock: 0xffff00008cc820f0, .magic: dead4ead, .owner: aplay/1306, .owner_cpu: 0 [ 287.727319] CPU: 0 PID: 1307 Comm: aplay Tainted: G W 5.15.0-rc3-next-20210927-00026-gffdabce987b1 #12 [ 287.737783] Hardware name: NVIDIA Jetson AGX Xavier Developer Kit (DT) [ 287.744228] Call trace: [ 287.746656] dump_backtrace+0x0/0x1c0 [ 287.750300] show_stack+0x18/0x28 [ 287.753604] dump_stack_lvl+0x7c/0xa8 [ 287.757236] dump_stack+0x18/0x34 [ 287.760536] spin_dump+0x70/0x90 [ 287.763732] do_raw_spin_lock+0xd8/0x120 [ 287.767615] _raw_spin_lock_irq+0x60/0x80 [ 287.771581] snd_pcm_stream_lock_irq+0x20/0x48 [snd_pcm] [ 287.776853] snd_pcm_drain+0x1ec/0x348 [snd_pcm] [ 287.781421] snd_pcm_common_ioctl+0xacc/0x1938 [snd_pcm] [ 287.786685] snd_pcm_ioctl+0x2c/0x48 [snd_pcm] [ 287.791101] __arm64_sys_ioctl+0xb0/0xf0 [ 287.794982] invoke_syscall+0x44/0x108 [ 287.798683] el0_svc_common.constprop.3+0x74/0x100 [ 287.803416] do_el0_svc+0x24/0x90 [ 287.806687] el0_svc+0x20/0x60 [ 287.809705] el0t_64_sync_handler+0x94/0xb8 [ 287.813839] el0t_64_sync+0x180/0x184
And in some case just below:
[ 1074.212276] BUG: scheduling while atomic: aplay/12327/0x00000100 [ 1095.227509] rcu: INFO: rcu_sched detected stalls on CPUs/tasks: [ 1095.233443] rcu: 0-...0: (1 GPs behind) idle=4af/1/0x4000000000000004 softirq=19902/19902 fqs=2626 [ 1095.242528] rcu: 2-...0: (1 GPs behind) idle=9d5/1/0x4000000000000000 softirq=22707/22707 fqs=262
Thanks Sameer for the overnight tests, much appreciated.
My patches don't change anything related to a spinlock or pcm stream management, so not sure what could cause this rather spectacular failure. That hints at a fundamental configuration difference, possibly caused by your component chaining?
Since in your case you have a 1:1 mapping between FE and BE, would you mind testing by backtracking, one patch at a time to see which one of the three last patches could cause a problem on your board?
Thanks again for your time! -Pierre