All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] fs: fat: Fix cache align error message in fatwrite to use USB media
@ 2014-04-03  4:44 Nobuhiro Iwamatsu
  2014-04-07 14:19 ` Hector Palacios
  0 siblings, 1 reply; 3+ messages in thread
From: Nobuhiro Iwamatsu @ 2014-04-03  4:44 UTC (permalink / raw)
  To: u-boot

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.

Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Signed-off-by: Yoshiyuki Ito <yoshiyuki.ito.ub@renesas.com>
---
 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;
-- 
1.8.5

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH] fs: fat: Fix cache align error message in fatwrite to use USB media
  2014-04-03  4:44 [U-Boot] [PATCH] fs: fat: Fix cache align error message in fatwrite to use USB media Nobuhiro Iwamatsu
@ 2014-04-07 14:19 ` Hector Palacios
  2014-04-08  2:02   ` Nobuhiro Iwamatsu
  0 siblings, 1 reply; 3+ messages in thread
From: Hector Palacios @ 2014-04-07 14:19 UTC (permalink / raw)
  To: u-boot

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 <nobuhiro.iwamatsu.yj@renesas.com>
> Signed-off-by: Yoshiyuki Ito <yoshiyuki.ito.ub@renesas.com>
> ---
>   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 <hector.palacios@digi.com>

Thanks,
-- 
H?ctor Palacios

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH] fs: fat: Fix cache align error message in fatwrite to use USB media
  2014-04-07 14:19 ` Hector Palacios
@ 2014-04-08  2:02   ` Nobuhiro Iwamatsu
  0 siblings, 0 replies; 3+ messages in thread
From: Nobuhiro Iwamatsu @ 2014-04-08  2:02 UTC (permalink / raw)
  To: u-boot

Hi!

2014-04-07 23:19 GMT+09:00 Hector Palacios <hector.palacios@digi.com>:
> 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.

I see. I will remove and re-send.

>
>
>> 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>
>> ---
>>   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 <hector.palacios@digi.com>
>

Thanks for your test!

> Thanks,

Best regards,
  Nobuhiro

-- 
Nobuhiro Iwamatsu

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-04-08  2:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-03  4:44 [U-Boot] [PATCH] fs: fat: Fix cache align error message in fatwrite to use USB media Nobuhiro Iwamatsu
2014-04-07 14:19 ` Hector Palacios
2014-04-08  2:02   ` Nobuhiro Iwamatsu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.