]> git.sur5r.net Git - u-boot/commitdiff
fs: fat: Fix cache align error message in fatwrite
authorNobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Tue, 8 Apr 2014 02:12:46 +0000 (11:12 +0900)
committerTom Rini <trini@ti.com>
Mon, 12 May 2014 19:19:45 +0000 (15:19 -0400)
Use of malloc of do_fat_write() causes cache error on ARM v7 platforms.
Perhaps, the same problem will occur at any other CPUs.
This replaces malloc with memalign to fix cache buffer alignment.

Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Signed-off-by: Yoshiyuki Ito <yoshiyuki.ito.ub@renesas.com>
Tested-by: Hector Palacios <hector.palacios@digi.com>
fs/fat/fat_write.c

index 9f5e9118522e8dd371da428cf4fb1593a6af0af7..cef138ec9657ec48271f5ab4a0657ce329dc8b09 100644 (file)
@@ -952,7 +952,7 @@ static int do_fat_write(const char *filename, void *buffer,
        }
 
        mydata->fatbufnum = -1;
-       mydata->fatbuf = malloc(FATBUFSIZE);
+       mydata->fatbuf = memalign(ARCH_DMA_MINALIGN, FATBUFSIZE);
        if (mydata->fatbuf == NULL) {
                debug("Error: allocating memory\n");
                return -1;