linux-uconsole/arch
Suresh Siddha 538a6fdbcf x86/PCI/PAT: return EINVAL for pci mmap WC request for !pat_enabled
commit 2992e545ea upstream.

Thomas Schlichter reported:
> X.org uses libpciaccess which tries to mmap with write combining enabled via
> /sys/bus/pci/devices/*/resource0_wc. Currently, when PAT is not enabled, the
> kernel does fall back to uncached mmap. Then libpciaccess thinks it succeeded
> mapping with write combining enabled and does not set up suited MTRR entries.
> ;-(

Instead of silently mapping pci mmap region as UC minus in the case
of !pat_enabled and wc request, we can return error. Eric Anholt mentioned
that caller (like X) typically follows up with UC minus pci mmap request and
if there is a free mtrr slot, caller will manage adding WC mtrr.

Jesse Barnes says:
> Older versions of libpciaccess will behave better if we do it that way
> (iirc it only allocates an MTRR if the resource_wc file doesn't exist or
> fails to get mapped).

Reported-by: Thomas Schlichter <thomas.schlichter@web.de>
Signed-off-by: Thomas Schlichter <thomas.schlichter@web.de>
Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
Acked-by: Eric Anholt <eric@anholt.net>
Acked-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-01-25 10:49:41 -08:00
..
alpha untangle the do_mremap() mess 2010-01-18 10:19:11 -08:00
arm untangle the do_mremap() mess 2010-01-18 10:19:11 -08:00
avr32 untangle the do_mremap() mess 2010-01-18 10:19:11 -08:00
blackfin untangle the do_mremap() mess 2010-01-18 10:19:11 -08:00
cris untangle the do_mremap() mess 2010-01-18 10:19:11 -08:00
frv untangle the do_mremap() mess 2010-01-18 10:19:11 -08:00
h8300 untangle the do_mremap() mess 2010-01-18 10:19:11 -08:00
ia64 untangle the do_mremap() mess 2010-01-18 10:19:11 -08:00
m32r untangle the do_mremap() mess 2010-01-18 10:19:11 -08:00
m68k untangle the do_mremap() mess 2010-01-18 10:19:11 -08:00
m68knommu untangle the do_mremap() mess 2010-01-18 10:19:11 -08:00
microblaze untangle the do_mremap() mess 2010-01-18 10:19:11 -08:00
mips untangle the do_mremap() mess 2010-01-18 10:19:11 -08:00
mn10300 untangle the do_mremap() mess 2010-01-18 10:19:11 -08:00
parisc untangle the do_mremap() mess 2010-01-18 10:19:11 -08:00
powerpc PCI/cardbus: Add a fixup hook and fix powerpc 2010-01-22 15:18:26 -08:00
s390 untangle the do_mremap() mess 2010-01-18 10:19:11 -08:00
score untangle the do_mremap() mess 2010-01-18 10:19:11 -08:00
sh untangle the do_mremap() mess 2010-01-18 10:19:11 -08:00
sparc sparc64: Fix Niagara2 perf event handling. 2010-01-22 15:18:33 -08:00
um untangle the do_mremap() mess 2010-01-18 10:19:11 -08:00
x86 x86/PCI/PAT: return EINVAL for pci mmap WC request for !pat_enabled 2010-01-25 10:49:41 -08:00
xtensa untangle the do_mremap() mess 2010-01-18 10:19:11 -08:00
.gitignore
Kconfig oprofile: fix oprofile regression: select RING_BUFFER_ALLOW_SWAP 2009-09-17 15:53:42 -04:00