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>
Showing
- Documentation/filesystems/sysfs-pci.txt 4 additions, 0 deletionsDocumentation/filesystems/sysfs-pci.txt
- arch/ia64/include/asm/pci.h 2 additions, 0 deletionsarch/ia64/include/asm/pci.h
- arch/powerpc/include/asm/pci.h 3 additions, 2 deletionsarch/powerpc/include/asm/pci.h
- arch/x86/include/asm/pci.h 2 additions, 0 deletionsarch/x86/include/asm/pci.h
- drivers/pci/pci-sysfs.c 2 additions, 2 deletionsdrivers/pci/pci-sysfs.c
- drivers/pci/proc.c 8 additions, 7 deletionsdrivers/pci/proc.c
- include/linux/pci.h 4 additions, 0 deletionsinclude/linux/pci.h
Please register or sign in to comment