diff options
Diffstat (limited to 'arch/sparc/mm/generic.c')
-rw-r--r-- | arch/sparc/mm/generic.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/arch/sparc/mm/generic.c b/arch/sparc/mm/generic.c index 20ccb957fb77..9604893ffdbd 100644 --- a/arch/sparc/mm/generic.c +++ b/arch/sparc/mm/generic.c | |||
@@ -73,14 +73,16 @@ int io_remap_pfn_range(struct vm_area_struct *vma, unsigned long from, | |||
73 | int space = GET_IOSPACE(pfn); | 73 | int space = GET_IOSPACE(pfn); |
74 | unsigned long offset = GET_PFN(pfn) << PAGE_SHIFT; | 74 | unsigned long offset = GET_PFN(pfn) << PAGE_SHIFT; |
75 | 75 | ||
76 | /* See comment in mm/memory.c remap_pfn_range */ | ||
77 | vma->vm_flags |= VM_IO | VM_RESERVED; | ||
78 | |||
76 | prot = __pgprot(pg_iobits); | 79 | prot = __pgprot(pg_iobits); |
77 | offset -= from; | 80 | offset -= from; |
78 | dir = pgd_offset(mm, from); | 81 | dir = pgd_offset(mm, from); |
79 | flush_cache_range(vma, beg, end); | 82 | flush_cache_range(vma, beg, end); |
80 | 83 | ||
81 | spin_lock(&mm->page_table_lock); | ||
82 | while (from < end) { | 84 | while (from < end) { |
83 | pmd_t *pmd = pmd_alloc(current->mm, dir, from); | 85 | pmd_t *pmd = pmd_alloc(mm, dir, from); |
84 | error = -ENOMEM; | 86 | error = -ENOMEM; |
85 | if (!pmd) | 87 | if (!pmd) |
86 | break; | 88 | break; |
@@ -90,7 +92,6 @@ int io_remap_pfn_range(struct vm_area_struct *vma, unsigned long from, | |||
90 | from = (from + PGDIR_SIZE) & PGDIR_MASK; | 92 | from = (from + PGDIR_SIZE) & PGDIR_MASK; |
91 | dir++; | 93 | dir++; |
92 | } | 94 | } |
93 | spin_unlock(&mm->page_table_lock); | ||
94 | 95 | ||
95 | flush_tlb_range(vma, beg, end); | 96 | flush_tlb_range(vma, beg, end); |
96 | return error; | 97 | return error; |