All of lore.kernel.org
 help / color / mirror / Atom feed
From: hancock@sedsystems.ca (Robert Hancock)
To: linux-arm-kernel@lists.infradead.org
Subject: iMX6 PCIe MSI issues
Date: Fri, 23 Nov 2018 16:17:05 -0600	[thread overview]
Message-ID: <aad42775-52b6-6086-60a8-e45a17d50960@sedsystems.ca> (raw)

I am working with a custom FPGA PCI Express endpoint connected to an NXP
iMX6D processor running the 4.19.2 kernel. It seems happy using INTx
interrupts but when trying to enable MSI the device driver is not
receiving any interrupts.

>From some register poking I have figured out:
-the MSI address set on the PCIe device is correctly set in the iMX MSI
controller's MSI Controller Address register (0x1ffc820)
-the interrupt vectors are enabled in the MSI controller's Interrupt
Enable register (0x1ffc828)
-the interrupt vectors are not masked in the MSI controller's Interrupt
Mask register (0x1ffc82c)
-The MSI controller's Interrupt Status register (0x1ffc830) shows that
the requested interrupt vectors are pending
-In the ARM GIC, vector 152 (for msi_ctrl_int) is enabled in the IS
enable register (0x00a01110), but not set in the IS pending (0x00a01210)
or IS active (0x00a01310) registers
-Vector 152 is not masked in the GPC interrupt mask (0x00a01310)
-Vector 152 is not active in the GPC interrupt status (0x00a01310)

So it appears the MSI controller is receiving and recognizing the MSI
from the device, but the interrupt is not making it into the GIC for
some reason. If I manually set vector 152 to pending in the GIC, the
dw_handle_msi_irq handler in pci-designware-host.c does get called along
with the interrupt handler(s) for the PCIe device, so it appears the
chain from that point on is working:

# devmem 0x00a01210 32 0x1000000

I found someone else reporting this in 2014 with an unknown kernel
version on the NXP forums here, but with no resolution listed there:

https://community.nxp.com/thread/318307

Any ideas on what may be going wrong? My next step may be to try an
older kernel version to see if this got broken at some point.

-- 
Robert Hancock
Senior Software Developer
SED Systems
Email: hancock at sedsystems.ca

             reply	other threads:[~2018-11-23 22:17 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-23 22:17 Robert Hancock [this message]
2018-11-26  1:53 ` iMX6 PCIe MSI issues Richard Zhu
2018-11-26 16:22   ` Robert Hancock
2018-11-26 16:31 ` Fabio Estevam
2018-11-26 16:31   ` Fabio Estevam
2018-11-26 17:09   ` Trent Piepho
2018-11-26 17:09     ` Trent Piepho
2018-11-26 19:24     ` Robert Hancock
2018-11-26 19:24       ` Robert Hancock
2018-11-27 18:53       ` Trent Piepho
2018-11-27 18:53         ` Trent Piepho

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aad42775-52b6-6086-60a8-e45a17d50960@sedsystems.ca \
    --to=hancock@sedsystems.ca \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.