2009-06-23 01:55:18

by Mike Frysinger

[permalink] [raw]
Subject: [PATCH 1/2] Blackfin: hook up new perf_counter_open syscall

Signed-off-by: Mike Frysinger <[email protected]>
---
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


2009-06-23 01:55:35

by Mike Frysinger

[permalink] [raw]
Subject: [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.

Signed-off-by: Mike Frysinger <[email protected]>
---
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

2009-06-23 02:16:00

by FUJITA Tomonori

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

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.


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

2009-06-23 02:29:54

by Mike Frysinger

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

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

2009-06-23 02:34:16

by Mike Frysinger

[permalink] [raw]
Subject: [PATCH 2/2 v2] Blackfin: fix dma-mapping build errors

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.

Signed-off-by: FUJITA Tomonori <[email protected]>
Signed-off-by: Mike Frysinger <[email protected]>
---
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

2009-06-23 02:39:18

by FUJITA Tomonori

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

On Mon, 22 Jun 2009 22:29:29 -0400
Mike Frysinger <[email protected]> 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.

2009-06-23 08:41:24

by Arnd Bergmann

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

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

2009-06-23 11:09:40

by Mike Frysinger

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

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

2009-06-23 13:09:22

by Arnd Bergmann

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

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