Skip to contentSkip to conversation

Blackfin: hook up new perf_counter_open syscall

PATCH In review Mike Frysinger 4 participants 9 messages Jun 23, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 Blackfin: hook up new perf_counter_open syscall

---
 arch/blackfin/include/asm/unistd.h |    3 ++-
 arch/blackfin/mach-common/entry.S  |    1 +
 2 files changed, 3 insertions(+), 1 deletions(-)
arch/blackfin/include/asm/unistd.h +2 -1
index da35133..c8e7ee4 100644
@@ -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 */
arch/blackfin/mach-common/entry.S +1 -0
index 31fa313..5a4e7c7 100644
@@ -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
Signature · 1 line
1.6.3.1
#1 lore raw

PATCH 2/2 Blackfin: fix dma-mapping build errors

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.

---
 arch/blackfin/include/asm/dma-mapping.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
arch/blackfin/include/asm/dma-mapping.h +4 -0
index d7d9148..257eb42 100644
@@ -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 */
Signature · 1 line
1.6.3.1
#2 lore raw

Re: [PATCH 2/2] Blackfin: fix dma-mapping build errors

Quoted 2 lines · On Mon, 22 Jun 2009 21:54:46 -0400 Mike Frysinger <[email protected]> wrote:

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

Oops, sorry about that.

Quoted 3 lines

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.

arch/blackfin/include/asm/dma-mapping.h +13 -0
index d7d9148..6997836 100644
@@ -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 */
#3 lore raw

Re: [PATCH 2/2] Blackfin: fix dma-mapping build errors

Quoted 6 lines · FUJITA Tomonori
Quoted 2 lines · 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.

Quoted 8 lines
Quoted 3 lines

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"

Quoted 6 lines

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

#4 lore raw

Re: [PATCH 2/2] Blackfin: fix dma-mapping build errors

Quoted 11 lines · On Mon, 22 Jun 2009 22:29:29 -0400 Mike Frysinger <[email protected]> wrote:
Quoted 10 lines · FUJITA Tomonori
Quoted 2 lines · 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.

Quoted 3 lines

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.

Quoted 7 lines
Quoted 4 lines

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.

#5 lore raw

PATCH v2 2/2 Blackfin: fix dma-mapping build errors

In reply to FUJITA Tomonori

From: FUJITA Tomonori <[email protected]>

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.

---
 arch/blackfin/include/asm/dma-mapping.h |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
arch/blackfin/include/asm/dma-mapping.h +13 -0
index d7d9148..ed6b1f3 100644
@@ -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 */
Signature · 1 line
1.6.3.1
#6 lore raw

Re: [PATCH 2/2 v2] Blackfin: fix dma-mapping build errors

arch/blackfin/include/asm/dma-mapping.h static inline void dma_sync_single_for_device(struct device *dev, · line 109

Quoted 5 lines · Mike Frysinger
arch/blackfin/include/asm/dma-mapping.h +5 -0
+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 <><
#7 lore raw

Re: [PATCH 2/2 v2] Blackfin: fix dma-mapping build errors

Quoted 17 lines · Arnd Bergmann

arch/blackfin/include/asm/dma-mapping.h static inline void dma_sync_single_for_device(struct device *dev, · line 109

Quoted 5 lines · Mike Frysinger
arch/blackfin/include/asm/dma-mapping.h +5 -0
+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;

Quoted 3 lines

      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

#8 lore raw

Re: [PATCH 2/2 v2] Blackfin: fix dma-mapping build errors

Quoted 4 lines · Mike Frysinger

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 <><