From: Paul Burton Date: Wed, 21 Sep 2016 11:18:59 +0100 Subject: [U-Boot] [PATCH v3 14/14] MIPS: Ensure cache ops complete in mips_cache_reset In-Reply-To: <20160921101900.31610-1-paul.burton@imgtec.com> References: <20160921101900.31610-1-paul.burton@imgtec.com> Message-ID: <20160921101900.31610-15-paul.burton@imgtec.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Ensure that cache operations complete before returning from mips_cache_reset by placing a completion barrier (sync instruction) before the return. Without this there is no guarantee that the cache ops will complete before any subsequent memory accesses, since they are indexed cache ops & thus not implicitly ordered with memory accesses. Signed-off-by: Paul Burton --- Changes in v3: - New patch Changes in v2: None arch/mips/lib/cache_init.S | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/mips/lib/cache_init.S b/arch/mips/lib/cache_init.S index 53e903a..698a5af 100644 --- a/arch/mips/lib/cache_init.S +++ b/arch/mips/lib/cache_init.S @@ -420,6 +420,8 @@ l2_unbypass: #endif return: + /* Ensure all cache operations complete before returning */ + sync jr ra END(mips_cache_reset) -- 2.10.0