Patchwork [U-Boot,1/2] part_dos: align disk buffers on cache line to enable DMA and cache

login
register
mail settings
Submitter Eric Nelson
Date March 3, 2012, 10:02 p.m.
Message ID <1330812140-25766-1-git-send-email-eric.nelson@boundarydevices.com>
Download mbox | patch
Permalink /patch/144462/
State Accepted
Commit dec049d92427a4bf8bf4083f4ebaedbc5dc83e7b
Delegated to: Anatolij Gustschin
Headers show

Comments

Eric Nelson - March 3, 2012, 10:02 p.m.
Signed-off-by: Eric Nelson <eric.nelson@boundarydevices.com>
---
 disk/part_dos.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
Mike Frysinger - March 3, 2012, 11:14 p.m.
Acked-by: Mike Frysinger <vapier@gentoo.org>
-mike
Dirk Behme - March 24, 2012, 7:16 a.m.
On 03.03.2012 23:02, Eric Nelson wrote:
> Signed-off-by: Eric Nelson<eric.nelson@boundarydevices.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>

Anybody likes to comment/apply this patch?

Many thanks!

Dirk

> ---
>   disk/part_dos.c |    6 +++---
>   1 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/disk/part_dos.c b/disk/part_dos.c
> index b5bcb37..c028aaf 100644
> --- a/disk/part_dos.c
> +++ b/disk/part_dos.c
> @@ -87,7 +87,7 @@ static int test_block_type(unsigned char *buffer)
>
>   int test_part_dos (block_dev_desc_t *dev_desc)
>   {
> -	unsigned char buffer[dev_desc->blksz];
> +	ALLOC_CACHE_ALIGN_BUFFER(unsigned char, buffer, dev_desc->blksz);
>
>   	if ((dev_desc->block_read(dev_desc->dev, 0, 1, (ulong *) buffer) != 1) ||
>   	    (buffer[DOS_PART_MAGIC_OFFSET + 0] != 0x55) ||
> @@ -102,7 +102,7 @@ int test_part_dos (block_dev_desc_t *dev_desc)
>   static void print_partition_extended (block_dev_desc_t *dev_desc, int ext_part_sector, int relative,
>   							   int part_num)
>   {
> -	unsigned char buffer[dev_desc->blksz];
> +	ALLOC_CACHE_ALIGN_BUFFER(unsigned char, buffer, dev_desc->blksz);
>   	dos_partition_t *pt;
>   	int i;
>
> @@ -166,7 +166,7 @@ static int get_partition_info_extended (block_dev_desc_t *dev_desc, int ext_part
>   				 int relative, int part_num,
>   				 int which_part, disk_partition_t *info)
>   {
> -	unsigned char buffer[dev_desc->blksz];
> +	ALLOC_CACHE_ALIGN_BUFFER(unsigned char, buffer, dev_desc->blksz);
>   	dos_partition_t *pt;
>   	int i;
>
Anatolij Gustschin - April 24, 2012, 9:04 a.m.
On Sat,  3 Mar 2012 15:02:20 -0700
Eric Nelson <eric.nelson@boundarydevices.com> wrote:

> Signed-off-by: Eric Nelson <eric.nelson@boundarydevices.com>
> ---
>  disk/part_dos.c |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)

Applied to u-boot-staging/agust@denx.de, thanks!

Anatolij

Patch

diff --git a/disk/part_dos.c b/disk/part_dos.c
index b5bcb37..c028aaf 100644
--- a/disk/part_dos.c
+++ b/disk/part_dos.c
@@ -87,7 +87,7 @@  static int test_block_type(unsigned char *buffer)
 
 int test_part_dos (block_dev_desc_t *dev_desc)
 {
-	unsigned char buffer[dev_desc->blksz];
+	ALLOC_CACHE_ALIGN_BUFFER(unsigned char, buffer, dev_desc->blksz);
 
 	if ((dev_desc->block_read(dev_desc->dev, 0, 1, (ulong *) buffer) != 1) ||
 	    (buffer[DOS_PART_MAGIC_OFFSET + 0] != 0x55) ||
@@ -102,7 +102,7 @@  int test_part_dos (block_dev_desc_t *dev_desc)
 static void print_partition_extended (block_dev_desc_t *dev_desc, int ext_part_sector, int relative,
 							   int part_num)
 {
-	unsigned char buffer[dev_desc->blksz];
+	ALLOC_CACHE_ALIGN_BUFFER(unsigned char, buffer, dev_desc->blksz);
 	dos_partition_t *pt;
 	int i;
 
@@ -166,7 +166,7 @@  static int get_partition_info_extended (block_dev_desc_t *dev_desc, int ext_part
 				 int relative, int part_num,
 				 int which_part, disk_partition_t *info)
 {
-	unsigned char buffer[dev_desc->blksz];
+	ALLOC_CACHE_ALIGN_BUFFER(unsigned char, buffer, dev_desc->blksz);
 	dos_partition_t *pt;
 	int i;