2

I have a latency issue when using UART on Raspberry Pi 2 and I want to disable DMA when using UART driver. I know that the Raspberry Pi 2 uses ampa_pl011 and I don't want use DMA. Can you tell me how to do that on this driver?

I tried to comment this line in pl011_startup() function but seem that it not effect.

/* Startup DMA */
//pl011_dma_startup(uap);

Have anything more that we need to change?

  • What exactly do you mean by latency issue? – goldilocks Apr 2 '16 at 17:52
  • @goldilocks he may be experiencing an "overpoll" condition due to desktop-like preemption on low-HZ kernel timer – Alexey Vesnin Apr 2 '16 at 18:52
  • Hi goldilocks, latency is delay time between 2 byte sent, it's too long when run with my application base on uart. – dongpham Apr 2 '16 at 18:57
1

If the device chip/implementation requires DMA - you can not disable it, because there will be no way to transfer data there and back again. And - about the latency - usind DMA reduces latency, definitely not increasing it! You should try a different timer HZ frequencies for your kernel config to play with latencies, but never disable a DMA! Also try to change the preemption/task-switching algorythm in your kernel config. It seems that your kernel does not fit your task.

UPDATE: here is the video https://youtu.be/b-wYeuuxZnc

  • Thanks for your reply. Because I have same issue on freescale imx6 about latency , after that I resolved it by disable DMA in imx uart driver. How do you think if I do that on rpi2 ? 1. used DMA in imx_startup function : git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/… 2. remove DMA in imx_startup function, I resolved by do like that : git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/… – dongpham Apr 2 '16 at 16:02
  • The source way seems reasonable too, but I'd recommend to try a different hz/taskswitching algo first. I'm currently having no trouble with rpi2 uart at all : pi@pi ~ $ uname -a Linux pi.local 4.1.15-rpi #1 Wed Jan 13 00:48:00 UTC 2016 armv6l GNU/Linux – Alexey Vesnin Apr 2 '16 at 16:10
  • Thanks . But not easy to upgrade to new kernel because my application base on UART is wrote with kernel 3.18. On this kernel version, will not happen if I use sample application on uart, just happen latency with my application. The same on imx6. – dongpham Apr 2 '16 at 16:18
  • About different hz/taskswitching. Can you tell me how to do that? – dongpham Apr 2 '16 at 16:21
  • make menuconfig and try to switch options in timer frequency and Preemption Type. Kernel 3.18 is way too old, try a mainline one? – Alexey Vesnin Apr 2 '16 at 16:30
0

I have resolved my issue. Because my application just send 1 byte at time but FIFO in uart driver setting with 8 byte FIFO trigger. That's root cause, we just need reduce down to 1 byte FIFO trigger. Thanks everyone, Thanks Alex so much for your support.!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.