From mboxrd@z Thu Jan 1 00:00:00 1970 From: Albert ARIBAUD Date: Mon, 24 Oct 2011 23:49:12 +0200 Subject: [U-Boot] [PATCH] FIX for dcache_disable() for ARM926ej-s In-Reply-To: <1319179460-5625-1-git-send-email-b.van.den.berg.nl@gmail.com> References: <1319179460-5625-1-git-send-email-b.van.den.berg.nl@gmail.com> Message-ID: <4EA5DD58.3090505@aribaud.net> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Bas, Le 21/10/2011 08:44, Bas van den Berg a ?crit : > the cache also needs to be invalidated, not just flushed, Since re-enabling it, > can cause inconsistent data without invalidation. See example below. > > in c-file: > static int num = 1; > > void test() { > num = 1; > dcache_enable(); > printf("Cache on, num=%d\n", num); > num = 2; > dcache_disable(); > printf("Cache off, num=%d\n", num); > num = 1; > dcache_enable(); > printf("Cache on, num=%d\n", num); // -> prints 2 instead of 1!! > dcache_disable(); > printf("Cache off, num=%d\n", num); > } This part of the patch is what will stay in the GIT tree as the commit message. Here it is too verbose. Remove useless example. Amicalement, -- Albert.