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)
committerChanho Park <chanho61.park@samsung.com>
Thu, 6 Aug 2015 05:57:41 +0000 (14:57 +0900)
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 a05327c6ae6d88c42cb92462e03a6283916faa90..c4ef13857122a327c57a02293b7c3c1d13374332 100644 (file)
@@ -968,7 +968,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;