Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/sh3/sh3 Don't call sh4_icache_sync_all() before sh_...



details:   https://anonhg.NetBSD.org/src/rev/eb348553cc93
branches:  trunk
changeset: 786833:eb348553cc93
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Tue May 14 14:11:43 2013 +0000

description:
Don't call sh4_icache_sync_all() before sh_cache_ops is initialized.
Instead, use SH4_EMODE_CACHE_FLUSH() or SH4_CACHE_FLUSH() macro to
invalidate cache before initializing CCR.
This seems to suppress random file system corruption on wd(4) at acardide(4)
(which uses bus-master DMA and calls many cache flush ops) during pkgsrc
packages builds on landisk.

diffstat:

 sys/arch/sh3/sh3/cache_sh4.c |  9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diffs (31 lines):

diff -r 818efbf7ef44 -r eb348553cc93 sys/arch/sh3/sh3/cache_sh4.c
--- a/sys/arch/sh3/sh3/cache_sh4.c      Tue May 14 14:03:53 2013 +0000
+++ b/sys/arch/sh3/sh3/cache_sh4.c      Tue May 14 14:11:43 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cache_sh4.c,v 1.23 2012/12/12 16:24:49 tsutsui Exp $   */
+/*     $NetBSD: cache_sh4.c,v 1.24 2013/05/14 14:11:43 tsutsui Exp $   */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cache_sh4.c,v 1.23 2012/12/12 16:24:49 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cache_sh4.c,v 1.24 2013/05/14 14:11:43 tsutsui Exp $");
 
 #include "opt_cache.h"
 
@@ -118,8 +118,11 @@
        r |= SH4_CCR_CB;
 #endif
 
-       sh4_icache_sync_all();
        RUN_P2;
+       if (r & SH4_CCR_EMODE)
+               SH4_EMODE_CACHE_FLUSH();
+       else
+               SH4_CACHE_FLUSH();
        _reg_write_4(SH4_CCR, SH4_CCR_ICI|SH4_CCR_OCI);
        _reg_write_4(SH4_CCR, r);
        RUN_P1;



Home | Main Index | Thread Index | Old Index