All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH V2] fs/fat: align disk buffers on cache line to enable DMA and cache
       [not found] <119311>
@ 2012-03-04 21:46 ` Eric Nelson
  2012-03-13  1:24   ` Eric Nelson
  0 siblings, 1 reply; 9+ messages in thread
From: Eric Nelson @ 2012-03-04 21:46 UTC (permalink / raw)
  To: u-boot

Signed-off-by: Eric Nelson <eric.nelson@boundarydevices.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>
---
 fs/fat/fat.c |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/fs/fat/fat.c b/fs/fat/fat.c
index 1f95eb4..f3c48bb 100644
--- a/fs/fat/fat.c
+++ b/fs/fat/fat.c
@@ -31,6 +31,8 @@
 #include <fat.h>
 #include <asm/byteorder.h>
 #include <part.h>
+#include <malloc.h>
+#include <linux/compiler.h>
 
 /*
  * Convert a string to lowercase.
@@ -62,7 +64,7 @@ static int disk_read(__u32 block, __u32 nr_blocks, void *buf)
 
 int fat_register_device (block_dev_desc_t * dev_desc, int part_no)
 {
-	unsigned char buffer[dev_desc->blksz];
+	ALLOC_CACHE_ALIGN_BUFFER(unsigned char, buffer, dev_desc->blksz);
 
 	/* First close any currently found FAT filesystem */
 	cur_dev = NULL;
@@ -293,7 +295,7 @@ get_cluster (fsdata *mydata, __u32 clustnum, __u8 *buffer,
 		return -1;
 	}
 	if (size % mydata->sect_size) {
-		__u8 tmpbuf[mydata->sect_size];
+		ALLOC_CACHE_ALIGN_BUFFER(__u8, tmpbuf, mydata->sect_size);
 
 		idx = size / mydata->sect_size;
 		ret = disk_read(startsect + idx, 1, tmpbuf);
@@ -428,8 +430,8 @@ static int slot2str (dir_slot *slotptr, char *l_name, int *idx)
  * into 'retdent'
  * Return 0 on success, -1 otherwise.
  */
-__attribute__ ((__aligned__ (__alignof__ (dir_entry))))
-__u8 get_vfatname_block[MAX_CLUSTSIZE];
+__u8 get_vfatname_block[MAX_CLUSTSIZE]
+	__aligned(ARCH_DMA_MINALIGN);
 
 static int
 get_vfatname (fsdata *mydata, int curclust, __u8 *cluster,
@@ -709,7 +711,7 @@ read_bootsectandvi (boot_sector *bs, volume_info *volinfo, int *fatsize)
 		return -1;
 	}
 
-	block = malloc(cur_dev->blksz);
+	block = memalign(ARCH_DMA_MINALIGN, cur_dev->blksz);
 	if (block == NULL) {
 		debug("Error: allocating block\n");
 		return -1;
@@ -828,7 +830,7 @@ do_fat_read (const char *filename, void *buffer, unsigned long maxsize,
 	}
 
 	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.7.9

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

* [U-Boot] [PATCH V2] fs/fat: align disk buffers on cache line to enable DMA and cache
  2012-03-04 21:46 ` [U-Boot] [PATCH V2] fs/fat: align disk buffers on cache line to enable DMA and cache Eric Nelson
@ 2012-03-13  1:24   ` Eric Nelson
  2012-03-24  7:18     ` Dirk Behme
  0 siblings, 1 reply; 9+ messages in thread
From: Eric Nelson @ 2012-03-13  1:24 UTC (permalink / raw)
  To: u-boot

On 03/04/2012 02:46 PM, Eric Nelson wrote:
> Signed-off-by: Eric Nelson<eric.nelson@boundarydevices.com>
> Acked-by: Mike Frysinger<vapier@gentoo.org>
> ---
>   fs/fat/fat.c |   14 ++++++++------
>   1 files changed, 8 insertions(+), 6 deletions(-)
>
> diff --git a/fs/fat/fat.c b/fs/fat/fat.c
> index 1f95eb4..f3c48bb 100644
> --- a/fs/fat/fat.c
> +++ b/fs/fat/fat.c
> @@ -31,6 +31,8 @@
>   #include<fat.h>
>   #include<asm/byteorder.h>
>   #include<part.h>
> +#include<malloc.h>
> +#include<linux/compiler.h>
>
>   /*
>    * Convert a string to lowercase.
> @@ -62,7 +64,7 @@ static int disk_read(__u32 block, __u32 nr_blocks, void *buf)
>
>   int fat_register_device (block_dev_desc_t * dev_desc, int part_no)
>   {
> -	unsigned char buffer[dev_desc->blksz];
> +	ALLOC_CACHE_ALIGN_BUFFER(unsigned char, buffer, dev_desc->blksz);
 > <snip>

Hi Wolfgang,

Have you had a chance to review this patch? Is there another maintainer for fs/fat?

Please let me know if you need this updated.

There's another patch that was acked by Mike but is otherwise lingering here:

	http://lists.denx.de/pipermail/u-boot/2012-March/119309.html

Both of these are needed before enabling the data cache on i.MX6 when using
the FAT filesystem.

Regards,


Eric

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

* [U-Boot] [PATCH V2] fs/fat: align disk buffers on cache line to enable DMA and cache
  2012-03-13  1:24   ` Eric Nelson
@ 2012-03-24  7:18     ` Dirk Behme
  2012-03-27 14:20       ` Anatolij Gustschin
  0 siblings, 1 reply; 9+ messages in thread
From: Dirk Behme @ 2012-03-24  7:18 UTC (permalink / raw)
  To: u-boot

On 13.03.2012 02:24, Eric Nelson wrote:
> On 03/04/2012 02:46 PM, Eric Nelson wrote:
>> Signed-off-by: Eric Nelson<eric.nelson@boundarydevices.com>
>> Acked-by: Mike Frysinger<vapier@gentoo.org>
>> ---
>> fs/fat/fat.c | 14 ++++++++------
>> 1 files changed, 8 insertions(+), 6 deletions(-)
>>
>> diff --git a/fs/fat/fat.c b/fs/fat/fat.c
>> index 1f95eb4..f3c48bb 100644
>> --- a/fs/fat/fat.c
>> +++ b/fs/fat/fat.c
>> @@ -31,6 +31,8 @@
>> #include<fat.h>
>> #include<asm/byteorder.h>
>> #include<part.h>
>> +#include<malloc.h>
>> +#include<linux/compiler.h>
>>
>> /*
>> * Convert a string to lowercase.
>> @@ -62,7 +64,7 @@ static int disk_read(__u32 block, __u32 nr_blocks,
>> void *buf)
>>
>> int fat_register_device (block_dev_desc_t * dev_desc, int part_no)
>> {
>> - unsigned char buffer[dev_desc->blksz];
>> + ALLOC_CACHE_ALIGN_BUFFER(unsigned char, buffer, dev_desc->blksz);
>  > <snip>
>
> Hi Wolfgang,
>
> Have you had a chance to review this patch? Is there another
> maintainer for fs/fat?
>
> Please let me know if you need this updated.
>
> There's another patch that was acked by Mike but is otherwise
> lingering here:
>
> http://lists.denx.de/pipermail/u-boot/2012-March/119309.html
>
> Both of these are needed before enabling the data cache on i.MX6 when
> using
> the FAT filesystem.

Anybody likes to comment/apply this patch?

Many thanks!

Dirk

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

* [U-Boot] [PATCH V2] fs/fat: align disk buffers on cache line to enable DMA and cache
  2012-03-24  7:18     ` Dirk Behme
@ 2012-03-27 14:20       ` Anatolij Gustschin
  2012-03-27 16:28         ` Dirk Behme
  0 siblings, 1 reply; 9+ messages in thread
From: Anatolij Gustschin @ 2012-03-27 14:20 UTC (permalink / raw)
  To: u-boot

Hello Dirk,

On Sat, 24 Mar 2012 08:18:38 +0100
Dirk Behme <dirk.behme@googlemail.com> wrote:

> On 13.03.2012 02:24, Eric Nelson wrote:
> > On 03/04/2012 02:46 PM, Eric Nelson wrote:
> >> Signed-off-by: Eric Nelson<eric.nelson@boundarydevices.com>
> >> Acked-by: Mike Frysinger<vapier@gentoo.org>
> >> ---
> >> fs/fat/fat.c | 14 ++++++++------
> >> 1 files changed, 8 insertions(+), 6 deletions(-)
> >>
> >> diff --git a/fs/fat/fat.c b/fs/fat/fat.c
> >> index 1f95eb4..f3c48bb 100644
> >> --- a/fs/fat/fat.c
> >> +++ b/fs/fat/fat.c
> >> @@ -31,6 +31,8 @@
> >> #include<fat.h>
> >> #include<asm/byteorder.h>
> >> #include<part.h>
> >> +#include<malloc.h>
> >> +#include<linux/compiler.h>
> >>
> >> /*
> >> * Convert a string to lowercase.
> >> @@ -62,7 +64,7 @@ static int disk_read(__u32 block, __u32 nr_blocks,
> >> void *buf)
> >>
> >> int fat_register_device (block_dev_desc_t * dev_desc, int part_no)
> >> {
> >> - unsigned char buffer[dev_desc->blksz];
> >> + ALLOC_CACHE_ALIGN_BUFFER(unsigned char, buffer, dev_desc->blksz);
> >  > <snip>
> >
> > Hi Wolfgang,
> >
> > Have you had a chance to review this patch? Is there another
> > maintainer for fs/fat?
> >
> > Please let me know if you need this updated.
> >
> > There's another patch that was acked by Mike but is otherwise
> > lingering here:
> >
> > http://lists.denx.de/pipermail/u-boot/2012-March/119309.html
> >
> > Both of these are needed before enabling the data cache on i.MX6 when
> > using
> > the FAT filesystem.
> 
> Anybody likes to comment/apply this patch?

Both, this patch and the patch referenced by the above link were
submitted when the merge window was closed. So, the patches will
probably be applied to next when rc1 is out, unless Wolfgang
decides to accept them for coming release.

Thanks,
Anatolij

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

* [U-Boot] [PATCH V2] fs/fat: align disk buffers on cache line to enable DMA and cache
  2012-03-27 14:20       ` Anatolij Gustschin
@ 2012-03-27 16:28         ` Dirk Behme
  2012-03-27 16:40           ` Anatolij Gustschin
  2012-04-19  6:35           ` Dirk Behme
  0 siblings, 2 replies; 9+ messages in thread
From: Dirk Behme @ 2012-03-27 16:28 UTC (permalink / raw)
  To: u-boot

On 27.03.2012 16:20, Anatolij Gustschin wrote:
> Hello Dirk,
>
> On Sat, 24 Mar 2012 08:18:38 +0100
> Dirk Behme<dirk.behme@googlemail.com>  wrote:
>
>> On 13.03.2012 02:24, Eric Nelson wrote:
>>> On 03/04/2012 02:46 PM, Eric Nelson wrote:
>>>> Signed-off-by: Eric Nelson<eric.nelson@boundarydevices.com>
>>>> Acked-by: Mike Frysinger<vapier@gentoo.org>
>>>> ---
>>>> fs/fat/fat.c | 14 ++++++++------
>>>> 1 files changed, 8 insertions(+), 6 deletions(-)
>>>>
>>>> diff --git a/fs/fat/fat.c b/fs/fat/fat.c
>>>> index 1f95eb4..f3c48bb 100644
>>>> --- a/fs/fat/fat.c
>>>> +++ b/fs/fat/fat.c
>>>> @@ -31,6 +31,8 @@
>>>> #include<fat.h>
>>>> #include<asm/byteorder.h>
>>>> #include<part.h>
>>>> +#include<malloc.h>
>>>> +#include<linux/compiler.h>
>>>>
>>>> /*
>>>> * Convert a string to lowercase.
>>>> @@ -62,7 +64,7 @@ static int disk_read(__u32 block, __u32 nr_blocks,
>>>> void *buf)
>>>>
>>>> int fat_register_device (block_dev_desc_t * dev_desc, int part_no)
>>>> {
>>>> - unsigned char buffer[dev_desc->blksz];
>>>> + ALLOC_CACHE_ALIGN_BUFFER(unsigned char, buffer, dev_desc->blksz);
>>>   >  <snip>
>>>
>>> Hi Wolfgang,
>>>
>>> Have you had a chance to review this patch? Is there another
>>> maintainer for fs/fat?
>>>
>>> Please let me know if you need this updated.
>>>
>>> There's another patch that was acked by Mike but is otherwise
>>> lingering here:
>>>
>>> http://lists.denx.de/pipermail/u-boot/2012-March/119309.html
>>>
>>> Both of these are needed before enabling the data cache on i.MX6 when
>>> using
>>> the FAT filesystem.
>>
>> Anybody likes to comment/apply this patch?
>
> Both, this patch and the patch referenced by the above link were
> submitted when the merge window was closed. So, the patches will
> probably be applied to next when rc1 is out, unless Wolfgang
> decides to accept them for coming release.

Ok, thanks!

Do we have a -next branch for stuff like this, then?

Best regards

dirk

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

* [U-Boot] [PATCH V2] fs/fat: align disk buffers on cache line to enable DMA and cache
  2012-03-27 16:28         ` Dirk Behme
@ 2012-03-27 16:40           ` Anatolij Gustschin
  2012-03-27 18:21             ` Tom Rini
  2012-04-19  6:35           ` Dirk Behme
  1 sibling, 1 reply; 9+ messages in thread
From: Anatolij Gustschin @ 2012-03-27 16:40 UTC (permalink / raw)
  To: u-boot

On Tue, 27 Mar 2012 18:28:21 +0200
Dirk Behme <dirk.behme@googlemail.com> wrote:
...
> >> Anybody likes to comment/apply this patch?
> >
> > Both, this patch and the patch referenced by the above link were
> > submitted when the merge window was closed. So, the patches will
> > probably be applied to next when rc1 is out, unless Wolfgang
> > decides to accept them for coming release.
> 
> Ok, thanks!
> 
> Do we have a -next branch for stuff like this, then?

AFAIK, Wolfgang updates u-boot.git next branch when -rc1 is out. After
a release this next branch is merged into u-boot.git master.

Best regards,

Anatolij

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

* [U-Boot] [PATCH V2] fs/fat: align disk buffers on cache line to enable DMA and cache
  2012-03-27 16:40           ` Anatolij Gustschin
@ 2012-03-27 18:21             ` Tom Rini
  0 siblings, 0 replies; 9+ messages in thread
From: Tom Rini @ 2012-03-27 18:21 UTC (permalink / raw)
  To: u-boot

On Tue, Mar 27, 2012 at 06:40:33PM +0200, Anatolij Gustschin wrote:
> On Tue, 27 Mar 2012 18:28:21 +0200
> Dirk Behme <dirk.behme@googlemail.com> wrote:
> ...
> > >> Anybody likes to comment/apply this patch?
> > >
> > > Both, this patch and the patch referenced by the above link were
> > > submitted when the merge window was closed. So, the patches will
> > > probably be applied to next when rc1 is out, unless Wolfgang
> > > decides to accept them for coming release.
> > 
> > Ok, thanks!
> > 
> > Do we have a -next branch for stuff like this, then?
> 
> AFAIK, Wolfgang updates u-boot.git next branch when -rc1 is out. After
> a release this next branch is merged into u-boot.git master.

All of that said, I can't imagine Wolfgang objecting to a
u-boot-staging/you/next branch so things aren't lost and there's clear
intention to submitters as well.

-- 
Tom

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

* [U-Boot] [PATCH V2] fs/fat: align disk buffers on cache line to enable DMA and cache
  2012-03-27 16:28         ` Dirk Behme
  2012-03-27 16:40           ` Anatolij Gustschin
@ 2012-04-19  6:35           ` Dirk Behme
  2012-04-24  9:14             ` Anatolij Gustschin
  1 sibling, 1 reply; 9+ messages in thread
From: Dirk Behme @ 2012-04-19  6:35 UTC (permalink / raw)
  To: u-boot

On 27.03.2012 18:28, Dirk Behme wrote:
> On 27.03.2012 16:20, Anatolij Gustschin wrote:
>> Hello Dirk,
>>
>> On Sat, 24 Mar 2012 08:18:38 +0100
>> Dirk Behme<dirk.behme@googlemail.com>  wrote:
>>
>>> On 13.03.2012 02:24, Eric Nelson wrote:
>>>> On 03/04/2012 02:46 PM, Eric Nelson wrote:
>>>>> Signed-off-by: Eric Nelson<eric.nelson@boundarydevices.com>
>>>>> Acked-by: Mike Frysinger<vapier@gentoo.org>
>>>>> ---
>>>>> fs/fat/fat.c | 14 ++++++++------
>>>>> 1 files changed, 8 insertions(+), 6 deletions(-)
>>>>>
>>>>> diff --git a/fs/fat/fat.c b/fs/fat/fat.c
>>>>> index 1f95eb4..f3c48bb 100644
>>>>> --- a/fs/fat/fat.c
>>>>> +++ b/fs/fat/fat.c
>>>>> @@ -31,6 +31,8 @@
>>>>> #include<fat.h>
>>>>> #include<asm/byteorder.h>
>>>>> #include<part.h>
>>>>> +#include<malloc.h>
>>>>> +#include<linux/compiler.h>
>>>>>
>>>>> /*
>>>>> * Convert a string to lowercase.
>>>>> @@ -62,7 +64,7 @@ static int disk_read(__u32 block, __u32 nr_blocks,
>>>>> void *buf)
>>>>>
>>>>> int fat_register_device (block_dev_desc_t * dev_desc, int part_no)
>>>>> {
>>>>> - unsigned char buffer[dev_desc->blksz];
>>>>> + ALLOC_CACHE_ALIGN_BUFFER(unsigned char, buffer, dev_desc->blksz);
>>>>   >  <snip>
>>>>
>>>> Hi Wolfgang,
>>>>
>>>> Have you had a chance to review this patch? Is there another
>>>> maintainer for fs/fat?
>>>>
>>>> Please let me know if you need this updated.
>>>>
>>>> There's another patch that was acked by Mike but is otherwise
>>>> lingering here:
>>>>
>>>> http://lists.denx.de/pipermail/u-boot/2012-March/119309.html
>>>>
>>>> Both of these are needed before enabling the data cache on i.MX6 when
>>>> using
>>>> the FAT filesystem.
>>> Anybody likes to comment/apply this patch?
>> Both, this patch and the patch referenced by the above link were
>> submitted when the merge window was closed. So, the patches will
>> probably be applied to next when rc1 is out, unless Wolfgang
>> decides to accept them for coming release.
> 
> Ok, thanks!
> 
> Do we have a -next branch for stuff like this, then?

There should be a -next from Wolfgang for

http://patchwork.ozlabs.org/patch/144462/

http://patchwork.ozlabs.org/patch/151799/

now :)

Best regards

Dirk

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

* [U-Boot] [PATCH V2] fs/fat: align disk buffers on cache line to enable DMA and cache
  2012-04-19  6:35           ` Dirk Behme
@ 2012-04-24  9:14             ` Anatolij Gustschin
  0 siblings, 0 replies; 9+ messages in thread
From: Anatolij Gustschin @ 2012-04-24  9:14 UTC (permalink / raw)
  To: u-boot

On Thu, 19 Apr 2012 08:35:37 +0200
Dirk Behme <dirk.behme@de.bosch.com> wrote:
...
> There should be a -next from Wolfgang for
> 
> http://patchwork.ozlabs.org/patch/144462/
> 
> http://patchwork.ozlabs.org/patch/151799/

Both applied, thanks!

Anatolij

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

end of thread, other threads:[~2012-04-24  9:14 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <119311>
2012-03-04 21:46 ` [U-Boot] [PATCH V2] fs/fat: align disk buffers on cache line to enable DMA and cache Eric Nelson
2012-03-13  1:24   ` Eric Nelson
2012-03-24  7:18     ` Dirk Behme
2012-03-27 14:20       ` Anatolij Gustschin
2012-03-27 16:28         ` Dirk Behme
2012-03-27 16:40           ` Anatolij Gustschin
2012-03-27 18:21             ` Tom Rini
2012-04-19  6:35           ` Dirk Behme
2012-04-24  9:14             ` Anatolij Gustschin

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.