summaryrefslogtreecommitdiffstats
path: root/Documentation/filesystems
diff options
context:
space:
mode:
authorDavid Woodhouse <dwmw@amazon.co.uk>2017-04-12 14:25:54 +0200
committerBjorn Helgaas <bhelgaas@google.com>2017-04-18 20:01:42 +0200
commitae749c7ab475de2c9c427058db19921c91846e89 (patch)
tree0fbb5e8de9c0827c196f5296409622beb5e9aec9 /Documentation/filesystems
parentxtensa/PCI: Do not mmap PCI BARs to userspace as write-through (diff)
downloadlinux-ae749c7ab475de2c9c427058db19921c91846e89.tar.xz
linux-ae749c7ab475de2c9c427058db19921c91846e89.zip
PCI: Add arch_can_pci_mmap_wc() macro
Most of the almost-identical versions of pci_mmap_page_range() silently ignore the 'write_combine' argument and give uncached mappings. Yet we allow the PCIIOC_WRITE_COMBINE ioctl in /proc/bus/pci, expose the 'resourceX_wc' file in sysfs, and allow an attempted mapping to apparently succeed. To fix this, introduce a macro arch_can_pci_mmap_wc() which indicates whether the platform can do a write-combining mapping. On x86 this ends up being pat_enabled(), while the few other platforms that support it can just set it to a literal '1'. Signed-off-by: David Woodhouse <dwmw@amazon.co.uk> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'Documentation/filesystems')
-rw-r--r--Documentation/filesystems/sysfs-pci.txt4
1 files changed, 4 insertions, 0 deletions
diff --git a/Documentation/filesystems/sysfs-pci.txt b/Documentation/filesystems/sysfs-pci.txt
index 6ea1ceda6f52..25b7f1c1b868 100644
--- a/Documentation/filesystems/sysfs-pci.txt
+++ b/Documentation/filesystems/sysfs-pci.txt
@@ -117,6 +117,10 @@ code must define HAVE_PCI_MMAP and provide a pci_mmap_page_range function.
Platforms are free to only support subsets of the mmap functionality, but
useful return codes should be provided.
+Platforms which support write-combining maps of PCI resources must define
+arch_can_pci_mmap_wc() which shall evaluate to non-zero at runtime when
+write-combining is permitted.
+
Legacy resources are protected by the HAVE_PCI_LEGACY define. Platforms
wishing to support legacy functionality should define it and provide
pci_legacy_read, pci_legacy_write and pci_mmap_legacy_page_range functions.