summaryrefslogtreecommitdiffstats
path: root/Documentation/filesystems/sysfs-pci.txt
diff options
context:
space:
mode:
authorAlex Williamson <alex.williamson@redhat.com>2010-07-19 09:45:34 -0600
committerJesse Barnes <jbarnes@virtuousgeek.org>2010-07-30 09:32:08 -0700
commit8633328be242677fdedc42052838dd0608e7f342 (patch)
tree20b16af605298a1d05973d7ec2d0a479412ed3e6 /Documentation/filesystems/sysfs-pci.txt
parent2491762cfb475dbdfa3db11ebea6de49f58b7fac (diff)
downloadtalos-op-linux-8633328be242677fdedc42052838dd0608e7f342.tar.gz
talos-op-linux-8633328be242677fdedc42052838dd0608e7f342.zip
PCI: Allow read/write access to sysfs I/O port resources
PCI sysfs resource files currently only allow mmap'ing. On x86 this works fine for memory backed BARs, but doesn't work at all for I/O port backed BARs. Add read/write to I/O port PCI sysfs resource files to allow userspace access to these device regions. Acked-by: Chris Wright <chrisw@redhat.com> Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'Documentation/filesystems/sysfs-pci.txt')
-rw-r--r--Documentation/filesystems/sysfs-pci.txt7
1 files changed, 5 insertions, 2 deletions
diff --git a/Documentation/filesystems/sysfs-pci.txt b/Documentation/filesystems/sysfs-pci.txt
index 85354b32d731..74eaac26f8b8 100644
--- a/Documentation/filesystems/sysfs-pci.txt
+++ b/Documentation/filesystems/sysfs-pci.txt
@@ -39,7 +39,7 @@ files, each with their own function.
local_cpus nearby CPU mask (cpumask, ro)
remove remove device from kernel's list (ascii, wo)
resource PCI resource host addresses (ascii, ro)
- resource0..N PCI resource N, if present (binary, mmap)
+ resource0..N PCI resource N, if present (binary, mmap, rw[1])
resource0_wc..N_wc PCI WC map resource N, if prefetchable (binary, mmap)
rom PCI ROM resource, if present (binary, ro)
subsystem_device PCI subsystem device (ascii, ro)
@@ -54,13 +54,16 @@ files, each with their own function.
binary - file contains binary data
cpumask - file contains a cpumask type
+[1] rw for RESOURCE_IO (I/O port) regions only
+
The read only files are informational, writes to them will be ignored, with
the exception of the 'rom' file. Writable files can be used to perform
actions on the device (e.g. changing config space, detaching a device).
mmapable files are available via an mmap of the file at offset 0 and can be
used to do actual device programming from userspace. Note that some platforms
don't support mmapping of certain resources, so be sure to check the return
-value from any attempted mmap.
+value from any attempted mmap. The most notable of these are I/O port
+resources, which also provide read/write access.
The 'enable' file provides a counter that indicates how many times the device
has been enabled. If the 'enable' file currently returns '4', and a '1' is
OpenPOWER on IntegriCloud