]> git.baikalelectronics.ru Git - kernel.git/commit
PCI: Add arch_can_pci_mmap_wc() macro
authorDavid Woodhouse <dwmw@amazon.co.uk>
Wed, 12 Apr 2017 12:25:54 +0000 (13:25 +0100)
committerBjorn Helgaas <bhelgaas@google.com>
Tue, 18 Apr 2017 18:01:42 +0000 (13:01 -0500)
commit07664009de5d652bbd01288528762d92de2b7711
tree0fbb5e8de9c0827c196f5296409622beb5e9aec9
parent577ddd7ede97c64d6f38afdf115ff31a026bae35
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>
Documentation/filesystems/sysfs-pci.txt
arch/ia64/include/asm/pci.h
arch/powerpc/include/asm/pci.h
arch/x86/include/asm/pci.h
drivers/pci/pci-sysfs.c
drivers/pci/proc.c
include/linux/pci.h