Hello,
We switched to BSP-2.4-4, but now we have issues with serial UARTs. We are using uart at ttyO2 with hw flow ctrl (cts/rts) enabled to communicate with some chip at 3Mbps (actual throughput on ttyO2 during the streaming is around 1.3Mbps). On the previous BSP 2.3-2 this worked just fine, except note 1, see below. With the new BSP-2.4-4, we have troubles, like this:
-If we stream some bigger data on debug console (ttyO0), for example "cat command" some big file, streaming on ttyO2 is stuck and we lose data. If we copy rpm/BUILD/linux-xxx/drivers/tty/serial/omap-serial.c driver from BSP2.3-2 we don't lose data, but again we have issue from note 1.
Note 1: In both cases, if some message is printed from kernel for example
user.warn kernel: [ 602.206604] omap_device: omap_i2c.1: new worst case activate latency 0: 274658
we lost data (seems like ttyO2 is stuck again for some time, and we lose some packets since we have packet counter implement inside packets which are send over ttyO2). We simulated this by making Loadable module (like in chapter 7 Loadable Module Development from 1020203G_DM37x_Linux_BSP_UM.pdf) which printk some messages 50 bytes message at every 2 seconds, and we see data lost when we load and start this module.
We think that problem can be CPU overload since both UARTs use IRQs,
dmesg | grep irq
[ 0.818359] omap_uart.0: ttyO0 at MMIO 0x4806a000 (irq = 72) is a OMAP UART0
[ 1.926116] omap_uart.1: ttyO1 at MMIO 0x4806c000 (irq = 73) is a OMAP UART1
[ 1.935302] omap_uart.2: ttyO2 at MMIO 0x49020000 (irq = 74) is a OMAP UART2
and with top command we see that
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
10 root -51 0 0 0 0 S 9.1 0.0 0:05.61 irq/74-serial i
consumes around 10% CPU
so we want to switch UARTs to use DMA, if it is possible, to relax CPU.
Do you have some suggestions how to enable DMA to be used with UARTs?
We tried to set flag
uart->dma_enabled = 1;
inside arch/arm/mach-omap2/serial.c folder. We see that CPU load for IRQs is 0, while streaming, but again we lose data and after some time whole system hungs, with bunch of errors
[ 408.928863] DMA transaction error with device 54
[ 408.933776] omap3_l3_app_irq: L3_STATUS_0: 400000
[ 408.939666] kernel BUG at arch/arm/mach-omap2/omap_l3_smx.c:190!
[ 408.946044] Unable to handle kernel NULL pointer dereference at virtual address 00000000
[ 408.954589] pgd = c0004000
[ 408.957458] [00000000] *pgd=00000000
[ 408.961242] Internal error: Oops: 817 [#1]
[ 408.965576] Modules linked in: g_file_storage wl12xx wlcore mac80211 cfg80211 wlcore_sdio compat
[ 408.974945] CPU: 0 Not tainted (3.0.101-BSP-dm37x-2.4-4 #25)
[ 408.981323] PC is at __bug+0x1c/0x24
[ 408.985107] LR is at __bug+0x18/0x24
[ 408.988891] pc : [] lr : [] psr: 60000193
[ 408.988922] sp : cccc7de0 ip : cccc6000 fp : c0886634
[ 409.001007] r10: 00000000 r9 : c0e3504c r8 : 00000000
[ 409.006530] r7 : 00000000 r6 : 00400000 r5 : cf45ab40 r4 : c0886634
[ 409.013427] r3 : 00000000 r2 : 00000000 r1 : ceda3080 r0 : 0000004a
[ 409.020355] Flags: nZCv IRQs off FIQs on Mode SVC_32 ISA ARM Segment kernel
[ 409.028167] Control: 10c5387d Table: 8ee0c019 DAC: 00000015
[ 409.034240] Process irq/312-wl12xx (pid: 676, stack limit = 0xcccc62f0)
[ 409.041229] Stack: (0xcccc7de0 to 0xcccc8000)
[ 409.045837] 7de0: c0886634 c006bd98 00000002 60000193 00000256 c00744a0 c0886634 cf45ab40
[ 409.054504] 7e00: 0000000a c08f5980 00000000 c0e3504c 00000000 c00ce754 00000001 c00bf95c
[ 409.063140] 7e20: c0886678 c0886634 cf45ab40 c0886678 c08f5980 00000000 cef360c0 ffffffff
[ 409.071807] 7e40: 00001920 c00ce930 c0886634 c0886678 00000000 c00d09cc c08a2408 0000000a
[ 409.080444] 7e60: 00000000 c00ce3c8 c08a2408 c0045038 ffffffff fa200000 00003679 c0512078
[ 409.089080] 7e80: 00000001 c0903268 00000130 002e3bb2 c08f5980 a0000013 00003679 c08f5980
[ 409.097747] 7ea0: 00000000 cef360c0 ffffffff 00001920 0000005f cccc7ec8 c00bc2b4 c0511ea4
[ 409.106384] 7ec0: 20000013 ffffffff c08f5980 cef36600 00003679 c0096498 bf1a1ed8 a0000013
[ 409.115051] 7ee0: cef365d8 cf7d8440 cef36600 bf17c128 00000004 c00a2a64 00000000 cef360a0
[ 409.123687] 7f00: 00000000 cef36154 000000ff cef360c0 bf1a1ed8 bf17c128 22222222 bf1a0738
[ 409.132354] 7f20: cef36328 cef360a0 00000000 cef360c0 cef360fc cef36328 c0893160 ceda7ec0
[ 409.140991] 7f40: c070a948 bf180310 ceda7ec0 c089311c c089318c c089311c 00000001 c00cecd4
[ 409.149658] 7f60: cccc6000 ceda7edc c089318c c00cee18 c0893190 c08931b8 00000000 cccc7fac
[ 409.158294] 7f80: cee95e98 ceda7ec0 c00cecf0 00000000 00000000 00000000 00000000 c00a68c0
[ 409.166961] 7fa0: 00000002 00000000 ceda7ec0 00000000 00000001 dead4ead ffffffff ffffffff
[ 409.175598] 7fc0: c08f702c 00000000 00000000 c06510e8 00000000 c0051f30 cccc7fd8 cccc7fd8
[ 409.184234] 7fe0: 00000000 cee95e98 c00a6834 c0051f40 00000013 c0051f40 e59930b4 e3833901
[ 409.192932] [] (__bug+0x1c/0x24) from [] (omap2_iommu_set_twl+0x0/0x24)
[ 409.201782] Code: e306016c e34c0063 eb12e688 e3a03000 (e5833000)
[ 409.208374] ---[ end trace ce25ab719cdbaea4 ]---
[ 409.213287] Kernel panic - not syncing: Fatal exception in interrupt
[ 409.220092] [] (unwind_backtrace+0x0/0x138) from [] (panic+0x6c/0x1a4)
[ 409.228912] [] (panic+0x6c/0x1a4) from [] (die+0x2a4/0x300)
[ 409.236724] [] (die+0x2a4/0x300) from [] (__do_kernel_fault+0x74/0x84)
[ 409.245544] [] (__do_kernel_fault+0x74/0x84) from [] (do_page_fault+0xa0/0x360)
[ 409.255157] [] (do_page_fault+0xa0/0x360) from [] (do_DataAbort+0x34/0x98)
[ 409.264343] [] (do_DataAbort+0x34/0x98) from [] (__dabt_svc+0x4c/0x60)
[ 409.273132] Exception stack(0xcccc7d98 to 0xcccc7de0)
[ 409.278503] 7d80: 0000004a ceda3080
[ 409.287200] 7da0: 00000000 00000000 c0886634 cf45ab40 00400000 00000000 00000000 c0e3504c
[ 409.295898] 7dc0: 00000000 c0886634 cccc6000 cccc7de0 c005493c c0054940 60000193 ffffffff
[ 409.304626] [] (__dabt_svc+0x4c/0x60) from [] (__bug+0x1c/0x24)
[ 409.312774] [] (__bug+0x1c/0x24) from [] (omap2_iommu_set_twl+0x0/0x24)
Some solutions says to use "OMAP internal UART 8250 based driver"
but this driver isn't supported in BSP2.4-4. Do you have some BSP which support this driver? Or how we can add this driver inside current BSP?
Other solutions
https://e2e.ti.com/support/embedded/linux/f/354/t/387797
says to change .dma_enabled =
false
,
inside serial.c file but there is no that option (only uart->dma_enabled = 0;) which we changed to 1 as descibed above, but got kernel panic.
Thank you for your help.
Regards,
Zile