Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 88903
b: refs/heads/master
c: dee7cbb
h: refs/heads/master
i:
  88901: ddd518f
  88899: cd5c70b
  88895: af39578
v: v3
  • Loading branch information
Venki Pallipadi authored and Ingo Molnar committed Apr 17, 2008
1 parent 7987d26 commit 87ead84
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9307cacad0dfe3749f00303125c6f7f0523e5616
refs/heads/master: dee7cbb210fdd266ad81af4689bcbac3649f38ff
11 changes: 9 additions & 2 deletions trunk/arch/x86/mm/ioremap.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ static void __iomem *__ioremap(resource_size_t phys_addr, unsigned long size,
struct vm_struct *area;
unsigned long new_prot_val;
pgprot_t prot;
int retval;

/* Don't allow wraparound or zero size */
last_addr = phys_addr + size - 1;
Expand Down Expand Up @@ -163,8 +164,14 @@ static void __iomem *__ioremap(resource_size_t phys_addr, unsigned long size,
phys_addr &= PAGE_MASK;
size = PAGE_ALIGN(last_addr+1) - phys_addr;

if (reserve_memtype(phys_addr, phys_addr + size,
prot_val, &new_prot_val)) {
retval = reserve_memtype(phys_addr, phys_addr + size,
prot_val, &new_prot_val);
if (retval) {
printk("reserve_memtype returned %d\n", retval);
return NULL;
}

if (prot_val != new_prot_val) {
/*
* Do not fallback to certain memory types with certain
* requested type:
Expand Down
7 changes: 6 additions & 1 deletion trunk/arch/x86/pci/i386.c
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,7 @@ int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
unsigned long len = vma->vm_end - vma->vm_start;
unsigned long flags;
unsigned long new_flags;
int retval;

/* I/O space cannot be accessed via normal processor loads and
* stores on this platform.
Expand All @@ -344,7 +345,11 @@ int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
vma->vm_page_prot = __pgprot(prot);

flags = pgprot_val(vma->vm_page_prot) & _PAGE_CACHE_MASK;
if (reserve_memtype(addr, addr + len, flags, &new_flags)) {
retval = reserve_memtype(addr, addr + len, flags, &new_flags);
if (retval)
return retval;

if (flags != new_flags) {
/*
* Do not fallback to certain memory types with certain
* requested type:
Expand Down

0 comments on commit 87ead84

Please sign in to comment.