[PATCH] Fix PCI resource mmaping on sparc64

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Max Dmitrichenko
Date: Friday, October 31, 2008 - 6:09 am

There is a problem discovered in recent versions of ATI Mach64 driver
in X.org on sparc64 architecture. In short, the driver fails to mmap
MMIO aperture (PCI resource #2).

I've found that kernel's __pci_mmap_make_offset() returns EINVAL. It
checks whether user attempts to mmap more than the resource length,
which is 0x1000 bytes in our case. But PAGE_SIZE on SPARC64 is 0x2000
and this is what actually is being mmaped. So __pci_mmap_make_offset()
failed for this PCI resource.

Signed-off-by: Max Dmitrichenko <dmitrmax@gmail.com>

Code seems to be rather old. At least it was the same in 2.6.24. I
have no explanation why this bug exposed only now. May be before X.org
used to use some other method to mmap PCI resource into userspace (now
it uses libpciaccess).

The patch is against 2.6.26. Greg, please consider to include it into
the stable trees.

Please put me in CC if you're replying this message.

--
Max
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] Fix PCI resource mmaping on sparc64, Max Dmitrichenko, (Fri Oct 31, 6:09 am)
Re: [PATCH] Fix PCI resource mmaping on sparc64, David Miller, (Fri Oct 31, 12:02 pm)