From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hector Palacios Date: Mon, 7 Apr 2014 16:19:00 +0200 Subject: [U-Boot] [PATCH] fs: fat: Fix cache align error message in fatwrite to use USB media In-Reply-To: <1396500259-6374-1-git-send-email-nobuhiro.iwamatsu.yj@renesas.com> References: <1396500259-6374-1-git-send-email-nobuhiro.iwamatsu.yj@renesas.com> Message-ID: <5342B3D4.70603@digi.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hello, On 04/03/2014 06:44 AM, Nobuhiro Iwamatsu wrote: > 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. > 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 > Signed-off-by: Yoshiyuki Ito > --- > fs/fat/fat_write.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/fs/fat/fat_write.c b/fs/fat/fat_write.c > index 9f5e911..cef138e 100644 > --- a/fs/fat/fat_write.c > +++ b/fs/fat/fat_write.c > @@ -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. Tested-by: Hector Palacios Thanks, -- H?ctor Palacios