summaryrefslogtreecommitdiffstats
path: root/arch/sparc64
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-11-02 19:16:44 +0100
committerLinus Torvalds <torvalds@linux-foundation.org>2008-11-02 19:16:44 +0100
commit0bf82cccd1e17135f880c161bc7926f5b25df34c (patch)
tree45935237f81b08d34f52c7bf5fe8d3d3c6a8b11b /arch/sparc64
parentMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6 (diff)
parentsparc64: Fix PCI resource mapping on sparc64 (diff)
downloadlinux-0bf82cccd1e17135f880c161bc7926f5b25df34c.tar.xz
linux-0bf82cccd1e17135f880c161bc7926f5b25df34c.zip
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6: sparc64: Fix PCI resource mapping on sparc64 sparc64: Kill annoying warning when building compat_binfmt_elf.o sparc32: kernel/trace/trace.c wants DIE_OOPS sparc64: Fix __copy_{to,from}_user_inatomic defines.
Diffstat (limited to 'arch/sparc64')
-rw-r--r--arch/sparc64/kernel/pci.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/arch/sparc64/kernel/pci.c b/arch/sparc64/kernel/pci.c
index 242ac1ccae7d..bdb7c0a6d83d 100644
--- a/arch/sparc64/kernel/pci.c
+++ b/arch/sparc64/kernel/pci.c
@@ -889,6 +889,7 @@ static int __pci_mmap_make_offset(struct pci_dev *pdev,
for (i = 0; i <= PCI_ROM_RESOURCE; i++) {
struct resource *rp = &pdev->resource[i];
+ resource_size_t aligned_end;
/* Active? */
if (!rp->flags)
@@ -906,8 +907,15 @@ static int __pci_mmap_make_offset(struct pci_dev *pdev,
continue;
}
+ /* Align the resource end to the next page address.
+ * PAGE_SIZE intentionally added instead of (PAGE_SIZE - 1),
+ * because actually we need the address of the next byte
+ * after rp->end.
+ */
+ aligned_end = (rp->end + PAGE_SIZE) & PAGE_MASK;
+
if ((rp->start <= user_paddr) &&
- (user_paddr + user_size) <= (rp->end + 1UL))
+ (user_paddr + user_size) <= aligned_end)
break;
}