diff options
Diffstat (limited to 'arch/arm26/mm/memc.c')
-rw-r--r-- | arch/arm26/mm/memc.c | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/arch/arm26/mm/memc.c b/arch/arm26/mm/memc.c index 8e8a2bb2487d..34def6397c3c 100644 --- a/arch/arm26/mm/memc.c +++ b/arch/arm26/mm/memc.c | |||
@@ -79,12 +79,6 @@ pgd_t *get_pgd_slow(struct mm_struct *mm) | |||
79 | goto no_pgd; | 79 | goto no_pgd; |
80 | 80 | ||
81 | /* | 81 | /* |
82 | * This lock is here just to satisfy pmd_alloc and pte_lock | ||
83 | * FIXME: I bet we could avoid taking it pretty much altogether | ||
84 | */ | ||
85 | spin_lock(&mm->page_table_lock); | ||
86 | |||
87 | /* | ||
88 | * On ARM, first page must always be allocated since it contains | 82 | * On ARM, first page must always be allocated since it contains |
89 | * the machine vectors. | 83 | * the machine vectors. |
90 | */ | 84 | */ |
@@ -92,7 +86,7 @@ pgd_t *get_pgd_slow(struct mm_struct *mm) | |||
92 | if (!new_pmd) | 86 | if (!new_pmd) |
93 | goto no_pmd; | 87 | goto no_pmd; |
94 | 88 | ||
95 | new_pte = pte_alloc_kernel(mm, new_pmd, 0); | 89 | new_pte = pte_alloc_map(mm, new_pmd, 0); |
96 | if (!new_pte) | 90 | if (!new_pte) |
97 | goto no_pte; | 91 | goto no_pte; |
98 | 92 | ||
@@ -101,6 +95,7 @@ pgd_t *get_pgd_slow(struct mm_struct *mm) | |||
101 | init_pte = pte_offset(init_pmd, 0); | 95 | init_pte = pte_offset(init_pmd, 0); |
102 | 96 | ||
103 | set_pte(new_pte, *init_pte); | 97 | set_pte(new_pte, *init_pte); |
98 | pte_unmap(new_pte); | ||
104 | 99 | ||
105 | /* | 100 | /* |
106 | * the page table entries are zeroed | 101 | * the page table entries are zeroed |
@@ -112,23 +107,14 @@ pgd_t *get_pgd_slow(struct mm_struct *mm) | |||
112 | memcpy(new_pgd + FIRST_KERNEL_PGD_NR, init_pgd + FIRST_KERNEL_PGD_NR, | 107 | memcpy(new_pgd + FIRST_KERNEL_PGD_NR, init_pgd + FIRST_KERNEL_PGD_NR, |
113 | (PTRS_PER_PGD - FIRST_KERNEL_PGD_NR) * sizeof(pgd_t)); | 108 | (PTRS_PER_PGD - FIRST_KERNEL_PGD_NR) * sizeof(pgd_t)); |
114 | 109 | ||
115 | spin_unlock(&mm->page_table_lock); | ||
116 | |||
117 | /* update MEMC tables */ | 110 | /* update MEMC tables */ |
118 | cpu_memc_update_all(new_pgd); | 111 | cpu_memc_update_all(new_pgd); |
119 | return new_pgd; | 112 | return new_pgd; |
120 | 113 | ||
121 | no_pte: | 114 | no_pte: |
122 | spin_unlock(&mm->page_table_lock); | ||
123 | pmd_free(new_pmd); | 115 | pmd_free(new_pmd); |
124 | free_pgd_slow(new_pgd); | ||
125 | return NULL; | ||
126 | |||
127 | no_pmd: | 116 | no_pmd: |
128 | spin_unlock(&mm->page_table_lock); | ||
129 | free_pgd_slow(new_pgd); | 117 | free_pgd_slow(new_pgd); |
130 | return NULL; | ||
131 | |||
132 | no_pgd: | 118 | no_pgd: |
133 | return NULL; | 119 | return NULL; |
134 | } | 120 | } |