<?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>i.MX Processors中的主题 MCC kernel driver for Linux  (IMX6x)</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/MCC-kernel-driver-for-Linux-IMX6x/m-p/459973#M72123</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm working on a kernel driver to expose multiple MCC ports to user space and having the following issues:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;mcc_recv not waking up the the receive thread&amp;nbsp; when M4 writes a packet to A9 Port:&lt;UL&gt;&lt;LI&gt;The driver is designed to have a thread per port calling the mcc_recv API for each port with a infinite time out.&amp;nbsp; &lt;/LI&gt;&lt;LI&gt;If the mcc_recv timeout is changed to say 255ms; then the receive rate increases to the delay time.&amp;nbsp;&amp;nbsp; Some times a packet does wake the thread.&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;If two threads are accessing the API MCC API (mcc_recv and mcc_write) at the same time it seems there is a race condition locking up the A9 side.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Linux side (A9):&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Driver&lt;UL&gt;&lt;LI&gt;(1) thread for each port; there are currently only 2 threads running.&lt;UL&gt;&lt;LI&gt;When a packet is received via mcc_recv, it is put into a queue different queue for each port.&amp;nbsp; &lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;API for poll, read, write.&lt;UL&gt;&lt;LI&gt;Poll :checks if there is any packets in a queue, if empty assigns a wait for a callback&lt;/LI&gt;&lt;LI&gt;Write: writes to the MCC port via mcc_write&lt;/LI&gt;&lt;LI&gt;Read: Allows using O_NONBLOCK, no calls to mcc_recv, in this function.&amp;nbsp; If there is no packet return -EAGAIN&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;User app&lt;UL&gt;&lt;LI&gt;loop that writes a packet and waits on a read using epoll&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MQX (M4)&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;two threads for each MCC port &lt;UL&gt;&lt;LI&gt;Thread&lt;UL&gt;&lt;LI&gt;Waits of a mcc_recv when a packet is received sends it back on the sender port.&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestions?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 31 Dec 2015 13:37:52 GMT</pubDate>
    <dc:creator>tcmichals</dc:creator>
    <dc:date>2015-12-31T13:37:52Z</dc:date>
    <item>
      <title>MCC kernel driver for Linux  (IMX6x)</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/MCC-kernel-driver-for-Linux-IMX6x/m-p/459973#M72123</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm working on a kernel driver to expose multiple MCC ports to user space and having the following issues:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;mcc_recv not waking up the the receive thread&amp;nbsp; when M4 writes a packet to A9 Port:&lt;UL&gt;&lt;LI&gt;The driver is designed to have a thread per port calling the mcc_recv API for each port with a infinite time out.&amp;nbsp; &lt;/LI&gt;&lt;LI&gt;If the mcc_recv timeout is changed to say 255ms; then the receive rate increases to the delay time.&amp;nbsp;&amp;nbsp; Some times a packet does wake the thread.&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;If two threads are accessing the API MCC API (mcc_recv and mcc_write) at the same time it seems there is a race condition locking up the A9 side.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Linux side (A9):&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Driver&lt;UL&gt;&lt;LI&gt;(1) thread for each port; there are currently only 2 threads running.&lt;UL&gt;&lt;LI&gt;When a packet is received via mcc_recv, it is put into a queue different queue for each port.&amp;nbsp; &lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;API for poll, read, write.&lt;UL&gt;&lt;LI&gt;Poll :checks if there is any packets in a queue, if empty assigns a wait for a callback&lt;/LI&gt;&lt;LI&gt;Write: writes to the MCC port via mcc_write&lt;/LI&gt;&lt;LI&gt;Read: Allows using O_NONBLOCK, no calls to mcc_recv, in this function.&amp;nbsp; If there is no packet return -EAGAIN&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;User app&lt;UL&gt;&lt;LI&gt;loop that writes a packet and waits on a read using epoll&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MQX (M4)&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;two threads for each MCC port &lt;UL&gt;&lt;LI&gt;Thread&lt;UL&gt;&lt;LI&gt;Waits of a mcc_recv when a packet is received sends it back on the sender port.&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestions?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Dec 2015 13:37:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/MCC-kernel-driver-for-Linux-IMX6x/m-p/459973#M72123</guid>
      <dc:creator>tcmichals</dc:creator>
      <dc:date>2015-12-31T13:37:52Z</dc:date>
    </item>
    <item>
      <title>Re: MCC kernel driver for Linux  (IMX6x)</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/MCC-kernel-driver-for-Linux-IMX6x/m-p/459974#M72124</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've had similar issues with the mcc driver.&amp;nbsp; mcc_recv() isn't thread safe.&amp;nbsp; If one thread is waiting on mcc_recv() and another thread does anything else mcc related - mcc_recv(), mcc_send(), mcc_create_endpoint(), etc - the driver locks up.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've had to collapse all mcc traffic to a single process and single thread, alternate between send and receive with short timeouts, and bridge the data to other processes over ipc - terribly inefficient and keeps the CPU busy.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A true epoll-compliant driver is needed. I looked into this as well. It seems feasible since MCC_SIGNAL identifies the destination node and port for a received buffer; the isr just isn't using this info to distribute the buffer anywhere specific.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you have a github project for this effort, I'll gladly contribute.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Feb 2016 16:57:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/MCC-kernel-driver-for-Linux-IMX6x/m-p/459974#M72124</guid>
      <dc:creator>readonly</dc:creator>
      <dc:date>2016-02-05T16:57:19Z</dc:date>
    </item>
    <item>
      <title>Re: MCC kernel driver for Linux  (IMX6x)</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/MCC-kernel-driver-for-Linux-IMX6x/m-p/459975#M72125</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I stopped using MCC and moved to rpmsg.&amp;nbsp; I ported rpmsg to MQX, I think the udoo Neo project might use it the code.&amp;nbsp; But, I'm now only using FreeRTOS for the M4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the Linux side I'm using &lt;A href="https://github.com/tcmichals/rpmsg-neo" title="https://github.com/tcmichals/rpmsg-neo"&gt;GitHub - tcmichals/rpmsg-neo: General rpmsg for TTY and usr space interface using multiple endpoints&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The idea being TTY endpnt&amp;nbsp; a "clear" interface, for general Apps and working on a LwIP one also.&amp;nbsp; So, now the M4 can use sockets to do file transfers, NTP , etc.&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Feb 2016 17:45:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/MCC-kernel-driver-for-Linux-IMX6x/m-p/459975#M72125</guid>
      <dc:creator>tcmichals</dc:creator>
      <dc:date>2016-02-05T17:45:39Z</dc:date>
    </item>
    <item>
      <title>Re: MCC kernel driver for Linux  (IMX6x)</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/MCC-kernel-driver-for-Linux-IMX6x/m-p/459976#M72126</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tim,&lt;/P&gt;&lt;P&gt;Is the rpmsg to MQX port code available somewhere? I'm interested in trying it out on MQX 4.2&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 19 Aug 2017 05:41:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/MCC-kernel-driver-for-Linux-IMX6x/m-p/459976#M72126</guid>
      <dc:creator>dry</dc:creator>
      <dc:date>2017-08-19T05:41:02Z</dc:date>
    </item>
  </channel>
</rss>

