diff options
author | Shengjiu Wang <shengjiu.wang@nxp.com> | 2020-05-20 19:35:29 +0800 |
---|---|---|
committer | Shengjiu Wang <shengjiu.wang@nxp.com> | 2020-05-21 18:45:35 +0800 |
commit | 3a467c53a7e6a73726aed09076fec837df82781d (patch) | |
tree | f2f32acd69459872cf56e075337f4095284d393b | |
parent | 857284dc23fb2bcd6216ddc8e254c5133f449801 (diff) |
MLK-24084-2: ASoC: fsl_easrc_m2m: Fix kernel panic in m2m stress test
initilize the m2m->complete in open() to avoid the NULL pointer in suspend
because the suspend can be called before initilizing m2m->complete in convert
[ 591.006691] Filesystems sync: 0.084 seconds
[ 591.012292] Freezing user space processes ... (elapsed 0.001 seconds) done.
[ 591.020768] OOM killer disabled.
[ 591.024016] Freezing remaining freezable tasks ... (elapsed 0.105 seconds) done.
[ 591.809374] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000000
[ 591.818160] Mem abort info:
[ 591.820949] ESR = 0x96000004
[ 591.824000] EC = 0x25: DABT (current EL), IL = 32 bits
[ 591.829307] SET = 0, FnV = 0
[ 591.832356] EA = 0, S1PTW = 0
[ 591.835493] Data abort info:
[ 591.838369] ISV = 0, ISS = 0x00000004
[ 591.842200] CM = 0, WnR = 0
[ 591.845165] user pgtable: 4k pages, 48-bit VAs, pgdp=00000001b033e000
[ 591.851600] [0000000000000000] pgd=0000000000000000
[ 591.856476] Internal error: Oops: 96000004 [#1] PREEMPT SMP
[ 591.862043] Modules linked in:
[ 591.865097] CPU: 2 PID: 867 Comm: rtcwakeup.out Not tainted 5.4.24-04892-g8b7eb66 #911
[ 591.873009] Hardware name: NXP i.MX8MPlus EVK board (DT)
[ 591.878317] pstate: a0000085 (NzCv daIf -PAN -UAO)
[ 591.883110] pc : __wake_up_common+0x58/0x170
[ 591.887377] lr : __wake_up_locked+0x18/0x20
[ 591.891555] sp : ffff8000120b3a00
[ 591.894866] x29: ffff8000120b3a00 x28: ffff800011b84000
[ 591.900174] x27: 0000000000000000 x26: 0000000000000000
[ 591.905482] x25: 0000000000000003 x24: 0000000000000000
[ 591.910791] x23: 0000000000000001 x22: 0000000000000000
[ 591.916099] x21: ffff000171369420 x20: ffff000171369418
[ 591.921407] x19: ffff000171369410 x18: 0000000000000000
[ 591.926715] x17: 0000000000000000 x16: 0000000000000000
[ 591.932023] x15: 0000000000000000 x14: ffff0001760daa00
[ 591.937331] x13: ffff80016dbdc000 x12: 0000000034d4d91d
[ 591.942639] x11: 0000000000000000 x10: 00000000000009c0
[ 591.947948] x9 : ffff000171a30470 x8 : 00000000ffffffff
[ 591.953256] x7 : ffff8000120b3a38 x6 : ffffffffffffffe8
[ 591.958564] x5 : 0000000000000000 x4 : 0000000000000000
[ 591.963871] x3 : 0000000000000000 x2 : 0000000000000001
[ 591.969179] x1 : 0000000000000003 x0 : 0000000000000000
[ 591.974487] Call trace:
[ 591.976931] __wake_up_common+0x58/0x170
[ 591.980851] __wake_up_locked+0x18/0x20
[ 591.984683] complete+0x48/0x68
[ 591.987823] fsl_easrc_suspend+0x84/0x100
[ 591.991831] dpm_run_callback.isra.0+0x38/0xd8
[ 591.996271] __device_suspend+0xfc/0x3c8
[ 592.000191] dpm_suspend+0xf0/0x1e8
[ 592.003676] dpm_suspend_start+0x98/0xa0
[ 592.007596] suspend_devices_and_enter+0xec/0x5b8
[ 592.012297] pm_suspend+0x2f8/0x340
[ 592.015781] state_store+0x88/0x108
[ 592.019267] kobj_attr_store+0x14/0x28
[ 592.023015] sysfs_kf_write+0x40/0x50
[ 592.026674] kernfs_fop_write+0xf8/0x210
[ 592.030594] __vfs_write+0x18/0x40
[ 592.033992] vfs_write+0xdc/0x1c8
[ 592.037303] ksys_write+0x68/0xf0
[ 592.040615] __arm64_sys_write+0x18/0x20
[ 592.044536] el0_svc_common.constprop.0+0x68/0x160
[ 592.049324] el0_svc_handler+0x20/0x80
[ 592.053070] el0_svc+0x8/0xc
[ 592.055950] Code: 54000700 a90153f3 2a0203f7 52800018 (f9400cd3)
[ 592.062040] ---[ end trace a36c1a42637c268e ]---
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
-rw-r--r-- | sound/soc/fsl/fsl_easrc_m2m.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sound/soc/fsl/fsl_easrc_m2m.c b/sound/soc/fsl/fsl_easrc_m2m.c index 82d06afbecb7..29afcf266681 100644 --- a/sound/soc/fsl/fsl_easrc_m2m.c +++ b/sound/soc/fsl/fsl_easrc_m2m.c @@ -626,8 +626,8 @@ static long fsl_easrc_ioctl_convert(struct fsl_easrc_m2m *m2m, return ret; } - init_completion(&m2m->complete[IN]); - init_completion(&m2m->complete[OUT]); + reinit_completion(&m2m->complete[IN]); + reinit_completion(&m2m->complete[OUT]); fsl_easrc_submit_dma(m2m); @@ -800,6 +800,8 @@ static int fsl_easrc_open(struct inode *inode, struct file *file) ctx->private_data = m2m; spin_lock_init(&m2m->lock); + init_completion(&m2m->complete[IN]); + init_completion(&m2m->complete[OUT]); /* context structs are already allocated in fsl_easrc->ctx[i] */ file->private_data = m2m; |