Re: [PATCH 20/32] Blackfin arch: dma_memcpy borken for > 64K

2007-05-21 Thread Mike Frysinger

On 5/21/07, Pekka Enberg <[EMAIL PROTECTED]> wrote:

On 5/21/07, Bryan Wu <[EMAIL PROTECTED]> wrote:
> -void *dma_memcpy(void *dest, const void *src, size_t size)
> +void *_dma_memcpy(void *dest, const void *src, size_t size)

Minor nitpick: the established naming convention is two underscores, not one.


that should be marked as static now actually since the function isnt
for use outside of this file


> +void *dma_memcpy(void *dest, const void *src, size_t size)
> +{
> +   size_t bulk;
> +   size_t rest;
> +   void * addr;
> +
> +   bulk = (size >> 16) << 16;

I assume this is significantly faster on your architecture than:

   bulk = size & ~0xUL;

which is more readable?


actually they should get optimized to the same thing
-mike
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 20/32] Blackfin arch: dma_memcpy borken for > 64K

2007-05-21 Thread Pekka Enberg

Hi Bryan,

On 5/21/07, Bryan Wu <[EMAIL PROTECTED]> wrote:

-void *dma_memcpy(void *dest, const void *src, size_t size)
+void *_dma_memcpy(void *dest, const void *src, size_t size)


Minor nitpick: the established naming convention is two underscores, not one.


+void *dma_memcpy(void *dest, const void *src, size_t size)
+{
+   size_t bulk;
+   size_t rest;
+   void * addr;
+
+   bulk = (size >> 16) << 16;


I assume this is significantly faster on your architecture than:

  bulk = size & ~0xUL;

which is more readable?


+   rest = size - bulk;
+   if (bulk)
+   _dma_memcpy(dest, src, bulk);
+   addr = _dma_memcpy(dest+bulk, src+bulk, rest);
+   return addr;


Does this work for 128K and up? Why?
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 20/32] Blackfin arch: dma_memcpy borken for > 64K

2007-05-21 Thread Bryan Wu
From: Aubrey Li <[EMAIL PROTECTED]>

Signed-off-by: Aubrey Li <[EMAIL PROTECTED]>
Signed-off-by: Bryan Wu <[EMAIL PROTECTED]>
---
 arch/blackfin/kernel/bfin_dma_5xx.c |   17 -
 1 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/arch/blackfin/kernel/bfin_dma_5xx.c 
b/arch/blackfin/kernel/bfin_dma_5xx.c
index 1c344ac..0ccb0dc 100644
--- a/arch/blackfin/kernel/bfin_dma_5xx.c
+++ b/arch/blackfin/kernel/bfin_dma_5xx.c
@@ -595,7 +595,7 @@ unsigned short get_dma_curr_ycount(unsigned int channel)
 }
 EXPORT_SYMBOL(get_dma_curr_ycount);
 
-void *dma_memcpy(void *dest, const void *src, size_t size)
+void *_dma_memcpy(void *dest, const void *src, size_t size)
 {
int direction;  /* 1 - address decrease, 0 - address increase */
int flag_align; /* 1 - address aligned,  0 - address unaligned */
@@ -734,6 +734,21 @@ void *dma_memcpy(void *dest, const void *src, size_t size)
 
return dest;
 }
+
+void *dma_memcpy(void *dest, const void *src, size_t size)
+{
+   size_t bulk;
+   size_t rest;
+   void * addr;
+
+   bulk = (size >> 16) << 16;
+   rest = size - bulk;
+   if (bulk)
+   _dma_memcpy(dest, src, bulk);
+   addr = _dma_memcpy(dest+bulk, src+bulk, rest);
+   return addr;
+}
+
 EXPORT_SYMBOL(dma_memcpy);
 
 void *safe_dma_memcpy(void *dest, const void *src, size_t size)
-- 
1.5.1.2
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 20/32] Blackfin arch: dma_memcpy borken for 64K

2007-05-21 Thread Bryan Wu
From: Aubrey Li [EMAIL PROTECTED]

Signed-off-by: Aubrey Li [EMAIL PROTECTED]
Signed-off-by: Bryan Wu [EMAIL PROTECTED]
---
 arch/blackfin/kernel/bfin_dma_5xx.c |   17 -
 1 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/arch/blackfin/kernel/bfin_dma_5xx.c 
b/arch/blackfin/kernel/bfin_dma_5xx.c
index 1c344ac..0ccb0dc 100644
--- a/arch/blackfin/kernel/bfin_dma_5xx.c
+++ b/arch/blackfin/kernel/bfin_dma_5xx.c
@@ -595,7 +595,7 @@ unsigned short get_dma_curr_ycount(unsigned int channel)
 }
 EXPORT_SYMBOL(get_dma_curr_ycount);
 
-void *dma_memcpy(void *dest, const void *src, size_t size)
+void *_dma_memcpy(void *dest, const void *src, size_t size)
 {
int direction;  /* 1 - address decrease, 0 - address increase */
int flag_align; /* 1 - address aligned,  0 - address unaligned */
@@ -734,6 +734,21 @@ void *dma_memcpy(void *dest, const void *src, size_t size)
 
return dest;
 }
+
+void *dma_memcpy(void *dest, const void *src, size_t size)
+{
+   size_t bulk;
+   size_t rest;
+   void * addr;
+
+   bulk = (size  16)  16;
+   rest = size - bulk;
+   if (bulk)
+   _dma_memcpy(dest, src, bulk);
+   addr = _dma_memcpy(dest+bulk, src+bulk, rest);
+   return addr;
+}
+
 EXPORT_SYMBOL(dma_memcpy);
 
 void *safe_dma_memcpy(void *dest, const void *src, size_t size)
-- 
1.5.1.2
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 20/32] Blackfin arch: dma_memcpy borken for 64K

2007-05-21 Thread Pekka Enberg

Hi Bryan,

On 5/21/07, Bryan Wu [EMAIL PROTECTED] wrote:

-void *dma_memcpy(void *dest, const void *src, size_t size)
+void *_dma_memcpy(void *dest, const void *src, size_t size)


Minor nitpick: the established naming convention is two underscores, not one.


+void *dma_memcpy(void *dest, const void *src, size_t size)
+{
+   size_t bulk;
+   size_t rest;
+   void * addr;
+
+   bulk = (size  16)  16;


I assume this is significantly faster on your architecture than:

  bulk = size  ~0xUL;

which is more readable?


+   rest = size - bulk;
+   if (bulk)
+   _dma_memcpy(dest, src, bulk);
+   addr = _dma_memcpy(dest+bulk, src+bulk, rest);
+   return addr;


Does this work for 128K and up? Why?
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 20/32] Blackfin arch: dma_memcpy borken for 64K

2007-05-21 Thread Mike Frysinger

On 5/21/07, Pekka Enberg [EMAIL PROTECTED] wrote:

On 5/21/07, Bryan Wu [EMAIL PROTECTED] wrote:
 -void *dma_memcpy(void *dest, const void *src, size_t size)
 +void *_dma_memcpy(void *dest, const void *src, size_t size)

Minor nitpick: the established naming convention is two underscores, not one.


that should be marked as static now actually since the function isnt
for use outside of this file


 +void *dma_memcpy(void *dest, const void *src, size_t size)
 +{
 +   size_t bulk;
 +   size_t rest;
 +   void * addr;
 +
 +   bulk = (size  16)  16;

I assume this is significantly faster on your architecture than:

   bulk = size  ~0xUL;

which is more readable?


actually they should get optimized to the same thing
-mike
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/