<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic iMX536 UART5 Linux driver interrupt handler delayed in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/iMX536-UART5-Linux-driver-interrupt-handler-delayed/m-p/426513#M64645</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;I have a RSB4210 board (i.MX536) from Advantech running Linux 2.6.35.3.&lt;/P&gt;&lt;P&gt;I am reading data from UART5 at 460800 bit/s.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have issues similar to those described at &lt;/SPAN&gt;&lt;A class="jive-link-thread-small" data-containerid="2004" data-containertype="14" data-objectid="357233" data-objecttype="1" href="https://community.freescale.com/thread/357233"&gt;https://community.freescale.com/thread/357233&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I can't just take latest freescale 2.6.35.11 kernel from git because it requires some RSB4210-specific changes.&lt;/P&gt;&lt;P&gt;So I have disabled DMA - set &lt;SPAN style="font-family: courier new,courier;"&gt;#define UART5_DMA_ENABLE 0&lt;/SPAN&gt; at &lt;SPAN style="font-family: courier new,courier;"&gt;arch/arm/mach-mx5/serial.h&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This improved the result, but the problem remains:&lt;/P&gt;&lt;P&gt;I constantly read data from UART5, but sometimes overruns occur and data gets corrupted.&lt;/P&gt;&lt;P&gt;This happens few times a second but if CPU load increases it happens more frequently.&lt;/P&gt;&lt;P&gt;Overrun counter "oe:" keeps increasing in &lt;SPAN style="font-family: courier new,courier;"&gt;/proc/tty/driver/ttymxc&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I looked into &lt;SPAN style="font-family: courier new,courier;"&gt;drivers/serial/mxc_uart.c&lt;/SPAN&gt; and found the following detail.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;mxcuart_int()&lt;/SPAN&gt; does all work and is called constantly with 100-200 microsecond intervals (depending on &lt;SPAN style="font-family: courier new,courier;"&gt;UART5_UFCR_RXTL&lt;/SPAN&gt; threshold).&lt;/P&gt;&lt;P&gt;But sometimes next &lt;SPAN style="font-family: courier new,courier;"&gt;mxcuart_int()&lt;/SPAN&gt; call happens in 5 milliseconds after its previous call.&lt;/P&gt;&lt;P&gt;In this situation driver detects overrun and increases "oe" counter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have turned off Ethernet but overruns still occur.&lt;/P&gt;&lt;P&gt;What can periodically delay &lt;SPAN style="font-family: courier new,courier;"&gt;mxcuart_int()&lt;/SPAN&gt; call for 5 milliseconds?&lt;/P&gt;&lt;P&gt;Eliminating that could probably fix my issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Vyacheslav.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 10 Aug 2015 11:51:39 GMT</pubDate>
    <dc:creator>vyacheslav_maty</dc:creator>
    <dc:date>2015-08-10T11:51:39Z</dc:date>
    <item>
      <title>iMX536 UART5 Linux driver interrupt handler delayed</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX536-UART5-Linux-driver-interrupt-handler-delayed/m-p/426513#M64645</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;I have a RSB4210 board (i.MX536) from Advantech running Linux 2.6.35.3.&lt;/P&gt;&lt;P&gt;I am reading data from UART5 at 460800 bit/s.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have issues similar to those described at &lt;/SPAN&gt;&lt;A class="jive-link-thread-small" data-containerid="2004" data-containertype="14" data-objectid="357233" data-objecttype="1" href="https://community.freescale.com/thread/357233"&gt;https://community.freescale.com/thread/357233&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I can't just take latest freescale 2.6.35.11 kernel from git because it requires some RSB4210-specific changes.&lt;/P&gt;&lt;P&gt;So I have disabled DMA - set &lt;SPAN style="font-family: courier new,courier;"&gt;#define UART5_DMA_ENABLE 0&lt;/SPAN&gt; at &lt;SPAN style="font-family: courier new,courier;"&gt;arch/arm/mach-mx5/serial.h&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This improved the result, but the problem remains:&lt;/P&gt;&lt;P&gt;I constantly read data from UART5, but sometimes overruns occur and data gets corrupted.&lt;/P&gt;&lt;P&gt;This happens few times a second but if CPU load increases it happens more frequently.&lt;/P&gt;&lt;P&gt;Overrun counter "oe:" keeps increasing in &lt;SPAN style="font-family: courier new,courier;"&gt;/proc/tty/driver/ttymxc&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I looked into &lt;SPAN style="font-family: courier new,courier;"&gt;drivers/serial/mxc_uart.c&lt;/SPAN&gt; and found the following detail.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;mxcuart_int()&lt;/SPAN&gt; does all work and is called constantly with 100-200 microsecond intervals (depending on &lt;SPAN style="font-family: courier new,courier;"&gt;UART5_UFCR_RXTL&lt;/SPAN&gt; threshold).&lt;/P&gt;&lt;P&gt;But sometimes next &lt;SPAN style="font-family: courier new,courier;"&gt;mxcuart_int()&lt;/SPAN&gt; call happens in 5 milliseconds after its previous call.&lt;/P&gt;&lt;P&gt;In this situation driver detects overrun and increases "oe" counter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have turned off Ethernet but overruns still occur.&lt;/P&gt;&lt;P&gt;What can periodically delay &lt;SPAN style="font-family: courier new,courier;"&gt;mxcuart_int()&lt;/SPAN&gt; call for 5 milliseconds?&lt;/P&gt;&lt;P&gt;Eliminating that could probably fix my issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Vyacheslav.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Aug 2015 11:51:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX536-UART5-Linux-driver-interrupt-handler-delayed/m-p/426513#M64645</guid>
      <dc:creator>vyacheslav_maty</dc:creator>
      <dc:date>2015-08-10T11:51:39Z</dc:date>
    </item>
  </channel>
</rss>

