Le lundi 4 juillet 2016 00:27:06 UTC-10, [email protected] a écrit : > Hello > > I try to make a driver for audio codec in OP PC sun8i. > I starting from sun4i-codec.c driver for A10-A20 SOC because H3 have major > same register related audiocodec datasheet. > > I setup pll_audio, change some #define offset according to H3 datasheet audio > codec but for now i 'm facing to dmaengine problem. > > When i start to play or record one file wav, the kernel hang on this function > : > > static int dmaengine_pcm_prepare_and_submit(struct snd_pcm_substream > *substream) > in pcm_dmaengine.c, precisely at this instruction. > > desc = dmaengine_prep_dma_cyclic(chan, > substream->runtime->dma_addr, > snd_pcm_lib_buffer_bytes(substream), > snd_pcm_lib_period_bytes(substream), direction, flags); > > I have a null pointer (Unable to handle kernel NULL pointer dereference at > virtual address 00000000) and i don't know why :( > > > Here is my add in dtsi about codec : > > codec: codec@01c22c00 { > #sound-dai-cells = <0>; > compatible = "allwinner,sun4i-a10-codec"; > reg = <0x01c22c00 0x40>; > interrupts = <GIC_SPI 29 IRQ_TYPE_LEVEL_HIGH>; > clocks = <&bus_gates 64>; > clock-names = "apb"; > dmas = <&dma 15>, <&dma 15>; > dma-names = "rx", "tx"; > status = "disabled"; > }; > > and my new template of sun4i-codec.c (will be sun8i-codec.c later) : > http://pastebin.com/rkgZxwSk > > Thanks for your help
Per example, i do arecord -D plughw:0 -r 48000 test.wav and i trace this value before kernel hang : [DEBUG pcm_dmaengine.c] step 31 : chan_id = 1 : chan_pointer = ee904610 [ 192.870994] [DEBUG pcm_dmaengine.c] chan_name = dma0chan1 [ 192.877424] [DEBUG pcm_dmaengine.c] buf_addr = 1856503808 (%d) [ 192.883854] [DEBUG pcm_dmaengine.c] buf_len = 48000 (%zd) [ 192.889762] [DEBUG pcm_dmaengine.c] period_len = 12000 (%zd) [ 192.895938] Unable to handle kernel NULL pointer dereference at virtual address 00000000 [ 192.904015] pgd = eeb54000 [ 192.906719] [00000000] *pgd=6e423835, *pte=00000000, *ppte=00000000 [ 192.913020] Internal error: Oops: 80000007 [#1] PREEMPT SMP ARM [ 192.918930] Modules linked in: [ 192.921996] CPU: 3 PID: 1683 Comm: arecord Not tainted 4.6.1-rc1 #76 [ 192.928338] Hardware name: Allwinner sun8i Family [ 192.933036] task: ee989c80 ti: eeb3c000 task.ti: eeb3c000 [ 192.938429] PC is at 0x0 [ 192.940969] LR is at snd_dmaengine_pcm_trigger+0x1d0/0x2c0 [ 192.946448] pc : [<00000000>] lr : [<c0430e0c>] psr: 20000093 [ 192.946448] sp : eeb3de10 ip : ee904610 fp : ef1ba800 [ 192.957907] r10: 00000001 r9 : 00000003 r8 : 00000002 [ 192.963125] r7 : ef230240 r6 : 00000000 r5 : ef230240 r4 : ef1ba800 [ 192.969642] r3 : 00002ee0 r2 : 0000bb80 r1 : 6ea80000 r0 : ee8080b8 [ 192.976161] Flags: nzCv IRQs off FIQs on Mode SVC_32 ISA ARM Segment none [ 192.983371] Control: 10c5387d Table: 6eb5406a DAC: 00000051 [ 192.989100] Process arecord (pid: 1683, stack limit = 0xeeb3c210) [ 192.995184] Stack: (0xeeb3de10 to 0xeeb3e000) [ 192.999538] de00: 00000002 00000003 ee904a00 ee808174 [ 193.007706] de20: ee808024 c080b380 00000001 00000000 00000000 00000000 00000000 00000000 [ 193.015874] de40: 00000001 ef1ba800 00000001 ee934c80 ee95aa0c ee9a2000 00000000 c045b0f4 [ 193.024042] de60: ef1ba800 c0633ca0 ef1ba800 00000003 b6e11ad0 eeb3c000 00000000 c042744c [ 193.032210] de80: ef1ba800 c0633ca0 00000003 00000004 b6e11ad0 c0427f0c ef1ba800 b6e11ad0 [ 193.040378] dea0: ee881b40 c0429240 00000002 00000003 eeb3df74 00000001 00000005 c000f804 [ 193.048546] dec0: eeb3c000 00000000 be9a4e44 ef1ba800 b6e11ad0 ee881b40 00000004 b6e11ad0 [ 193.056715] dee0: eeb3c000 00000000 b6e5f680 c042a968 00000000 00000000 00000000 c00dffd4 [ 193.064883] df00: b6e11ad0 eeb341a0 ee881b40 00000004 b6e11ad0 c00f18a4 00000000 00000000 [ 193.073050] df20: eeb3df14 00000000 ee881a80 00000000 0000002c 00000000 00000000 00000000 [ 193.081219] df40: 00000000 ee881a80 00000008 eed9df70 00000002 ee881a88 ef27a198 c00574d8 [ 193.089387] df60: ee881a80 c00e0dcc 00000000 ee881b40 00000004 ee881b40 00004142 b6e11ad0 [ 193.097555] df80: eeb3c000 00000000 b6e5f680 c00f2134 b6e11940 00001770 b6e116f0 00000036 [ 193.105723] dfa0: c000f804 c000f640 b6e11940 00001770 00000004 00004142 b6e11ad0 be9a2b98 [ 193.113891] dfc0: b6e11940 00001770 b6e116f0 00000036 00000000 00000002 be9a2be0 b6e5f680 [ 193.122060] dfe0: b6ec8eb8 be9a2b80 b6e5b664 b6ef9b74 60000010 00000004 d7dffffe ffffffff [ 193.130243] [<c0430e0c>] (snd_dmaengine_pcm_trigger) from [<c045b0f4>] (soc_pcm_trigger+0x9c/0x11c) [ 193.139285] [<c045b0f4>] (soc_pcm_trigger) from [<c042744c>] (snd_pcm_action_single+0x38/0x80) [ 193.147892] [<c042744c>] (snd_pcm_action_single) from [<c0427f0c>] (snd_pcm_action_lock_irq+0x3c/0x64) [ 193.157191] [<c0427f0c>] (snd_pcm_action_lock_irq) from [<c0429240>] (snd_pcm_common_ioctl1+0x374/0x11e8) [ 193.166750] [<c0429240>] (snd_pcm_common_ioctl1) from [<c042a968>] (snd_pcm_capture_ioctl1+0x280/0x5f0) [ 193.176136] [<c042a968>] (snd_pcm_capture_ioctl1) from [<c00f18a4>] (do_vfs_ioctl+0x9c/0x8f8) [ 193.184655] [<c00f18a4>] (do_vfs_ioctl) from [<c00f2134>] (SyS_ioctl+0x34/0x5c) [ 193.191962] [<c00f2134>] (SyS_ioctl) from [<c000f640>] (ret_fast_syscall+0x0/0x3c) [ 193.199522] Code: bad PC value [ 193.202575] ---[ end trace 66fc1f4b94944390 ]--- [ 193.207188] note: arecord[1683] exited with preempt_count 2 -- You received this message because you are subscribed to the Google Groups "linux-sunxi" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
