diff options
Diffstat (limited to 'arch/sparc64/mm/generic.c')
-rw-r--r-- | arch/sparc64/mm/generic.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/arch/sparc64/mm/generic.c b/arch/sparc64/mm/generic.c index c954d91f01d0..112c316e7cd2 100644 --- a/arch/sparc64/mm/generic.c +++ b/arch/sparc64/mm/generic.c | |||
@@ -127,14 +127,16 @@ int io_remap_pfn_range(struct vm_area_struct *vma, unsigned long from, | |||
127 | int space = GET_IOSPACE(pfn); | 127 | int space = GET_IOSPACE(pfn); |
128 | unsigned long offset = GET_PFN(pfn) << PAGE_SHIFT; | 128 | unsigned long offset = GET_PFN(pfn) << PAGE_SHIFT; |
129 | 129 | ||
130 | /* See comment in mm/memory.c remap_pfn_range */ | ||
131 | vma->vm_flags |= VM_IO | VM_RESERVED; | ||
132 | |||
130 | prot = __pgprot(pg_iobits); | 133 | prot = __pgprot(pg_iobits); |
131 | offset -= from; | 134 | offset -= from; |
132 | dir = pgd_offset(mm, from); | 135 | dir = pgd_offset(mm, from); |
133 | flush_cache_range(vma, beg, end); | 136 | flush_cache_range(vma, beg, end); |
134 | 137 | ||
135 | spin_lock(&mm->page_table_lock); | ||
136 | while (from < end) { | 138 | while (from < end) { |
137 | pud_t *pud = pud_alloc(current->mm, dir, from); | 139 | pud_t *pud = pud_alloc(mm, dir, from); |
138 | error = -ENOMEM; | 140 | error = -ENOMEM; |
139 | if (!pud) | 141 | if (!pud) |
140 | break; | 142 | break; |
@@ -144,8 +146,7 @@ int io_remap_pfn_range(struct vm_area_struct *vma, unsigned long from, | |||
144 | from = (from + PGDIR_SIZE) & PGDIR_MASK; | 146 | from = (from + PGDIR_SIZE) & PGDIR_MASK; |
145 | dir++; | 147 | dir++; |
146 | } | 148 | } |
147 | flush_tlb_range(vma, beg, end); | ||
148 | spin_unlock(&mm->page_table_lock); | ||
149 | 149 | ||
150 | flush_tlb_range(vma, beg, end); | ||
150 | return error; | 151 | return error; |
151 | } | 152 | } |