Revision 011a8719d6105dcb48077ea7a6a88ac019d4aa50 authored by Maxim Kochetkov on 12 May 2023, 11:03:42 UTC, committed by Mark Brown on 23 May 2023, 20:39:30 UTC
When using DMA mode we are facing with Oops:
[  396.458157] Unable to handle kernel access to user memory without uaccess routines at virtual address 000000000000000c
[  396.469374] Oops [#1]
[  396.471839] Modules linked in:
[  396.475144] CPU: 0 PID: 114 Comm: arecord Not tainted 6.0.0-00164-g9a8eccdaf2be-dirty #68
[  396.483619] Hardware name: YMP ELCT FPGA (DT)
[  396.488156] epc : dmaengine_pcm_open+0x1d2/0x342
[  396.493227]  ra : dmaengine_pcm_open+0x1d2/0x342
[  396.498140] epc : ffffffff807fe346 ra : ffffffff807fe346 sp : ffffffc804e138f0
[  396.505602]  gp : ffffffff817bf730 tp : ffffffd8042c8ac0 t0 : 6500000000000000
[  396.513045]  t1 : 0000000000000064 t2 : 656e69676e65616d s0 : ffffffc804e13990
[  396.520477]  s1 : ffffffd801b86a18 a0 : 0000000000000026 a1 : ffffffff816920f8
[  396.527897]  a2 : 0000000000000010 a3 : fffffffffffffffe a4 : 0000000000000000
[  396.535319]  a5 : 0000000000000000 a6 : ffffffd801b87040 a7 : 0000000000000038
[  396.542740]  s2 : ffffffd801b94a00 s3 : 0000000000000000 s4 : ffffffd80427f5e8
[  396.550153]  s5 : ffffffd80427f5e8 s6 : ffffffd801b44410 s7 : fffffffffffffff5
[  396.557569]  s8 : 0000000000000800 s9 : 0000000000000001 s10: ffffffff8066d254
[  396.564978]  s11: ffffffd8059cf768 t3 : ffffffff817d5577 t4 : ffffffff817d5577
[  396.572391]  t5 : ffffffff817d5578 t6 : ffffffc804e136e8
[  396.577876] status: 0000000200000120 badaddr: 000000000000000c cause: 000000000000000d
[  396.586007] [<ffffffff806839f4>] snd_soc_component_open+0x1a/0x68
[  396.592439] [<ffffffff807fdd62>] __soc_pcm_open+0xf0/0x502
[  396.598217] [<ffffffff80685d86>] soc_pcm_open+0x2e/0x4e
[  396.603741] [<ffffffff8066cea4>] snd_pcm_open_substream+0x442/0x68e
[  396.610313] [<ffffffff8066d1ea>] snd_pcm_open+0xfa/0x212
[  396.615868] [<ffffffff8066d39c>] snd_pcm_capture_open+0x3a/0x60
[  396.622048] [<ffffffff8065b35a>] snd_open+0xa8/0x17a
[  396.627421] [<ffffffff801ae036>] chrdev_open+0xa0/0x218
[  396.632893] [<ffffffff801a5a28>] do_dentry_open+0x17c/0x2a6
[  396.638713] [<ffffffff801a6d9a>] vfs_open+0x1e/0x26
[  396.643850] [<ffffffff801b8544>] path_openat+0x96e/0xc96
[  396.649518] [<ffffffff801b9390>] do_filp_open+0x7c/0xf6
[  396.655034] [<ffffffff801a6ff2>] do_sys_openat2+0x8a/0x11e
[  396.660765] [<ffffffff801a735a>] sys_openat+0x50/0x7c
[  396.666068] [<ffffffff80003aca>] ret_from_syscall+0x0/0x2
[  396.674964] ---[ end trace 0000000000000000 ]---

It happens because of play_dma_data/capture_dma_data pointers are NULL.
Current implementation assigns these pointers at snd_soc_dai_driver
startup() callback and reset them back to NULL at shutdown(). But
soc_pcm_open() sequence uses DMA pointers in dmaengine_pcm_open()
before snd_soc_dai_driver startup().
Most generic DMA capable I2S drivers use snd_soc_dai_driver probe()
callback to init DMA pointers only once at probe. So move DMA init
to dw_i2s_dai_probe and drop shutdown() and startup() callbacks.

Signed-off-by: Maxim Kochetkov <fido_max@inbox.ru>
Link: https://lore.kernel.org/r/20230512110343.66664-1-fido_max@inbox.ru
Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent e2d035f
History
File Mode Size
partitions
Kconfig -rw-r--r-- 6.8 KB
Kconfig.iosched -rw-r--r-- 1.4 KB
Makefile -rw-r--r-- 1.7 KB
badblocks.c -rw-r--r-- 14.1 KB
bdev.c -rw-r--r-- 25.7 KB
bfq-cgroup.c -rw-r--r-- 40.0 KB
bfq-iosched.c -rw-r--r-- 264.2 KB
bfq-iosched.h -rw-r--r-- 40.5 KB
bfq-wf2q.c -rw-r--r-- 52.4 KB
bio-integrity.c -rw-r--r-- 12.3 KB
bio.c -rw-r--r-- 48.9 KB
blk-cgroup-fc-appid.c -rw-r--r-- 1.4 KB
blk-cgroup-rwstat.c -rw-r--r-- 3.4 KB
blk-cgroup-rwstat.h -rw-r--r-- 3.9 KB
blk-cgroup.c -rw-r--r-- 55.1 KB
blk-cgroup.h -rw-r--r-- 15.3 KB
blk-core.c -rw-r--r-- 33.1 KB
blk-crypto-fallback.c -rw-r--r-- 18.7 KB
blk-crypto-internal.h -rw-r--r-- 6.1 KB
blk-crypto-profile.c -rw-r--r-- 16.1 KB
blk-crypto-sysfs.c -rw-r--r-- 4.5 KB
blk-crypto.c -rw-r--r-- 12.7 KB
blk-flush.c -rw-r--r-- 15.5 KB
blk-ia-ranges.c -rw-r--r-- 8.5 KB
blk-integrity.c -rw-r--r-- 10.4 KB
blk-ioc.c -rw-r--r-- 10.5 KB
blk-iocost.c -rw-r--r-- 97.8 KB
blk-iolatency.c -rw-r--r-- 29.6 KB
blk-ioprio.c -rw-r--r-- 5.5 KB
blk-ioprio.h -rw-r--r-- 540 bytes
blk-lib.c -rw-r--r-- 9.0 KB
blk-map.c -rw-r--r-- 18.0 KB
blk-merge.c -rw-r--r-- 31.4 KB
blk-mq-cpumap.c -rw-r--r-- 1.3 KB
blk-mq-debugfs-zoned.c -rw-r--r-- 453 bytes
blk-mq-debugfs.c -rw-r--r-- 20.9 KB
blk-mq-debugfs.h -rw-r--r-- 2.4 KB
blk-mq-pci.c -rw-r--r-- 1.2 KB
blk-mq-sched.c -rw-r--r-- 13.9 KB
blk-mq-sched.h -rw-r--r-- 2.3 KB
blk-mq-sysfs.c -rw-r--r-- 6.4 KB
blk-mq-tag.c -rw-r--r-- 18.2 KB
blk-mq-virtio.c -rw-r--r-- 1.3 KB
blk-mq.c -rw-r--r-- 120.1 KB
blk-mq.h -rw-r--r-- 12.9 KB
blk-pm.c -rw-r--r-- 6.6 KB
blk-pm.h -rw-r--r-- 763 bytes
blk-rq-qos.c -rw-r--r-- 8.3 KB
blk-rq-qos.h -rw-r--r-- 4.6 KB
blk-settings.c -rw-r--r-- 30.4 KB
blk-stat.c -rw-r--r-- 5.2 KB
blk-stat.h -rw-r--r-- 4.8 KB
blk-sysfs.c -rw-r--r-- 22.9 KB
blk-throttle.c -rw-r--r-- 66.9 KB
blk-throttle.h -rw-r--r-- 6.4 KB
blk-timeout.c -rw-r--r-- 4.1 KB
blk-wbt.c -rw-r--r-- 22.2 KB
blk-wbt.h -rw-r--r-- 1.1 KB
blk-zoned.c -rw-r--r-- 16.4 KB
blk.h -rw-r--r-- 14.4 KB
bounce.c -rw-r--r-- 6.8 KB
bsg-lib.c -rw-r--r-- 9.8 KB
bsg.c -rw-r--r-- 6.2 KB
disk-events.c -rw-r--r-- 12.9 KB
elevator.c -rw-r--r-- 18.4 KB
elevator.h -rw-r--r-- 5.6 KB
fops.c -rw-r--r-- 17.0 KB
genhd.c -rw-r--r-- 38.1 KB
holder.c -rw-r--r-- 3.8 KB
ioctl.c -rw-r--r-- 16.4 KB
ioprio.c -rw-r--r-- 5.8 KB
kyber-iosched.c -rw-r--r-- 27.9 KB
mq-deadline.c -rw-r--r-- 33.5 KB
opal_proto.h -rw-r--r-- 9.7 KB
sed-opal.c -rw-r--r-- 71.5 KB
t10-pi.c -rw-r--r-- 12.5 KB

back to top