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.

OMAPL138, Syslink, Intermittent asserts from "ti/syslink/ipc/hlos/knl/MessageQ.c"

Other Parts Discussed in Thread: OMAPL138

Hi,

I have this intermittent problem which more so seems like timing related. 

My setup:

Custom Board with OMAP L138, ipc_1_25_03_15, bios_6_35_04_50, xdctools_3_25_03_72, syslink_2_21_02_10

At startup on ARM,  the dsp "slaveloader_release startup DSP dsp_image.dsp"

Then start ARM side module that creates the Heaps, MessageQ.

these two operations are done in the /etc/init.d/rcS which is run as part of the Linux load process.

All this works and there is communication between the ARM and the DSP. 

However, when I manually start the DSP from linux prompt and start the ARM module I get a stack dump.

I have modified the "syslink_2_21_02_10/packages/ti/syslink/family/hlos/knl/omapl1xx/Platform.c" and also the target.cfg to have HeapBufMP config.trackAllocs=TRUE and MessageQConfig.numHeaps=20.

The Heap creation, MessageQ creation and their open, the IPC events are all based on the example "syslink_2_21_02_10\examples\archive\OMAPL138_linux_elf\ex02_messageq"

The SR0 in target.cfg is:

var SharedRegion = xdc.useModule('ti.sdo.ipc.SharedRegion');
/* configure SharedRegion #0 (IPC) */
var SR0Mem = Program.cpu.memoryMap["DDR_SHARED"];

SharedRegion.setEntryMeta(0,
new SharedRegion.Entry({
name: "SR0",
base: 0xC7000000,
len: 0x00200000, /* 2MB shared space */
ownerProcId: MultiProc.getIdMeta("HOST"),
cacheEnable: true,
isValid: true
})
);

I also use SR1 directly:

var SR1Mem = Program.cpu.memoryMap["DDR_SR1"];
SharedRegion.setEntryMeta(1,
new SharedRegion.Entry({
name: "DDR_CDM",
base: 0xC7200000,
len: 0x00600000,
ownerProcId: MultiProc.getIdMeta("HOST"),
cacheEnable: true,
isValid: true
})
);

the target.bld defines these memories as:

["DDR_SHARED",
{
name: "DDR_SHARED",
base: 0xC7000000,
len: 0x00200000, 

space: "data",
access: "RW",
}
],

["DDR_SR1",
{
name: "DDR_SR1",
base: 0xC7200000,
len: 0x00600000, 
space: "data",
access: "RW",
}
],

The stack dump is below. It comes from the ISR that handles the events from the DSP.

Assertion at Line no: 1605 in syslink/syslink_2_21_02_10/packages/ti/syslink/utils/hlos/knl/Linux/../../../../../../ti/syslink/ipc/hlos/knl/MessageQ.c: (UInt16)queueId < MessageQ_module->numQueues : failed
Unable to handle kernel paging request at virtual address c7ab9a5c
pgd = c0004000
[c7ab9a5c] *pgd=c5a49011, *pte=00000000, *ppte=00000000
Internal error: Oops: 7 [#1] PREEMPT
last sysfs file: [[removed]]
Modules linked in: [[removed]] syslink
CPU: 0 Not tainted (2.6.37 #1)
PC is at MessageQ_put+0x338/0x500 [syslink]
LR is at pick_next_task_fair+0xa4/0xc4
pc : [<bf0315b0>] lr : [<c0037874>] psr: 60000013
sp : c38cdee8 ip : c03a9ab8 fp : c38cdf1c
r10: ce401900 r9 : 00000000 r8 : 00000100
r7 : 00000000 r6 : bf0b5664 r5 : 00007297 r4 : ce418808
r3 : c7a9d000 r2 : a0000093 r1 : 00000000 r0 : 0000013d
Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment kernel
Control: 0005317f Table: c4b84000 DAC: 00000017
Process kernelThread_0 (pid: 538, stack limit = 0xc38cc270)
Stack: (0xc38cdee8 to 0xc38ce000)
dee0: ce418808 00000294 c38cdf1c c38cdf00 bf0203d0 ce35b000
df00: 0000ffff ce418808 ce401800 00000100 c38cdf4c c38cdf20 bf04e084 bf031288
df20: 00000000 00000002 ce35b000 00000000 00000000 ce346000 00000002 00000000
df40: c38cdf74 c38cdf50 bf02ef74 bf04dfdc 00000000 00000000 ce401900 ce33d000
df60: 00000000 00000002 c38cdfa4 c38cdf78 bf04a18c bf02eec0 bf04a0a8 ce343000
df80: ce343020 bf024ac0 00000013 00000000 00000000 00000000 c38cdfbc c38cdfa8
dfa0: bf024b50 bf04a0b8 c341fba8 ce343000 c38cdff4 c38cdfc0 c0057884 bf024ad0
dfc0: c341fba8 00000000 ce343000 00000000 c38cdfd0 c38cdfd0 00000000 c341fba8
dfe0: c00577f4 c0040db0 00000000 c38cdff8 c0040db0 c0057804 6ae25d13 c7c756b1
Backtrace:
[<bf031278>] (MessageQ_put+0x0/0x500 [syslink]) from [<bf04e084>] (_TransportShm_notifyFxn+0xb8/0x114 [syslink])
r8:00000100 r7:ce401800 r6:ce418808 r5:0000ffff r4:ce35b000
[<bf04dfcc>] (_TransportShm_notifyFxn+0x0/0x114 [syslink]) from [<bf02ef74>] (Notify_exec+0xc4/0x110 [syslink])
r6:00000000 r5:00000002 r4:ce346000
[<bf02eeb0>] (Notify_exec+0x0/0x110 [syslink]) from [<bf04a18c>] (_NotifyDriverShm_ISR+0xe4/0x144 [syslink])
r6:00000002 r5:00000000 r4:ce33d000
[<bf04a0a8>] (_NotifyDriverShm_ISR+0x0/0x144 [syslink]) from [<bf024b50>] (Thread_callback+0x90/0xec [syslink])
[<bf024ac0>] (Thread_callback+0x0/0xec [syslink]) from [<c0057884>] (kthread+0x90/0x98)
r5:ce343000 r4:c341fba8
[<c00577f4>] (kthread+0x0/0x98) from [<c0040db0>] (do_exit+0x0/0x6c8)
r6:c0040db0 r5:c00577f4 r4:c341fba8
Code: e59f31c4 ebffca8d e5963000 e5933078 (e7936105)
---[ end trace 1395434b69e498f3 ]---

The default value of MessageQ_module->numQueues is 32 and I have max 24 messageQs between ARM and DSP. So this condition should not assert. This is also validated by the fact that when DSP is started and ARM module started in /etc/init.d/rcS it all works.

Tracing back the failure it seems that when _TransportShm_notifyFxn extracts the queueId from the Message it is garbled. 

I added a sleep of 1 second between starting DSP and starting my ARM module and the problem persists.

Why is this Assertion and that too not when the DSP and app started from /etc/init.d/rcS file but when started manually from the linux prompt? What undocumented timing considerations here with cache enabled?

-----------------------------------

Suggestion: In a future release of syslink, can you also please print the values used in the Asserts? In this case either of the two values hard coded 32 or the dynamic queueId are messed up. A print of these values in the Assert would help.

I can definitely add printks, but many a times I cannot and adding printk changes timing and the problem disappears.

  • Forgot to mention:

    kernel is 2.6.37
  • Hi Taran,
    Can you please refer to the following TI wiki for running SYSLINK example manually.
    processors.wiki.ti.com/.../MCSDK_OMAPL138_User_Guide_Chapter_Exploring
  • Hi Titusrathinaraj,

    The ex02_messageq examples work on the target both when I start the DSP and the app_host exe using the rcS file or manually by explicitly typing the commands.

    I however get a lot of "Please fix your driver" messages when starting DSP and the arm application

    When starting DSP:

    ./slaveloader_release startup DSP server_dsp.xe674
    Attached to slave procId 0.
    Loading procId 0.
    BUG: Your driver calls ioremap() on system memory. This leads
    to architecturally unpredictable behaviour on ARMv6+, and ioremap()
    will fail in the next kernel release. Please fix your driver.
    ------------[ cut here ]------------
    WARNING: at arch/arm/mm/ioremap.c:211 __arm_ioremap_pfn_caller+0x58/0x168()
    Modules linked in: syslink
    Backtrace:
    [<c002e4e0>] (dump_backtrace+0x0/0x110) from [<c02ccaa0>] (dump_stack+0x18/0x1c)
    r6:c03564f9 r5:000000d3 r4:00000000 r3:00000000
    [<c02cca88>] (dump_stack+0x0/0x1c) from [<c003d9a8>] (warn_slowpath_common+0x54/0x6c)
    [<c003d954>] (warn_slowpath_common+0x0/0x6c) from [<c003d9e4>] (warn_slowpath_null+0x24/0x2c)
    r8:00002000 r7:00000000 r6:00000000 r5:000c3000 r4:0001c7c0
    r3:00000009
    [<c003d9c0>] (warn_slowpath_null+0x0/0x2c) from [<c00311f8>] (__arm_ioremap_pfn_caller+0x58/0x168)
    [<c00311a0>] (__arm_ioremap_pfn_caller+0x0/0x168) from [<c0031384>] (__arm_ioremap_caller+0x5c/0x64)
    [<c0031328>] (__arm_ioremap_caller+0x0/0x64) from [<c00349f8>] (davinci_ioremap+0x6c/0x74)
    r4:ffff0000
    [<c003498c>] (davinci_ioremap+0x0/0x74) from [<bf025dc0>] (MemoryOS_map+0x1f8/0x3bc [syslink])
    r8:00000005 r7:00000002 r6:ce170000 r5:00000000 r4:c3887c58
    r3:00000000
    [<bf025bc8>] (MemoryOS_map+0x0/0x3bc [syslink]) from [<bf006a94>] (_ProcMgr_map+0x1f0/0x528 [syslink])
    r7:00000002 r6:ce170000 r5:00000001 r4:c3887cc4
    [<bf0068a4>] (_ProcMgr_map+0x0/0x528 [syslink]) from [<bf00bdf0>] (ElfLoaderTrgWrite_copy+0x15c/0x404 [syslink])
    [<bf00bc94>] (ElfLoaderTrgWrite_copy+0x0/0x404 [syslink]) from [<bf0108e8>] (DLIF_copy+0x10/0x1c [syslink])
    [<bf0108d8>] (DLIF_copy+0x0/0x1c [syslink]) from [<bf00f0a8>] (DLOAD_load+0x738/0xa60 [syslink])
    [<bf00e970>] (DLOAD_load+0x0/0xa60 [syslink]) from [<bf00b3f0>] (ElfLoader_load+0x274/0x3b8 [syslink])
    [<bf00b17c>] (ElfLoader_load+0x0/0x3b8 [syslink]) from [<bf002614>] (Loader_load+0xe4/0x160 [syslink])
    [<bf002530>] (Loader_load+0x0/0x160 [syslink]) from [<bf004cf8>] (ProcMgr_load+0x224/0x320 [syslink])
    [<bf004ad4>] (ProcMgr_load+0x0/0x320 [syslink]) from [<bf0095ec>] (ProcMgrDrv_ioctl+0xac8/0x1a7c [syslink])
    [<bf008b24>] (ProcMgrDrv_ioctl+0x0/0x1a7c [syslink]) from [<c00b5cc0>] (do_vfs_ioctl+0x538/0x5bc)
    r8:c002b164 r7:00000008 r6:befe7bc8 r5:c3e67080 r4:c4be6300
    [<c00b5788>] (do_vfs_ioctl+0x0/0x5bc) from [<c00b5d84>] (sys_ioctl+0x40/0x64)
    r9:c3886000 r8:c002b164 r7:00000008 r6:c020e0a2 r5:befe7bc8
    r4:c4be6300
    [<c00b5d44>] (sys_ioctl+0x0/0x64) from [<c002afe0>] (ret_fast_syscall+0x0/0x2c)
    r7:00000036 r6:befe7bc8 r5:00000000 r4:000251e8
    ---[ end trace c406dc4559d4f036 ]---
    BUG: Your driver calls ioremap() on system memory. This leads
    to architecturally unpredictable behaviour on ARMv6+, and ioremap()
    will fail in the next kernel release. Please fix your driver.
    ------------[ cut here ]------------

    When starting the ARM Application:

    BUG: Your driver calls ioremap() on system memory. This leads
    to architecturally unpredictable behaviour on ARMv6+, and ioremap()
    will fail in the next kernel release. Please fix your driver.
    ------------[ cut here ]------------
    WARNING: at arch/arm/mm/ioremap.c:211 __arm_ioremap_pfn_caller+0x58/0x168()
    Modules linked in: hwversion kandu_fpga kandu_gxaid syslink
    Backtrace:
    [<c002e4e0>] (dump_backtrace+0x0/0x110) from [<c02ccaa0>] (dump_stack+0x18/0x1c)
    r6:c03564f9 r5:000000d3 r4:00000000 r3:00000000
    [<c02cca88>] (dump_stack+0x0/0x1c) from [<c003d9a8>] (warn_slowpath_common+0x54/0x6c)
    [<c003d954>] (warn_slowpath_common+0x0/0x6c) from [<c003d9e4>] (warn_slowpath_null+0x24/0x2c)
    r8:00002000 r7:00000000 r6:00000000 r5:000c2010 r4:00020000
    r3:00000009
    [<c003d9c0>] (warn_slowpath_null+0x0/0x2c) from [<c00311f8>] (__arm_ioremap_pfn_caller+0x58/0x168)
    [<c00311a0>] (__arm_ioremap_pfn_caller+0x0/0x168) from [<c0031384>] (__arm_ioremap_caller+0x5c/0x64)
    [<c0031328>] (__arm_ioremap_caller+0x0/0x64) from [<c00349f8>] (davinci_ioremap+0x6c/0x74)
    r4:ffff0000
    [<c003498c>] (davinci_ioremap+0x0/0x74) from [<bf025dc0>] (MemoryOS_map+0x1f8/0x3bc [syslink])
    r8:00000005 r7:00000002 r6:ce170000 r5:00000000 r4:c3887d20
    r3:00000000
    [<bf025bc8>] (MemoryOS_map+0x0/0x3bc [syslink]) from [<bf006a94>] (_ProcMgr_map+0x1f0/0x528 [syslink])
    r7:00000002 r6:ce170000 r5:00000001 r4:c3887e00
    [<bf0068a4>] (_ProcMgr_map+0x0/0x528 [syslink]) from [<bf006ee8>] (ProcMgr_map+0x11c/0x1c0 [syslink])
    [<bf006dcc>] (ProcMgr_map+0x0/0x1c0 [syslink]) from [<bf013ea0>] (Platform_loadCallback+0x400/0x644 [syslink])
    r8:00000001 r7:00000000 r6:bf0e583c r5:00000000 r4:00000018
    [<bf013aa0>] (Platform_loadCallback+0x0/0x644 [syslink]) from [<bf0403a0>] (Ipc_control+0x68/0x168 [syslink])
    [<bf040338>] (Ipc_control+0x0/0x168 [syslink]) from [<bf07c508>] (IpcDrv_drvioctl+0xf4/0x624 [syslink])
    r7:00000005 r6:bec19c8c r5:c014f497 r4:00000000
    [<bf07c414>] (IpcDrv_drvioctl+0x0/0x624 [syslink]) from [<c00b5cc0>] (do_vfs_ioctl+0x538/0x5bc)
    [<c00b5788>] (do_vfs_ioctl+0x0/0x5bc) from [<c00b5d84>] (sys_ioctl+0x40/0x64)
    r9:c3886000 r8:c002b164 r7:00000005 r6:c014f497 r5:bec19c8c
    r4:c5946980
    [<c00b5d44>] (sys_ioctl+0x0/0x64) from [<c002afe0>] (ret_fast_syscall+0x0/0x2c)
    r7:00000036 r6:00008b04 r5:00000000 r4:00044bb0
    ---[ end trace c406dc4559d4f042 ]---
    --> App_create:
    App_create: Host is ready
    <-- App_create:
    --> App_exec:
    App_exec: sending message 1
    App_exec: sending message 2
    App_exec: sending message 3
    App_exec: message received, sending message 4
    App_exec: message received, sending message 5
    App_exec: message received, sending message 6
    App_exec: message received, sending message 7
    App_exec: message received, sending message 8
    App_exec: message received, sending message 9
    App_exec: message received, sending message 10
    App_exec: message received, sending message 11
    App_exec: message received, sending message 12
    App_exec: message received, sending message 13
    App_exec: message received, sending message 14
    App_exec: message received, sending message 15
    App_exec: message received
    App_exec: message received
    App_exec: message received
    <-- App_exec: 0
    <-- Main_main:
    <-- main:

    Regards,

    Taran