Skip to content

Commit

Permalink
Merge branch 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-…
Browse files Browse the repository at this point in the history
…linus

* 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus:
  MIPS: R2: Fix problem with code that incorrectly modifies ebase.
  MIPS: Change {set,clear,change}_c0_<foo> to return old value.
  MIPS: compat: Remove duplicated #include
  MIPS: VR5500: Enable prefetch
  MIPS: Fix oops in dma_unmap_page on not coherent mips platforms
  • Loading branch information
Linus Torvalds committed Mar 26, 2009
2 parents 1b5e62b + 9fb4c2b commit 1646df4
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 19 deletions.
22 changes: 11 additions & 11 deletions arch/mips/include/asm/mipsregs.h
Original file line number Diff line number Diff line change
Expand Up @@ -1391,36 +1391,36 @@ static inline void tlb_write_random(void)
static inline unsigned int \
set_c0_##name(unsigned int set) \
{ \
unsigned int res; \
unsigned int res, new; \
\
res = read_c0_##name(); \
res |= set; \
write_c0_##name(res); \
new = res | set; \
write_c0_##name(new); \
\
return res; \
} \
\
static inline unsigned int \
clear_c0_##name(unsigned int clear) \
{ \
unsigned int res; \
unsigned int res, new; \
\
res = read_c0_##name(); \
res &= ~clear; \
write_c0_##name(res); \
new = res & ~clear; \
write_c0_##name(new); \
\
return res; \
} \
\
static inline unsigned int \
change_c0_##name(unsigned int change, unsigned int new) \
change_c0_##name(unsigned int change, unsigned int val) \
{ \
unsigned int res; \
unsigned int res, new; \
\
res = read_c0_##name(); \
res &= ~change; \
res |= (new & change); \
write_c0_##name(res); \
new = res & ~change; \
new |= (val & change); \
write_c0_##name(new); \
\
return res; \
}
Expand Down
1 change: 0 additions & 1 deletion arch/mips/kernel/linux32.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
#include <linux/module.h>
#include <linux/binfmts.h>
#include <linux/security.h>
#include <linux/syscalls.h>
#include <linux/compat.h>
#include <linux/vfs.h>
#include <linux/ipc.h>
Expand Down
12 changes: 7 additions & 5 deletions arch/mips/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -1520,7 +1520,9 @@ void __cpuinit per_cpu_trap_init(void)
#endif /* CONFIG_MIPS_MT_SMTC */

if (cpu_has_veic || cpu_has_vint) {
unsigned long sr = set_c0_status(ST0_BEV);
write_c0_ebase(ebase);
write_c0_status(sr);
/* Setting vector spacing enables EI/VI mode */
change_c0_intctl(0x3e0, VECTORSPACING);
}
Expand Down Expand Up @@ -1602,8 +1604,6 @@ void __cpuinit set_uncached_handler(unsigned long offset, void *addr,
#ifdef CONFIG_64BIT
unsigned long uncached_ebase = TO_UNCAC(ebase);
#endif
if (cpu_has_mips_r2)
uncached_ebase += (read_c0_ebase() & 0x3ffff000);

if (!addr)
panic(panic_null_cerr);
Expand Down Expand Up @@ -1635,9 +1635,11 @@ void __init trap_init(void)
return; /* Already done */
#endif

if (cpu_has_veic || cpu_has_vint)
ebase = (unsigned long) alloc_bootmem_low_pages(0x200 + VECTORSPACING*64);
else {
if (cpu_has_veic || cpu_has_vint) {
unsigned long size = 0x200 + VECTORSPACING*64;
ebase = (unsigned long)
__alloc_bootmem(size, 1 << fls(size), 0);
} else {
ebase = CAC_BASE;
if (cpu_has_mips_r2)
ebase += (read_c0_ebase() & 0x3ffff000);
Expand Down
2 changes: 1 addition & 1 deletion arch/mips/mm/c-r4k.c
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,7 @@ static void __cpuinit probe_pcache(void)
c->dcache.ways = 2;
c->dcache.waybit = 0;

c->options |= MIPS_CPU_CACHE_CDEX_P;
c->options |= MIPS_CPU_CACHE_CDEX_P | MIPS_CPU_PREFETCH;
break;

case CPU_TX49XX:
Expand Down
2 changes: 1 addition & 1 deletion arch/mips/mm/dma-default.c
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ void dma_unmap_page(struct device *dev, dma_addr_t dma_address, size_t size,
if (!plat_device_is_coherent(dev) && direction != DMA_TO_DEVICE) {
unsigned long addr;

addr = plat_dma_addr_to_phys(dma_address);
addr = dma_addr_to_virt(dma_address);
dma_cache_wback_inv(addr, size);
}

Expand Down

0 comments on commit 1646df4

Please sign in to comment.