aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/mm/c-sb1.c
diff options
context:
space:
mode:
authorThiemo Seufer <ths@networkno.de>2006-11-16 17:13:54 -0500
committerRalf Baechle <ralf@linux-mips.org>2006-11-22 18:34:01 -0500
commiteb4828750852b84703f64747b3bedf6394d629ef (patch)
tree49fbb6d7168132c470499bbffdb4f08e5c071d4e /arch/mips/mm/c-sb1.c
parent0f9005a6f7a82f4aacbd72f7b92322a8ca1c3f97 (diff)
[MIPS] Hack for SB1 cache issues
Removing flush_icache_page a while ago broke SB1 which was using an empty flush_data_cache_page function. This glues things well enough so a more efficient but also more intrusive solution can be found later. Signed-Off-By: Thiemo Seufer <ths@networkno.de> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/mm/c-sb1.c')
-rw-r--r--arch/mips/mm/c-sb1.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/arch/mips/mm/c-sb1.c b/arch/mips/mm/c-sb1.c
index d0ddb4a768a5..3a8afd47feaa 100644
--- a/arch/mips/mm/c-sb1.c
+++ b/arch/mips/mm/c-sb1.c
@@ -19,6 +19,7 @@
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 */ 20 */
21#include <linux/init.h> 21#include <linux/init.h>
22#include <linux/hardirq.h>
22 23
23#include <asm/asm.h> 24#include <asm/asm.h>
24#include <asm/bootinfo.h> 25#include <asm/bootinfo.h>
@@ -242,6 +243,25 @@ void sb1_flush_cache_page(struct vm_area_struct *vma, unsigned long addr, unsign
242 __attribute__((alias("local_sb1_flush_cache_page"))); 243 __attribute__((alias("local_sb1_flush_cache_page")));
243#endif 244#endif
244 245
246#ifdef CONFIG_SMP
247static void sb1_flush_cache_data_page_ipi(void *info)
248{
249 unsigned long start = (unsigned long)info;
250
251 __sb1_writeback_inv_dcache_range(start, start + PAGE_SIZE);
252}
253
254static void sb1_flush_cache_data_page(unsigned long addr)
255{
256 if (in_atomic())
257 __sb1_writeback_inv_dcache_range(addr, addr + PAGE_SIZE);
258 else
259 on_each_cpu(sb1_flush_cache_data_page_ipi, (void *) addr, 1, 1);
260}
261#else
262void sb1_flush_cache_data_page(unsigned long)
263 __attribute__((alias("local_sb1_flush_cache_data_page")));
264#endif
245 265
246/* 266/*
247 * Invalidate all caches on this CPU 267 * Invalidate all caches on this CPU
@@ -481,7 +501,7 @@ void sb1_cache_init(void)
481 501
482 flush_cache_sigtramp = sb1_flush_cache_sigtramp; 502 flush_cache_sigtramp = sb1_flush_cache_sigtramp;
483 local_flush_data_cache_page = (void *) sb1_nop; 503 local_flush_data_cache_page = (void *) sb1_nop;
484 flush_data_cache_page = (void *) sb1_nop; 504 flush_data_cache_page = sb1_flush_cache_data_page;
485 505
486 /* Full flush */ 506 /* Full flush */
487 __flush_cache_all = sb1___flush_cache_all; 507 __flush_cache_all = sb1___flush_cache_all;