<?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のトピックiMX6: MSI-X not working</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/iMX6-MSI-X-not-working/m-p/695697#M107893</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using an iMX6 quad core running Linux v4.1.15 (Yocto) as a root complex. Currently whenever I try to get MSI-X implemented it fails even though the same driver code works when running my hardware with an Intel i7 (kernel v3). The APIs that fail are:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;pci_enable_msix()&lt;/LI&gt;&lt;LI&gt;pci_enable_msix_range()&lt;/LI&gt;&lt;LI&gt;pci_enable_msix_exact()&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;All of the above fail and return EINVAL (22). I am able to get a single MSI (non -X) working on the iMX6 with pci_enable_msi(). When running my driver on the iMX6 the pci_msix_vec_count() returns the correct MSI-X count which can also be verified through "lspci -v". According to the documentation MSI-X should be functional (as well as multi MSI).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Questions:&lt;/STRONG&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Does the iMX6 support MSI-X?&lt;/LI&gt;&lt;LI&gt;Does the iMX6 support multi MSI (non -X)?&lt;/LI&gt;&lt;LI&gt;Are there any kernel flags that need to be set in the configuration?&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Update:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I started looking through the kernel code to see where a EINVAL could be returned. Now, I am not a Linux expert so the following assumption may be wrong. When going down the path:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;pcie_enable_msix_range()&lt;UL&gt;&lt;LI&gt;msix_capability_init()&lt;UL&gt;&lt;LI&gt;pci_msi_setup_msi_irqs()&lt;UL&gt;&lt;LI&gt;arch_setup_msi_irq()&amp;nbsp; &amp;lt;-- HERE&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;I noticed that for x86 and PowerPC the arch_setup_msi_irq() is overridden under /arch/x86/kernel/x86_init.c and /arch/powerpc/kernel/msi.c. Within the generic function listed in /drivers/pci/msi.c there is a comment under arch_setup_msi_irqs() that states:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;If an architecture wants to support multiple MSI, it needs to override arch_setup_msi_irqs()&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I did a search across the Freescale kernel source and I could not find an override for the above function. This leads me to believe that MSI-X and multi MSI (non -X) are not implemented for the iMX6.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 29 Sep 2017 10:41:50 GMT</pubDate>
    <dc:creator>concerned12345</dc:creator>
    <dc:date>2017-09-29T10:41:50Z</dc:date>
    <item>
      <title>iMX6: MSI-X not working</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX6-MSI-X-not-working/m-p/695697#M107893</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using an iMX6 quad core running Linux v4.1.15 (Yocto) as a root complex. Currently whenever I try to get MSI-X implemented it fails even though the same driver code works when running my hardware with an Intel i7 (kernel v3). The APIs that fail are:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;pci_enable_msix()&lt;/LI&gt;&lt;LI&gt;pci_enable_msix_range()&lt;/LI&gt;&lt;LI&gt;pci_enable_msix_exact()&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;All of the above fail and return EINVAL (22). I am able to get a single MSI (non -X) working on the iMX6 with pci_enable_msi(). When running my driver on the iMX6 the pci_msix_vec_count() returns the correct MSI-X count which can also be verified through "lspci -v". According to the documentation MSI-X should be functional (as well as multi MSI).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Questions:&lt;/STRONG&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Does the iMX6 support MSI-X?&lt;/LI&gt;&lt;LI&gt;Does the iMX6 support multi MSI (non -X)?&lt;/LI&gt;&lt;LI&gt;Are there any kernel flags that need to be set in the configuration?&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Update:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I started looking through the kernel code to see where a EINVAL could be returned. Now, I am not a Linux expert so the following assumption may be wrong. When going down the path:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;pcie_enable_msix_range()&lt;UL&gt;&lt;LI&gt;msix_capability_init()&lt;UL&gt;&lt;LI&gt;pci_msi_setup_msi_irqs()&lt;UL&gt;&lt;LI&gt;arch_setup_msi_irq()&amp;nbsp; &amp;lt;-- HERE&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;I noticed that for x86 and PowerPC the arch_setup_msi_irq() is overridden under /arch/x86/kernel/x86_init.c and /arch/powerpc/kernel/msi.c. Within the generic function listed in /drivers/pci/msi.c there is a comment under arch_setup_msi_irqs() that states:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;If an architecture wants to support multiple MSI, it needs to override arch_setup_msi_irqs()&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I did a search across the Freescale kernel source and I could not find an override for the above function. This leads me to believe that MSI-X and multi MSI (non -X) are not implemented for the iMX6.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Sep 2017 10:41:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX6-MSI-X-not-working/m-p/695697#M107893</guid>
      <dc:creator>concerned12345</dc:creator>
      <dc:date>2017-09-29T10:41:50Z</dc:date>
    </item>
    <item>
      <title>Re: iMX6: MSI-X not working</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX6-MSI-X-not-working/m-p/695698#M107894</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi concerned12345&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;according to i.MX6SX Reference Manual it is supported only in EP mode.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/11863i9F376807DF3AA49A/image-size/large?v=v2&amp;amp;px=999" title="pastedImage_1.jpg" alt="pastedImage_1.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;BR /&gt;igor&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Sep 2017 23:53:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX6-MSI-X-not-working/m-p/695698#M107894</guid>
      <dc:creator>igorpadykov</dc:creator>
      <dc:date>2017-09-29T23:53:05Z</dc:date>
    </item>
    <item>
      <title>Re: iMX6: MSI-X not working</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX6-MSI-X-not-working/m-p/695699#M107895</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi I&lt;SPAN class=""&gt;gor,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;In the line above the one you've highlighted it states: &lt;/SPAN&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;SPAN class=""&gt;MSI interface is used only in EP mode&lt;/SPAN&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I have gotten single MSI to work by calling pci_enable_msi() while the iMX6 is acting as a root complex. If the iMX6 can receive MSI messages from an EP device as RC it should be able to receive MSI-X and multi MSI. I noticed that document is for the solo and I'm running the quad although I doubt there is much difference in this department.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the document assumes MSI only in EP when I've gotten it to work in RC could it also be missing RC information about MSI-X?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When looking at revision 4 (p 4190) of the same document I found MSI-X in RC for the iMX6Q:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/11838i2F8C5E209691491C/image-size/large?v=v2&amp;amp;px=999" title="Screenshot from 2017-10-02 03-17-14.png" alt="Screenshot from 2017-10-02 03-17-14.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also found the following on page 4117 of the rev. 4 document which states the iMX6 in RC mode can support/receive 32 interrupts per EP:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/11910iE1249CBCB319F8C7/image-size/large?v=v2&amp;amp;px=999" title="Screenshot from 2017-10-02 03-40-38.png" alt="Screenshot from 2017-10-02 03-40-38.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Oct 2017 07:59:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX6-MSI-X-not-working/m-p/695699#M107895</guid>
      <dc:creator>concerned12345</dc:creator>
      <dc:date>2017-10-02T07:59:44Z</dc:date>
    </item>
    <item>
      <title>Re: iMX6: MSI-X not working</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX6-MSI-X-not-working/m-p/695700#M107896</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi concerned12345&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table 48-2 rev.4 states the same, i.MX6Solo PCIe is the same as i.MX6Q.&lt;/P&gt;&lt;P&gt;page 4117 gives generic IP memory map, particular i.MX6 implementation may lack some features,&lt;/P&gt;&lt;P&gt;as stated on Table 48-2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;BR /&gt;igor&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Oct 2017 10:54:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX6-MSI-X-not-working/m-p/695700#M107896</guid>
      <dc:creator>igorpadykov</dc:creator>
      <dc:date>2017-10-02T10:54:24Z</dc:date>
    </item>
    <item>
      <title>Re: iMX6: MSI-X not working</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX6-MSI-X-not-working/m-p/695701#M107897</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Igor,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When looking at table 48-2 of rev. 4 on page 4053 I see it also says:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;MSI interface is used only in EP mode&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;In my previous post I stated that I am able to get MSI working when in RC mode so that above statement is false. Was table 48-2 of rev. 4 copied over from table 46-2 of rev. 1 without taking into account updates? I know there have been fixes to the PCIe driver code since kernel v3 for the iMX6.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't want this thread to turn into us quoting the spec sheet, is there a way to contact an engineer and ask if MSI-X and multi MSI (non -X) is supported an if so has it been tested with real hardware?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Oct 2017 14:40:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX6-MSI-X-not-working/m-p/695701#M107897</guid>
      <dc:creator>concerned12345</dc:creator>
      <dc:date>2017-10-02T14:40:09Z</dc:date>
    </item>
    <item>
      <title>Re: iMX6: MSI-X not working</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX6-MSI-X-not-working/m-p/695702#M107898</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am also checking for support of MSI-X in iMX6.&lt;/P&gt;&lt;P&gt;Could you please let me know whether iMX6 has support for MSI-X interrupts? If yes, apart from enabling kernel configuration CONFIG_PCI_MSI=y, any other extra configurations required?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Riyaz&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Mar 2018 10:36:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX6-MSI-X-not-working/m-p/695702#M107898</guid>
      <dc:creator>riyazurrahman</dc:creator>
      <dc:date>2018-03-08T10:36:08Z</dc:date>
    </item>
    <item>
      <title>Re: iMX6: MSI-X not working</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX6-MSI-X-not-working/m-p/695703#M107899</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Riyaz,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can try a mainline kernel with apply this series:&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://www.spinics.net/lists/linux-pci/msg69614.html" title="https://www.spinics.net/lists/linux-pci/msg69614.html"&gt;[PATCH v8 0/9] PCI: dwc: Enables MSI-X driver support — Linux PCI&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Mar 2018 13:29:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX6-MSI-X-not-working/m-p/695703#M107899</guid>
      <dc:creator>fabio_estevam</dc:creator>
      <dc:date>2018-03-08T13:29:12Z</dc:date>
    </item>
    <item>
      <title>Re: iMX6: MSI-X not working</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX6-MSI-X-not-working/m-p/695704#M107900</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Fabio,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for providing this info. We are working with 4.9.11 kernel version. Is there any patch-set available for this version?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Riyaz&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Mar 2018 15:14:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX6-MSI-X-not-working/m-p/695704#M107900</guid>
      <dc:creator>riyazurrahman</dc:creator>
      <dc:date>2018-03-08T15:14:29Z</dc:date>
    </item>
    <item>
      <title>Re: iMX6: MSI-X not working</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX6-MSI-X-not-working/m-p/695705#M107901</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Riyaz,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This patch series is not availabe on 4.9. It has not even reached mainline yet, so you will need to use a mainline kernel and manually apply them.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Mar 2018 20:46:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX6-MSI-X-not-working/m-p/695705#M107901</guid>
      <dc:creator>fabio_estevam</dc:creator>
      <dc:date>2018-03-08T20:46:06Z</dc:date>
    </item>
    <item>
      <title>Re: iMX6: MSI-X not working</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX6-MSI-X-not-working/m-p/695706#M107902</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry for the late reply but I already solved this sometime back with patches. Please see my post:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.nxp.com/thread/464959"&gt;SOLVED: i.MX6 and Multi MSI Working&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 May 2018 15:14:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX6-MSI-X-not-working/m-p/695706#M107902</guid>
      <dc:creator>concerned12345</dc:creator>
      <dc:date>2018-05-03T15:14:02Z</dc:date>
    </item>
  </channel>
</rss>

