LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Embedded & Single-board computer (https://www.linuxquestions.org/questions/linux-embedded-and-single-board-computer-78/)
-   -   Clarification of Proc Filesystem for PCIe (https://www.linuxquestions.org/questions/linux-embedded-and-single-board-computer-78/clarification-of-proc-filesystem-for-pcie-4175594850/)

khhyle 12-05-2016 02:26 PM

Clarification of Proc Filesystem for PCIe
 
I am relatively new to working with the Linux kernel and had a question about the proc fs and what exactly is going on.

I have been using the proc/bus/pci/xx/xx.x files to read config data (ID's, link status, etc.) for one of my PCI devices but I am curious.. is this proc file actually memory mapped to the device's configuration space? If I write to this proc file am I actually writing to the config registers of the device?

I am curious because I am trying to create a test where I stress the PCI link by writing to the device over the link for an extended period of time and record any correctable errors that occur. It is important that I am actually writing to the device and not just some sort of cached copy of the file somewhere that won't actually stress the link.

smallpond 12-06-2016 08:56 AM

Reads and writes are interpreted by kernel code, but generate reads and writes of PCI space.

http://lxr.free-electrons.com/source...i/proc.c?v=4.7

khhyle 12-06-2016 11:53 AM

Quote:

Originally Posted by smallpond (Post 5638633)
Reads and writes are interpreted by kernel code, but generate reads and writes of PCI space.

http://lxr.free-electrons.com/source...i/proc.c?v=4.7

Gotcha - so the proc file can be used as a tool to communicate with PCI space for both reads/writes.

Is there a method for interacting with PCI space that is more preferred by the community rather than using the proc file? Just out of curiosity.


All times are GMT -5. The time now is 08:34 PM.