Acquiring MSI vector physical address from kernel driver
Ramon Fried
ramon.fried at tandemg.com
Mon Jan 25 14:50:04 EST 2016
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
More information about the Kernelnewbies
mailing list