diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-16 13:44:35 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-16 13:44:35 -0400 |
commit | ebc283118ee448dcb6e6cae74a8a43f17a1ccc3f (patch) | |
tree | daeb82c70de678ac10a5cec153097294dd772cb1 /arch/mips/mm | |
parent | fc8a327db6c46de783b1a4276d846841b9abc24c (diff) | |
parent | 8bb00d83d8fc2de5c0614f5d55780107e0c375fe (diff) |
Merge branch 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus
* 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus:
[MIPS] Increase cp0 compare clockevent min_delta_ns from 0x30 to 0x300.
[MIPS] Cache: Provide more information on cache policy on bootup.
[MIPS] Fix aliasing bug in copy_user_highpage, take 2.
[MIPS] VPE loader: convert from struct class_ device to struct device
[MIPS] MIPSsim: Fix booting from NFS root
[MIPS] Alchemy: Get rid of au1xxx_irq_map_t.
[MIPS] Alchemy: Get rid of au_ffz().
[MIPS] Alchemy: Get rid of au_ffs().
[MIPS] Alchemy: cleanup interrupt code.
[MIPS] Lasat: Fix build by conversion to irq_cpu.c.
[MIPS] Lasat: Add #ifndef ... #endif include warpper to lasatint.h.
[MIPS] IP22: Enable -Werror.
[MIPS] IP22: Fix warning.
[MIPS] IP22: Complain if requesting the front panel irq failed.
[MIPS] vmlinux.lds.S: Handle KPROBES_TEXT.
[MIPS] vmlinux.lds.S: Fix handling of .notes in final link.
[MIPS] vmlinux.lds.S: Remove duplicate comment.
[MIPS] MSP71XX: Add workarounds file.
[MIPS] IP32: Fix build by conversion to irq_cpu.c.
Diffstat (limited to 'arch/mips/mm')
-rw-r--r-- | arch/mips/mm/c-r4k.c | 10 | ||||
-rw-r--r-- | arch/mips/mm/init.c | 19 |
2 files changed, 19 insertions, 10 deletions
diff --git a/arch/mips/mm/c-r4k.c b/arch/mips/mm/c-r4k.c index 971f6c047b8a..d7088331fb0f 100644 --- a/arch/mips/mm/c-r4k.c +++ b/arch/mips/mm/c-r4k.c | |||
@@ -983,11 +983,15 @@ static void __init probe_pcache(void) | |||
983 | 983 | ||
984 | printk("Primary instruction cache %ldkB, %s, %s, linesize %d bytes.\n", | 984 | printk("Primary instruction cache %ldkB, %s, %s, linesize %d bytes.\n", |
985 | icache_size >> 10, | 985 | icache_size >> 10, |
986 | cpu_has_vtag_icache ? "virtually tagged" : "physically tagged", | 986 | cpu_has_vtag_icache ? "VIVT" : "VIPT", |
987 | way_string[c->icache.ways], c->icache.linesz); | 987 | way_string[c->icache.ways], c->icache.linesz); |
988 | 988 | ||
989 | printk("Primary data cache %ldkB, %s, linesize %d bytes.\n", | 989 | printk("Primary data cache %ldkB, %s, %s, %s, linesize %d bytes\n", |
990 | dcache_size >> 10, way_string[c->dcache.ways], c->dcache.linesz); | 990 | dcache_size >> 10, way_string[c->dcache.ways], |
991 | (c->dcache.flags & MIPS_CACHE_PINDEX) ? "PIPT" : "VIPT", | ||
992 | (c->dcache.flags & MIPS_CACHE_ALIASES) ? | ||
993 | "cache aliases" : "no aliases", | ||
994 | c->dcache.linesz); | ||
991 | } | 995 | } |
992 | 996 | ||
993 | /* | 997 | /* |
diff --git a/arch/mips/mm/init.c b/arch/mips/mm/init.c index 5240432e6d1d..110ee7656b41 100644 --- a/arch/mips/mm/init.c +++ b/arch/mips/mm/init.c | |||
@@ -211,7 +211,7 @@ void copy_user_highpage(struct page *to, struct page *from, | |||
211 | void *vfrom, *vto; | 211 | void *vfrom, *vto; |
212 | 212 | ||
213 | vto = kmap_atomic(to, KM_USER1); | 213 | vto = kmap_atomic(to, KM_USER1); |
214 | if (cpu_has_dc_aliases && !Page_dcache_dirty(from)) { | 214 | if (cpu_has_dc_aliases && page_mapped(from)) { |
215 | vfrom = kmap_coherent(from, vaddr); | 215 | vfrom = kmap_coherent(from, vaddr); |
216 | copy_page(vto, vfrom); | 216 | copy_page(vto, vfrom); |
217 | kunmap_coherent(); | 217 | kunmap_coherent(); |
@@ -234,12 +234,15 @@ void copy_to_user_page(struct vm_area_struct *vma, | |||
234 | struct page *page, unsigned long vaddr, void *dst, const void *src, | 234 | struct page *page, unsigned long vaddr, void *dst, const void *src, |
235 | unsigned long len) | 235 | unsigned long len) |
236 | { | 236 | { |
237 | if (cpu_has_dc_aliases) { | 237 | if (cpu_has_dc_aliases && page_mapped(page)) { |
238 | void *vto = kmap_coherent(page, vaddr) + (vaddr & ~PAGE_MASK); | 238 | void *vto = kmap_coherent(page, vaddr) + (vaddr & ~PAGE_MASK); |
239 | memcpy(vto, src, len); | 239 | memcpy(vto, src, len); |
240 | kunmap_coherent(); | 240 | kunmap_coherent(); |
241 | } else | 241 | } else { |
242 | memcpy(dst, src, len); | 242 | memcpy(dst, src, len); |
243 | if (cpu_has_dc_aliases) | ||
244 | SetPageDcacheDirty(page); | ||
245 | } | ||
243 | if ((vma->vm_flags & VM_EXEC) && !cpu_has_ic_fills_f_dc) | 246 | if ((vma->vm_flags & VM_EXEC) && !cpu_has_ic_fills_f_dc) |
244 | flush_cache_page(vma, vaddr, page_to_pfn(page)); | 247 | flush_cache_page(vma, vaddr, page_to_pfn(page)); |
245 | } | 248 | } |
@@ -250,13 +253,15 @@ void copy_from_user_page(struct vm_area_struct *vma, | |||
250 | struct page *page, unsigned long vaddr, void *dst, const void *src, | 253 | struct page *page, unsigned long vaddr, void *dst, const void *src, |
251 | unsigned long len) | 254 | unsigned long len) |
252 | { | 255 | { |
253 | if (cpu_has_dc_aliases) { | 256 | if (cpu_has_dc_aliases && page_mapped(page)) { |
254 | void *vfrom = | 257 | void *vfrom = kmap_coherent(page, vaddr) + (vaddr & ~PAGE_MASK); |
255 | kmap_coherent(page, vaddr) + (vaddr & ~PAGE_MASK); | ||
256 | memcpy(dst, vfrom, len); | 258 | memcpy(dst, vfrom, len); |
257 | kunmap_coherent(); | 259 | kunmap_coherent(); |
258 | } else | 260 | } else { |
259 | memcpy(dst, src, len); | 261 | memcpy(dst, src, len); |
262 | if (cpu_has_dc_aliases) | ||
263 | SetPageDcacheDirty(page); | ||
264 | } | ||
260 | } | 265 | } |
261 | 266 | ||
262 | EXPORT_SYMBOL(copy_from_user_page); | 267 | EXPORT_SYMBOL(copy_from_user_page); |