Division by zero in kernel in mcasp [4.4.19-ti-r41]

59 views
Skip to first unread message

Robin Scheibler

unread,
Aug 29, 2016, 9:32:05 AM8/29/16
to BeagleBoard
Dear All,

I am trying to develop a driver for the sta321mp audio processor. Many of the details are in this previous thread:

https://groups.google.com/forum/#!searchin/beagleboard/fakufaku%7Csort:relevance/beagleboard/pptZ_9PTqMY/Hy4Wh4kK0gUJ

I am now trying to port this driver a more recent version of the kernel, v4.4.19 at the moment. I have done that using the ti-linux-kernel-dev repository from Robert C Nelson but I am having some trouble with the davinci_mcasp_hw_params routine giving a division by zero in the kernel error.

I was wondering if it is a known bug in the current kernel, or something that I introduced. I have tried to look through the mcasp code to see where it could come from but have been unsuccessful so far.

root@beaglebone:~# echo BB-BONE-STA321MP > $SLOTS
root@beaglebone:~# dmesg
[  187.864668] bone_capemgr bone_capemgr: part_number 'BB-BONE-STA321MP', version 'N/A'
[  187.864888] bone_capemgr bone_capemgr: slot #4: override
[  187.864931] bone_capemgr bone_capemgr: Using override eeprom data at slot 4
[  187.864978] bone_capemgr bone_capemgr: slot #4: 'Override Board Name,00A0,Override Manuf,BB-BONE-STA321MP'
[  187.914755] rtc-ds1307 1-0068: SET TIME!
[  187.923075] rtc-ds1307 1-0068: rtc core: registered ds1338 as rtc1
[  187.923159] rtc-ds1307 1-0068: 56 bytes nvram
[  187.924043] sta321mp: probing i2c
[  187.924078] sta321mp: Setting up device through i2c.
[  187.924526] omap_i2c 4802a000.i2c: bus 1 rev0.11 at 100 kHz
[  187.948010] sta321mp: newboard config.
[  188.079389] lm75 1-0048: hwmon0: sensor 'tmp275'
[  188.308022] sta321mp: probing.
[  188.308181] sta321mp: init setting clocks.
[  188.308193] sta321mp: using cpu 48038000.mcasp
[  188.310768] davinci_evm ocp:sound: sta321mp-audio <-> 48038000.mcasp mapping ok
[  188.325125] bone_capemgr bone_capemgr: slot #4: dtbo 'BB-BONE-STA321MP-00A0.dtbo' loaded; overlay id #0

root@beaglebone:~# arecord -c 6 -d 5 -r 48000 -t wav -f S32_LE test.wav -vvv
Recording WAVE 'test.wav' : Signed 32 bit Little Endian, Rate 48000 Hz, Channels 6
Plug PCM: Hardware PCM card 0 'STA321MP EVM' device 0 subdevice 0
Its setup is:
  stream       : CAPTURE
  access       : RW_INTERLEAVED
  format       : S32_LE
  subformat    : STD
  channels     : 6
  rate         : 48000
  exact rate   : 48000 (48000/1)
  msbits       : 32
  buffer_size  : 5460
  period_size  : 1365
  period_time  : 28437
  tstamp_mode  : NONE
  period_step  : 1
  avail_min    : 1365
  period_event : 0
  start_threshold  : 1
  stop_threshold   : 5460
  silence_threshold: 0
  silence_size : 0
  boundary     : 1431306240
  appl_ptr     : 0
  hw_ptr       : 0
Max peak (8190 samples): 0x00001000 #                    0%
Max peak (8190 samples): 0x00001000 #                    0%
Max peak (8190 samples): 0x00001000 #                    0%

root@beaglebone:~# dmesg
[  341.527405] evm_sta321mp_hw_params: Starting operations.
[  341.527461] bclk (from params): 9216000
[  341.527483] sysclk: 12288000
[  341.527502] bclk: 3072000
[  341.527545] sta321mp: newboard config.
[  341.931465] 4 bytes
[  341.931498] sta321mp: setting fmt bits to 20
[  341.931852] sta321mp: Started at 48000 Hz.
[  341.931874] slots: 2
[  341.931895] active serializers: 3
[  341.931905] Division by zero in kernel.
[  341.935832] CPU: 0 PID: 657 Comm: arecord Not tainted 4.4.17-ti-r40 #12
[  341.935844] Hardware name: Generic AM33XX (Flattened Device Tree)
[  341.935894] [<c0015c5d>] (unwind_backtrace) from [<c0012431>] (show_stack+0x11/0x14)
[  341.935921] [<c0012431>] (show_stack) from [<c03cad4f>] (dump_stack+0x6f/0x7c)
[  341.935942] [<c03cad4f>] (dump_stack) from [<c03c9d17>] (Ldiv0+0x9/0x12)
[  341.935961] [<c03c9d17>] (Ldiv0) from [<c03c9d01>] (__aeabi_idivmod+0x9/0x16)
[  341.935995] [<c03c9d01>] (__aeabi_idivmod) from [<c06137c7>] (davinci_mcasp_hw_params+0x66f/0x68c)
[  341.936018] [<c06137c7>] (davinci_mcasp_hw_params) from [<c060dc2b>] (soc_dai_hw_params+0x17/0x34)
[  341.936037] [<c060dc2b>] (soc_dai_hw_params) from [<c060de67>] (soc_pcm_hw_params+0x21f/0x388)
[  341.936066] [<c060de67>] (soc_pcm_hw_params) from [<c05fb8e7>] (snd_pcm_hw_params+0x8b/0x270)
[  341.936087] [<c05fb8e7>] (snd_pcm_hw_params) from [<c05fc7c5>] (snd_pcm_common_ioctl1+0x3f5/0xc14)
[  341.936109] [<c05fc7c5>] (snd_pcm_common_ioctl1) from [<c05fd6ab>] (snd_pcm_capture_ioctl1+0x203/0x488)
[  341.936135] [<c05fd6ab>] (snd_pcm_capture_ioctl1) from [<c0145eed>] (do_vfs_ioctl+0x349/0x528)
[  341.936156] [<c0145eed>] (do_vfs_ioctl) from [<c0146119>] (SyS_ioctl+0x4d/0x58)
[  341.936180] [<c0146119>] (SyS_ioctl) from [<c000ec41>] (ret_fast_syscall+0x1/0x52)
[  341.936193] Total slots: 2
Reply all
Reply to author
Forward
0 new messages