Skip to contentSkip to conversation

fs: fat: Fix cache align error message in fatwrite

PATCH New Nobuhiro Iwamatsu 2 participants 2 messages Apr 8, 2014 – May 13, 2014 VFAT/FAT/msdos filesystem

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 fs: fat: Fix cache align error message in fatwrite

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.

---
v2: Fix commit message.

 fs/fat/fat_write.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/fat/fat_write.c +1 -1
index 9f5e911..cef138e 100644
@@ -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
#1 lore raw

PATCH v2 1/1 fs: fat: Fix cache align error message in fatwrite

Quoted 7 lines · Nobuhiro Iwamatsu

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.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140512/4740db0e/attachment.pgp>