This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

mcasp problem with arago 3.12.25 kernel

Other Parts Discussed in Thread: DRA742

7608.sourcechanges.7z

Hello everyone.

I'm working with a custom board based on DRA742. The hardware design is similar to the VAYU board. The linux kernel version we are using is 3.12.25.

I have added MCASP2 confiuration on 3.12.25 Kernel, but while executing aplay I am getting kernel crash (Unhandled fault: imprecise external abort (0x1406) at 0x00000000). After initial analysis, it was found that while setting the delay in DAVINCI_MCASP_TXFMT_REG register inside davinci_mcasp_set_dai_fmt() function it is crashing. davinci_mcasp_set_dai_fmt() is the first function called during aplay to access the registers.

To debug the issue, trying to read the DAVINCI_MCASP_TXFMT_REG register content using mcasp_get_reg() function, but during read time also it is giving crash. Any read or write operation to the ioremap address is crashing.

Could you please help to debug the issue. source changes attached.


function where it is crashing.

static int davinci_mcasp_set_dai_fmt(struct snd_soc_dai *cpu_dai,
unsigned int fmt)
{
struct davinci_mcasp *mcasp = snd_soc_dai_get_drvdata(cpu_dai);
int ret = 0;

printk("mcasp4: %p \n",mcasp);
printk("\n 1. : %s %s %d \n",__FILE__,__func__,__LINE__);

pm_runtime_get_sync(mcasp->dev);

printk("\n 2. : %s %s %d \n",__FILE__,__func__,__LINE__);
printk(" ioremap4: %p \n",mcasp->base);
printk(" mcaspbase+offset : %p \n",(mcasp->base + DAVINCI_MCASP_TXFMCTL_REG));
printk(" data: %u \n",mcasp_get_reg(mcasp, DAVINCI_MCASP_TXFMCTL_REG));
printk(" ioremap5: %p \n",mcasp->base);

switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
case SND_SOC_DAIFMT_DSP_B:
case SND_SOC_DAIFMT_AC97:
mcasp_clr_bits(mcasp, DAVINCI_MCASP_TXFMCTL_REG, FSXDUR);
mcasp_clr_bits(mcasp, DAVINCI_MCASP_RXFMCTL_REG, FSRDUR);
break;
default:
printk("\n 3. : %s %s %d \n",__FILE__,__func__,__LINE__);
/* configure a full-word SYNC pulse (LRCLK) */
mcasp_set_bits(mcasp, DAVINCI_MCASP_TXFMCTL_REG, FSXDUR);
printk("\n 4. : %s %s %d \n",__FILE__,__func__,__LINE__);
mcasp_set_bits(mcasp, DAVINCI_MCASP_RXFMCTL_REG, FSRDUR);

printk("\n 5. : %s %s %d \n",__FILE__,__func__,__LINE__);
/* make 1st data bit occur one ACLK cycle after the frame sync */
mcasp_set_bits(mcasp, DAVINCI_MCASP_TXFMT_REG, FSXDLY(1));
mcasp_set_bits(mcasp, DAVINCI_MCASP_RXFMT_REG, FSRDLY(1));
break;
}

Kernel crash:
--------------------

root:~# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: dra7evm [dra7evm], device 0: Media snd-soc-dummy-dai-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0
root:~# aplay -D plughw:0,0 /home/test.wav
[ 43.954359]
[ 43.954359] davinci_mcasp_startup 928
[ 43.960881] omap-dma-engine 4a056000.dma-controller: allocating channel for 79
Playing WAVE '/home/root/release.wav' : Signed 32 bit Little Endian, Rate 48000 Hz, Stereo
[ 43.974381] mcasp4: ed1f5290
[ 43.982426]
[ 43.982426] 1. : sound/soc/davinci/davinci-mcasp.c davinci_mcasp_set_dai_fmt 387
[ 43.994327]
[ 43.994327] 2. : sound/soc/davinci/davinci-mcasp.c davinci_mcasp_set_dai_fmt 390
[ 44.004555] ioremap4: f0178000
[ 44.008624] mcaspbase+offset : f01780ac
[ 44.013502] Unhandled fault: imprecise external abort (0x1406) at 0x00000000
[ 44.020940] Internal error: : 1406 [#1] PREEMPT SMP ARM
[ 44.026455] Modules linked in:
[ 44.029682] CPU: 0 PID: 1901 Comm: aplay Not tainted 3.12.25-ev #38
[ 44.037757] task: ed37b440 ti: eb89c000 task.ti: eb89c000
[ 44.043463] PC is at vprintk_emit+0x4/0x4f8
[ 44.047879] LR is at printk+0x3c/0x44
[ 44.051743] pc : [<c007cf04>] lr : [<c06016a4>] psr: 40000013
[ 44.051743] sp : eb89dd68 ip : eb89dd68 fp : eb89dd84
[ 44.063857] r10: ed577000 r9 : eb89c000 r8 : 00562200
[ 44.069363] r7 : c08fee8c r6 : ed5b4ed0 r5 : 00004201 r4 : ed1f5290
[ 44.076249] r3 : 00000000 r2 : 00000000 r1 : ffffffff r0 : 00000000
[ 44.083134] Flags: nZcv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user
[ 44.090665] Control: 10c5387d Table: ac54806a DAC: 00000015
[ 44.096725] Process aplay (pid: 1901, stack limit = 0xeb89c248)
[ 44.102971] Stack: (0xeb89dd68 to 0xeb89e000)
[ 44.107568] dd60: c07e60c8 eb89dd8c c038e8c4 eb89dd8c eb89ddac eb89dd98
[ 44.116193] dd80: c0536c3c c0601678 c07e60c8 00000000 eb89dca0 f0178000 eba08000 ed5655c0
[ 44.124830] dda0: eb89ddbc eb89ddb0 c0523474 c0536bc0 eb89dde4 eb89ddc0 c05398f4 c0523454
[ 44.133462] ddc0: ed5b3cd0 eb9e5c00 eba08000 ed5b5810 ed577000 c053989c eb89de2c eb89dde8
[ 44.142087] dde0: c0530fe8 c05398a8 c08fd008 ed565500 ed5655c0 ed5f2c10 ed5b581c eba08000
[ 44.150715] de00: eb89de2c eb9e5c00 eba08000 ed577000 00000000 ed3ca070 eb89c000 ed577000
[ 44.159339] de20: eb89de4c eb89de30 c0518814 c0530f88 ed577000 eba08000 bee8f058 00000000
[ 44.167968] de40: eb89dea4 eb89de50 c051a09c c0518748 ffffffff 00000000 00000000 00000000
[ 44.176593] de60: 00000200 000000a8 ffffffff 00000000 ffffffff ed110000 ffffffff ed577000
[ 44.185224] de80: bee8f058 c25c4111 00000000 ed3ca070 eb89c000 bee8f058 eb89dedc eb89dea8
[ 44.193839] dea0: c051ad30 c05199f0 eb89ded4 eb89deb8 c006b7a4 eb89dfb0 80000007 00000000
[ 44.202469] dec0: ed4ba8c0 c25c4111 00000000 ed3ca070 eb89deec eb89dee0 c051b07c c051abf8
[ 44.211101] dee0: eb89df74 eb89def0 c00fd138 c051b058 eb89dfac eb89df00 c0008688 c060c414
[ 44.219733] df00: c0609e90 c060c7a0 00000000 ed009540 c1953d40 eb89c000 0000006a 60000193
[ 44.228362] df20: eb89df54 eb89df30 c00a05d0 c029df80 c1953d40 eb89c000 0000006a 00000000
[ 44.236995] df40: fa212000 0002afd8 eb89df6c 00000000 bee8f058 c25c4111 00000000 ed4ba8c0
[ 44.245622] df60: eb89c000 00000004 eb89dfa4 eb89df78 c00fd6cc c00fd0bc eb89dfac 00000000
[ 44.254259] df80: 000276a0 bee8f058 0002afd8 00000036 c0014828 00000000 00000000 eb89dfa8
[ 44.262883] dfa0: c0014680 c00fd664 000276a0 bee8f058 00000004 c25c4111 bee8f058 00020001
[ 44.271508] dfc0: 000276a0 bee8f058 0002afd8 00000036 b6e70798 b6ed47dc b6e7087c 0001e5e8
[ 44.280135] dfe0: b6ed61a4 bee8ef9c b6e6261c b6d091bc 20000010 00000004 80802080 315840d1
[ 44.288758] Backtrace:
[ 44.291353] [<c0601668>] (printk+0x0/0x44) from [<c0536c3c>] (davinci_mcasp_set_dai_fmt+0x88/0x428)
[ 44.300889] r3:f0178000 r2:eb89dca0 r1:00000000 r0:c07e60c8
[ 44.306899] [<c0536bb4>] (davinci_mcasp_set_dai_fmt+0x0/0x428) from [<c0523474>] (snd_soc_dai_set_fmt+0x2c/0x44)
[ 44.317625] r5:ed5655c0 r4:eba08000
[ 44.321416] [<c0523448>] (snd_soc_dai_set_fmt+0x0/0x44) from [<c05398f4>] (dra7_snd_media_hw_params+0x58/0x128)
[ 44.332062] [<c053989c>] (dra7_snd_media_hw_params+0x0/0x128) from [<c0530fe8>] (soc_pcm_hw_params+0x6c/0x2bc)
[ 44.342612] r8:c053989c r7:ed577000 r6:ed5b5810 r5:eba08000 r4:eb9e5c00
r3:ed5b3cd0
[ 44.350917] [<c0530f7c>] (soc_pcm_hw_params+0x0/0x2bc) from [<c0518814>] (snd_pcm_hw_params+0xd8/0x3a0)
[ 44.360839] [<c051873c>] (snd_pcm_hw_params+0x0/0x3a0) from [<c051a09c>] (snd_pcm_common_ioctl1+0x6b8/0xd88)
[ 44.371209] r7:00000000 r6:bee8f058 r5:eba08000 r4:ed577000
[ 44.377210] [<c05199e4>] (snd_pcm_common_ioctl1+0x0/0xd88) from [<c051ad30>] (snd_pcm_playback_ioctl1+0x144/0x460)
[ 44.388138] [<c051abec>] (snd_pcm_playback_ioctl1+0x0/0x460) from [<c051b07c>] (snd_pcm_playback_ioctl+0x30/0x3c)
[ 44.398962] r8:ed3ca070 r7:00000000 r6:c25c4111 r5:ed4ba8c0 r4:00000000
[ 44.406072] [<c051b04c>] (snd_pcm_playback_ioctl+0x0/0x3c) from [<c00fd138>] (do_vfs_ioctl+0x88/0x5a8)
[ 44.415895] [<c00fd0b0>] (do_vfs_ioctl+0x0/0x5a8) from [<c00fd6cc>] (SyS_ioctl+0x74/0x84)
[ 44.424532] [<c00fd658>] (SyS_ioctl+0x0/0x84) from [<c0014680>] (ret_fast_syscall+0x0/0x30)
[ 44.433341] Code: e89da800 c08ca568 c090a1a0 e1a0c00d (e92ddff0)
[ 44.439776] ---[ end trace bb680dd4a482b55a ]---