Skip to content

Commit 1646df4

Browse files
committed
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: 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
2 parents 1b5e62b + 9fb4c2b commit 1646df4

5 files changed

Lines changed: 20 additions & 19 deletions

File tree

‎arch/mips/include/asm/mipsregs.h‎

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1391,36 +1391,36 @@ static inline void tlb_write_random(void)
13911391
static inline unsigned int \
13921392
set_c0_##name(unsigned int set) \
13931393
{ \
1394-
unsigned int res; \
1394+
unsigned int res, new; \
13951395
\
13961396
res = read_c0_##name(); \
1397-
res |= set; \
1398-
write_c0_##name(res); \
1397+
new = res | set; \
1398+
write_c0_##name(new); \
13991399
\
14001400
return res; \
14011401
} \
14021402
\
14031403
static inline unsigned int \
14041404
clear_c0_##name(unsigned int clear) \
14051405
{ \
1406-
unsigned int res; \
1406+
unsigned int res, new; \
14071407
\
14081408
res = read_c0_##name(); \
1409-
res &= ~clear; \
1410-
write_c0_##name(res); \
1409+
new = res & ~clear; \
1410+
write_c0_##name(new); \
14111411
\
14121412
return res; \
14131413
} \
14141414
\
14151415
static inline unsigned int \
1416-
change_c0_##name(unsigned int change, unsigned int new) \
1416+
change_c0_##name(unsigned int change, unsigned int val) \
14171417
{ \
1418-
unsigned int res; \
1418+
unsigned int res, new; \
14191419
\
14201420
res = read_c0_##name(); \
1421-
res &= ~change; \
1422-
res |= (new & change); \
1423-
write_c0_##name(res); \
1421+
new = res & ~change; \
1422+
new |= (val & change); \
1423+
write_c0_##name(new); \
14241424
\
14251425
return res; \
14261426
}

‎arch/mips/kernel/linux32.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
#include <linux/module.h>
3333
#include <linux/binfmts.h>
3434
#include <linux/security.h>
35-
#include <linux/syscalls.h>
3635
#include <linux/compat.h>
3736
#include <linux/vfs.h>
3837
#include <linux/ipc.h>

‎arch/mips/kernel/traps.c‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1520,7 +1520,9 @@ void __cpuinit per_cpu_trap_init(void)
15201520
#endif /* CONFIG_MIPS_MT_SMTC */
15211521

15221522
if (cpu_has_veic || cpu_has_vint) {
1523+
unsigned long sr = set_c0_status(ST0_BEV);
15231524
write_c0_ebase(ebase);
1525+
write_c0_status(sr);
15241526
/* Setting vector spacing enables EI/VI mode */
15251527
change_c0_intctl(0x3e0, VECTORSPACING);
15261528
}
@@ -1602,8 +1604,6 @@ void __cpuinit set_uncached_handler(unsigned long offset, void *addr,
16021604
#ifdef CONFIG_64BIT
16031605
unsigned long uncached_ebase = TO_UNCAC(ebase);
16041606
#endif
1605-
if (cpu_has_mips_r2)
1606-
uncached_ebase += (read_c0_ebase() & 0x3ffff000);
16071607

16081608
if (!addr)
16091609
panic(panic_null_cerr);
@@ -1635,9 +1635,11 @@ void __init trap_init(void)
16351635
return; /* Already done */
16361636
#endif
16371637

1638-
if (cpu_has_veic || cpu_has_vint)
1639-
ebase = (unsigned long) alloc_bootmem_low_pages(0x200 + VECTORSPACING*64);
1640-
else {
1638+
if (cpu_has_veic || cpu_has_vint) {
1639+
unsigned long size = 0x200 + VECTORSPACING*64;
1640+
ebase = (unsigned long)
1641+
__alloc_bootmem(size, 1 << fls(size), 0);
1642+
} else {
16411643
ebase = CAC_BASE;
16421644
if (cpu_has_mips_r2)
16431645
ebase += (read_c0_ebase() & 0x3ffff000);

‎arch/mips/mm/c-r4k.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -780,7 +780,7 @@ static void __cpuinit probe_pcache(void)
780780
c->dcache.ways = 2;
781781
c->dcache.waybit = 0;
782782

783-
c->options |= MIPS_CPU_CACHE_CDEX_P;
783+
c->options |= MIPS_CPU_CACHE_CDEX_P | MIPS_CPU_PREFETCH;
784784
break;
785785

786786
case CPU_TX49XX:

‎arch/mips/mm/dma-default.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ void dma_unmap_page(struct device *dev, dma_addr_t dma_address, size_t size,
225225
if (!plat_device_is_coherent(dev) && direction != DMA_TO_DEVICE) {
226226
unsigned long addr;
227227

228-
addr = plat_dma_addr_to_phys(dma_address);
228+
addr = dma_addr_to_virt(dma_address);
229229
dma_cache_wback_inv(addr, size);
230230
}
231231

0 commit comments

Comments
 (0)