* Acquiring MSI vector physical address from kernel driver
@ 2016-01-25 19:50 Ramon Fried
0 siblings, 0 replies; 2+ messages in thread
From: Ramon Fried @ 2016-01-25 19:50 UTC (permalink / raw)
To: kernelnewbies
Hi.
I'm currently developing a driver for a new PCIe device.
The specific PCIe device includes an embedded DMA engine that can be accessed by the host through the PCI configuration space on specific offset.
The DMA engine can trigger a MSI on DMA complete if the physical address of the actual vector is written to it.
I did some reading, and if I'm not mistaken, it appears that the kernel writes the physical address to the PCI device configuration space when enabling MSI.
I didn't find any API or an easy way of getting that address from the kernel given only the MSI number (ID).
I can read it (the PA) back from the PCI configuration space, but it seems wrong, as:
1. The kernel has written this value before, it should know this already.
2. Nobody else has done it (grepped the kernel for that)
Am I right in my observations ? Is there a better way to achieve that ?
Thanks,
Ramon
^ permalink raw reply [flat|nested] 2+ messages in thread
* Acquiring MSI vector physical address from kernel driver
@ 2016-03-29 10:42 Manoj Nayak
0 siblings, 0 replies; 2+ messages in thread
From: Manoj Nayak @ 2016-03-29 10:42 UTC (permalink / raw)
To: kernelnewbies
In the following code, msi lower address, higher address and data
is written to msi_desc corresponding to a msi vector.
http://lxr.free-electrons.com/source/drivers/pci/msi.c#L311
We can get the msi message from irq using irq_get_msi_desc().
http://lxr.free-electrons.com/source/drivers/pci/msi.c#L349
struct msi_desc *entry = irq_get_msi_desc(irq);
Regards
Manoj Nayak
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20160329/2d9bfba1/attachment.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-03-29 10:42 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-29 10:42 Acquiring MSI vector physical address from kernel driver Manoj Nayak
-- strict thread matches above, loose matches on Subject: below --
2016-01-25 19:50 Ramon Fried
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).