All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] Blackfin: hook up new perf_counter_open syscall
@ 2009-06-23  1:54 Mike Frysinger
  2009-06-23  1:54 ` [PATCH 2/2] Blackfin: fix dma-mapping build errors Mike Frysinger
  0 siblings, 1 reply; 9+ messages in thread
From: Mike Frysinger @ 2009-06-23  1:54 UTC (permalink / raw)
  To: linux-kernel; +Cc: uclinux-dist-devel

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
 arch/blackfin/include/asm/unistd.h |    3 ++-
 arch/blackfin/mach-common/entry.S  |    1 +
 2 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/arch/blackfin/include/asm/unistd.h b/arch/blackfin/include/asm/unistd.h
index da35133..c8e7ee4 100644
--- a/arch/blackfin/include/asm/unistd.h
+++ b/arch/blackfin/include/asm/unistd.h
@@ -381,8 +381,9 @@
 #define __NR_preadv		366
 #define __NR_pwritev		367
 #define __NR_rt_tgsigqueueinfo	368
+#define __NR_perf_counter_open	369
 
-#define __NR_syscall		369
+#define __NR_syscall		370
 #define NR_syscalls		__NR_syscall
 
 /* Old optional stuff no one actually uses */
diff --git a/arch/blackfin/mach-common/entry.S b/arch/blackfin/mach-common/entry.S
index 31fa313..5a4e7c7 100644
--- a/arch/blackfin/mach-common/entry.S
+++ b/arch/blackfin/mach-common/entry.S
@@ -1609,6 +1609,7 @@ ENTRY(_sys_call_table)
 	.long _sys_preadv
 	.long _sys_pwritev
 	.long _sys_rt_tgsigqueueinfo
+	.long _sys_perf_counter_open
 
 	.rept NR_syscalls-(.-_sys_call_table)/4
 	.long _sys_ni_syscall
-- 
1.6.3.1


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

* [PATCH 2/2] Blackfin: fix dma-mapping build errors
  2009-06-23  1:54 [PATCH 1/2] Blackfin: hook up new perf_counter_open syscall Mike Frysinger
@ 2009-06-23  1:54 ` Mike Frysinger
  2009-06-23  2:14   ` FUJITA Tomonori
  0 siblings, 1 reply; 9+ messages in thread
From: Mike Frysinger @ 2009-06-23  1:54 UTC (permalink / raw)
  To: linux-kernel; +Cc: uclinux-dist-devel

The recent deprecation of dma_sync_{sg,single} ironically broke Blackfin
systems.  This is because we don't define dma_sync_sg_for_cpu at all, so
until the DMA asm-generic conversion/cleanup is done after the next
release, simply redirect the dma_sync_sg_for_cpu to the debug version.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
 arch/blackfin/include/asm/dma-mapping.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/arch/blackfin/include/asm/dma-mapping.h b/arch/blackfin/include/asm/dma-mapping.h
index d7d9148..257eb42 100644
--- a/arch/blackfin/include/asm/dma-mapping.h
+++ b/arch/blackfin/include/asm/dma-mapping.h
@@ -1,6 +1,7 @@
 #ifndef _BLACKFIN_DMA_MAPPING_H
 #define _BLACKFIN_DMA_MAPPING_H
 
+#include <linux/dma-debug.h>
 #include <asm/scatterlist.h>
 
 void dma_alloc_init(unsigned long start, unsigned long end);
@@ -95,4 +96,7 @@ static inline void dma_sync_single_for_device(struct device *dev,
 					enum dma_data_direction dir)
 {
 }
+
+#define dma_sync_sg_for_cpu debug_dma_sync_sg_for_cpu
+
 #endif				/* _BLACKFIN_DMA_MAPPING_H */
-- 
1.6.3.1


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

* Re: [PATCH 2/2] Blackfin: fix dma-mapping build errors
  2009-06-23  1:54 ` [PATCH 2/2] Blackfin: fix dma-mapping build errors Mike Frysinger
@ 2009-06-23  2:14   ` FUJITA Tomonori
  2009-06-23  2:29     ` Mike Frysinger
  2009-06-23  2:33     ` [PATCH 2/2 v2] " Mike Frysinger
  0 siblings, 2 replies; 9+ messages in thread
From: FUJITA Tomonori @ 2009-06-23  2:14 UTC (permalink / raw)
  To: vapier; +Cc: linux-kernel, uclinux-dist-devel

On Mon, 22 Jun 2009 21:54:46 -0400
Mike Frysinger <vapier@gentoo.org> wrote:

> The recent deprecation of dma_sync_{sg,single} ironically broke Blackfin
> systems.

Oops, sorry about that.


> This is because we don't define dma_sync_sg_for_cpu at all, so
> until the DMA asm-generic conversion/cleanup is done after the next
> release, simply redirect the dma_sync_sg_for_cpu to the debug version.

This doesn't look correct (though it works). dma-debug.h is supposed
to be used by architectures that support DMA_API_DEBUG feature
(blackfin doesn't support it). dma_sync_sg_for_cpu is not the
debug version of dma_sync_sg_for_cpu.

I think that simply adding dummy dma_sync_single_for_device() is a
proper solution (as blackfin already does wrt dma_sync_single_for_cpu
and dma_sync_single_for_device).

Architectures are also supposed to have dma_sync_sg_for_cpu and
dma_sync_sg_for_device, so let's add both.


diff --git a/arch/blackfin/include/asm/dma-mapping.h b/arch/blackfin/include/asm/dma-mapping.h
index d7d9148..6997836 100644
--- a/arch/blackfin/include/asm/dma-mapping.h
+++ b/arch/blackfin/include/asm/dma-mapping.h
@@ -95,4 +95,17 @@ static inline void dma_sync_single_for_device(struct device *dev,
 					enum dma_data_direction dir)
 {
 }
+
+static inline void dma_sync_sg_for_cpu(struct device *dev,
+				       struct scatterlist *sg,
+				       int nents, enum dma_data_direction dir)
+{
+}
+
+static inline void dma_sync_sg_for_device(struct device *dev,
+					  struct scatterlist *sg,
+					  int nents, enum dma_data_direction dir)
+{
+}
+
 #endif				/* _BLACKFIN_DMA_MAPPING_H */

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

* Re: [PATCH 2/2] Blackfin: fix dma-mapping build errors
  2009-06-23  2:14   ` FUJITA Tomonori
@ 2009-06-23  2:29     ` Mike Frysinger
  2009-06-23  2:37       ` FUJITA Tomonori
  2009-06-23  2:33     ` [PATCH 2/2 v2] " Mike Frysinger
  1 sibling, 1 reply; 9+ messages in thread
From: Mike Frysinger @ 2009-06-23  2:29 UTC (permalink / raw)
  To: FUJITA Tomonori; +Cc: linux-kernel, uclinux-dist-devel

On Mon, Jun 22, 2009 at 22:14, FUJITA Tomonori wrote:
> On Mon, 22 Jun 2009 21:54:46 -0400 Mike Frysinger wrote:
>> The recent deprecation of dma_sync_{sg,single} ironically broke Blackfin
>> systems.
>
> Oops, sorry about that.
>
>> This is because we don't define dma_sync_sg_for_cpu at all, so
>> until the DMA asm-generic conversion/cleanup is done after the next
>> release, simply redirect the dma_sync_sg_for_cpu to the debug version.
>
> This doesn't look correct (though it works). dma-debug.h is supposed
> to be used by architectures that support DMA_API_DEBUG feature
> (blackfin doesn't support it). dma_sync_sg_for_cpu is not the
> debug version of dma_sync_sg_for_cpu.

guessing you meant "debug_dma_sync_sg_for_cpu is not the debug version
of dma_sync_sg_for_cpu"

> I think that simply adding dummy dma_sync_single_for_device() is a
> proper solution (as blackfin already does wrt dma_sync_single_for_cpu
> and dma_sync_single_for_device).
>
> Architectures are also supposed to have dma_sync_sg_for_cpu and
> dma_sync_sg_for_device, so let's add both.

i'm not really familiar with the DMA mapping functions, so if you say
this is the way to go, then it's fine by me.  not like it'll lead to
any runtime failures for us.
-mike

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

* [PATCH 2/2 v2] Blackfin: fix dma-mapping build errors
  2009-06-23  2:14   ` FUJITA Tomonori
  2009-06-23  2:29     ` Mike Frysinger
@ 2009-06-23  2:33     ` Mike Frysinger
  2009-06-23  8:40       ` Arnd Bergmann
  1 sibling, 1 reply; 9+ messages in thread
From: Mike Frysinger @ 2009-06-23  2:33 UTC (permalink / raw)
  To: linux-kernel; +Cc: uclinux-dist-devel, FUJITA Tomonori

From: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>

The recent deprecation of dma_sync_{sg,single} ironically broke Blackfin
systems.  This is because we don't define dma_sync_sg_for_cpu at all, so
until the DMA asm-generic conversion/cleanup is done after the next
release, simply stub out the dma_sync_sg_for_{cpu,device} functions.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
 arch/blackfin/include/asm/dma-mapping.h |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/arch/blackfin/include/asm/dma-mapping.h b/arch/blackfin/include/asm/dma-mapping.h
index d7d9148..ed6b1f3 100644
--- a/arch/blackfin/include/asm/dma-mapping.h
+++ b/arch/blackfin/include/asm/dma-mapping.h
@@ -95,4 +95,17 @@ static inline void dma_sync_single_for_device(struct device *dev,
 					enum dma_data_direction dir)
 {
 }
+
+static inline void dma_sync_sg_for_cpu(struct device *dev,
+					struct scatterlist *sg,
+					int nents, enum dma_data_direction dir)
+{
+}
+
+static inline void dma_sync_sg_for_device(struct device *dev,
+					struct scatterlist *sg,
+					int nents, enum dma_data_direction dir)
+{
+}
+
 #endif				/* _BLACKFIN_DMA_MAPPING_H */
-- 
1.6.3.1


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

* Re: [PATCH 2/2] Blackfin: fix dma-mapping build errors
  2009-06-23  2:29     ` Mike Frysinger
@ 2009-06-23  2:37       ` FUJITA Tomonori
  0 siblings, 0 replies; 9+ messages in thread
From: FUJITA Tomonori @ 2009-06-23  2:37 UTC (permalink / raw)
  To: vapier.adi; +Cc: fujita.tomonori, linux-kernel, uclinux-dist-devel

On Mon, 22 Jun 2009 22:29:29 -0400
Mike Frysinger <vapier.adi@gmail.com> wrote:

> On Mon, Jun 22, 2009 at 22:14, FUJITA Tomonori wrote:
> > On Mon, 22 Jun 2009 21:54:46 -0400 Mike Frysinger wrote:
> >> The recent deprecation of dma_sync_{sg,single} ironically broke Blackfin
> >> systems.
> >
> > Oops, sorry about that.
> >
> >> This is because we don't define dma_sync_sg_for_cpu at all, so
> >> until the DMA asm-generic conversion/cleanup is done after the next
> >> release, simply redirect the dma_sync_sg_for_cpu to the debug version.
> >
> > This doesn't look correct (though it works). dma-debug.h is supposed
> > to be used by architectures that support DMA_API_DEBUG feature
> > (blackfin doesn't support it). dma_sync_sg_for_cpu is not the
> > debug version of dma_sync_sg_for_cpu.
> 
> guessing you meant "debug_dma_sync_sg_for_cpu is not the debug version
> of dma_sync_sg_for_cpu"

Sorry, yeah, your guess is correct.

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

* Re: [PATCH 2/2 v2] Blackfin: fix dma-mapping build errors
  2009-06-23  2:33     ` [PATCH 2/2 v2] " Mike Frysinger
@ 2009-06-23  8:40       ` Arnd Bergmann
  2009-06-23 11:09         ` Mike Frysinger
  0 siblings, 1 reply; 9+ messages in thread
From: Arnd Bergmann @ 2009-06-23  8:40 UTC (permalink / raw)
  To: Mike Frysinger; +Cc: linux-kernel, uclinux-dist-devel, FUJITA Tomonori

On Tuesday 23 June 2009, Mike Frysinger wrote:

> +static inline void dma_sync_sg_for_device(struct device *dev,
> +					struct scatterlist *sg,
> +					int nents, enum dma_data_direction dir)
> +{
> +}

If you flush the dcache in dma_map_sg, you probably also need to
flush it in dma_sync_*_for_device:

static inline void
dma_sync_sg_for_device(struct device *dev, struct scatterlist *sglist,
                      int nents, enum dma_data_direction direction)
{
       struct scatterlist *sg;
       int i;

       for_each_sg(sglist, sg, nents, i)
               invalidate_dcache_range(sg_virt(sg), sg_virt(sg) + sg->length);
}

	Arnd <><

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

* Re: [PATCH 2/2 v2] Blackfin: fix dma-mapping build errors
  2009-06-23  8:40       ` Arnd Bergmann
@ 2009-06-23 11:09         ` Mike Frysinger
  2009-06-23 13:07           ` Arnd Bergmann
  0 siblings, 1 reply; 9+ messages in thread
From: Mike Frysinger @ 2009-06-23 11:09 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: linux-kernel, uclinux-dist-devel, FUJITA Tomonori

On Tue, Jun 23, 2009 at 04:40, Arnd Bergmann wrote:
> On Tuesday 23 June 2009, Mike Frysinger wrote:
>> +static inline void dma_sync_sg_for_device(struct device *dev,
>> +                                     struct scatterlist *sg,
>> +                                     int nents, enum dma_data_direction dir)
>> +{
>> +}
>
> If you flush the dcache in dma_map_sg, you probably also need to
> flush it in dma_sync_*_for_device:
>
> static inline void
> dma_sync_sg_for_device(struct device *dev, struct scatterlist *sglist,
>                      int nents, enum dma_data_direction direction)
> {
>       struct scatterlist *sg;
>       int i;
>
>       for_each_sg(sglist, sg, nents, i)
>               invalidate_dcache_range(sg_virt(sg), sg_virt(sg) + sg->length);
> }

i'll just integrate this into the patch you sent previously during the
next merge window.  these new functions werent actually being used
anywhere on Blackfin systems, so i'm not terribly worried about them
for now.
-mike

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

* Re: [PATCH 2/2 v2] Blackfin: fix dma-mapping build errors
  2009-06-23 11:09         ` Mike Frysinger
@ 2009-06-23 13:07           ` Arnd Bergmann
  0 siblings, 0 replies; 9+ messages in thread
From: Arnd Bergmann @ 2009-06-23 13:07 UTC (permalink / raw)
  To: Mike Frysinger; +Cc: linux-kernel, uclinux-dist-devel, FUJITA Tomonori

On Tuesday 23 June 2009, Mike Frysinger wrote:
> i'll just integrate this into the patch you sent previously during the
> next merge window.  these new functions werent actually being used
> anywhere on Blackfin systems, so i'm not terribly worried about them
> for now.

Ok, fair enough.

	Arnd <><

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

end of thread, other threads:[~2009-06-23 13:09 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-23  1:54 [PATCH 1/2] Blackfin: hook up new perf_counter_open syscall Mike Frysinger
2009-06-23  1:54 ` [PATCH 2/2] Blackfin: fix dma-mapping build errors Mike Frysinger
2009-06-23  2:14   ` FUJITA Tomonori
2009-06-23  2:29     ` Mike Frysinger
2009-06-23  2:37       ` FUJITA Tomonori
2009-06-23  2:33     ` [PATCH 2/2 v2] " Mike Frysinger
2009-06-23  8:40       ` Arnd Bergmann
2009-06-23 11:09         ` Mike Frysinger
2009-06-23 13:07           ` Arnd Bergmann

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.