fs: fat: Fix cache align error message in fatwrite to use USB media
PATCH 1/1 fs: fat: Fix cache align error message in fatwrite to use USB media
Use of malloc of do_fat_write() from USB media 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.
--- fs/fat/fat_write.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/fat/fat_write.c +1 -1
@@ -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 ;
Signature · 1 line
1.8.5
PATCH 1/1 fs: fat: Fix cache align error message in fatwrite to use USB media
Hello,
Quoted 1 line · Nobuhiro Iwamatsu
Use of malloc of
do_fat_write()from USB media causes cache error on
I would remove 'from USB media' from the commit log as it doesn't really matter where you read from.
Quoted 15 lines
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 <[email protected]>Signed-off-by Yoshiyuki Ito <[email protected]>--- fs/fat/fat_write.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/fat/fat_write.c +0
-0
fs/fat/fat_write.c static int do_fat_write(const char *filename, void *buffer, · line 958
Quoted 8 lines
fs/fat/fat_write.c +1
-1@@ -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 ;
Tested on an i.MX6 custom platform.
Thanks,
Signature · 1 line
H?ctor Palacios
PATCH 1/1 fs: fat: Fix cache align error message in fatwrite to use USB media
Hi!
2014-04-07 23:19 GMT+09:00 Hector Palacios <[email protected]>:
Quoted 10 lines
Hello,
Quoted 2 lines · Nobuhiro Iwamatsu
Use of malloc of
do_fat_write()from USB media causes cache error onI would remove 'from USB media' from the commit log as it doesn't really matter where you read from.
I see. I will remove and re-send.
Quoted 29 lines
Quoted 24 lines
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 <[email protected]>Signed-off-by Yoshiyuki Ito <[email protected]>--- fs/fat/fat_write.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/fat/fat_write.c +1
-1@@ -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" );Quoted 2 lines
return -1;Tested on an i.MX6 custom platform.
Quoted 2 lines
Tested-by Hector Palacios <[email protected]>
Thanks for your test!
Quoted 1 line
Thanks,
Best regards,
Nobuhiro
Signature · 1 line
Nobuhiro Iwamatsu