Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[PATCH -mm 0/5] use asm-generic/scatterlist.h on every architecture

0 views
Skip to first unread message

FUJITA Tomonori

unread,
Apr 4, 2010, 10:50:01 AM4/4/10
to
This is the first half of the attempt to use asm-generic/scatterlist.h
on every architecture.

There are only two ways to define scatterlist structure. So it's easy
to convert every architecture to use asm-generic/scatterlist.h.

=
arch/alpha/Kconfig | 3 +++
arch/alpha/include/asm/scatterlist.h | 21 +++------------------
arch/arm/include/asm/scatterlist.h | 20 ++------------------
arch/ia64/Kconfig | 3 +++
arch/microblaze/include/asm/scatterlist.h | 2 ++
arch/powerpc/Kconfig | 3 +++
arch/powerpc/include/asm/scatterlist.h | 29 +----------------------------
arch/s390/include/asm/scatterlist.h | 2 ++
arch/score/include/asm/scatterlist.h | 2 ++
arch/sh/Kconfig | 3 +++
arch/sparc/Kconfig | 3 +++
arch/sparc/include/asm/scatterlist.h | 2 +-
arch/x86/Kconfig | 3 +++
include/asm-generic/scatterlist.h | 15 ++++-----------
14 files changed, 35 insertions(+), 76 deletions(-)


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majo...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

FUJITA Tomonori

unread,
Apr 4, 2010, 10:50:02 AM4/4/10
to
Signed-off-by: FUJITA Tomonori <fujita....@lab.ntt.co.jp>
Cc: Russell King <li...@arm.linux.org.uk>
---
arch/arm/include/asm/scatterlist.h | 20 ++------------------
1 files changed, 2 insertions(+), 18 deletions(-)

diff --git a/arch/arm/include/asm/scatterlist.h b/arch/arm/include/asm/scatterlist.h
index ca0a37d..bcda59f 100644
--- a/arch/arm/include/asm/scatterlist.h
+++ b/arch/arm/include/asm/scatterlist.h
@@ -4,24 +4,8 @@
#include <asm/memory.h>
#include <asm/types.h>

-struct scatterlist {
-#ifdef CONFIG_DEBUG_SG
- unsigned long sg_magic;
-#endif
- unsigned long page_link;
- unsigned int offset; /* buffer offset */
- dma_addr_t dma_address; /* dma address */
- unsigned int length; /* length */
-};
+#include <asm-generic/scatterlist.h>

-/*
- * These macros should be used after a pci_map_sg call has been done
- * to get bus addresses of each of the SG entries and their lengths.
- * You should only work with the number of sg entries pci_map_sg
- * returns, or alternatively stop on the first sg_dma_len(sg) which
- * is 0.
- */
-#define sg_dma_address(sg) ((sg)->dma_address)
-#define sg_dma_len(sg) ((sg)->length)
+#undef ARCH_HAS_SG_CHAIN

#endif /* _ASMARM_SCATTERLIST_H */
--
1.7.0

FUJITA Tomonori

unread,
Apr 4, 2010, 10:50:02 AM4/4/10
to
The trick for ISA_DMA_THRESHOLD in asm-generic/scatterlist.h doesn't
work for powerpc. This lets architectures defin ISA_DMA_THRESHOLD.

Hopefully, we can remove ISA_DMA_THRESHOLD in the future; we can do
better to decide if the bouncing is necessary or not.

Signed-off-by: FUJITA Tomonori <fujita....@lab.ntt.co.jp>
Cc: Arnd Bergmann <ar...@arndb.de>
---
arch/microblaze/include/asm/scatterlist.h | 2 ++


arch/s390/include/asm/scatterlist.h | 2 ++
arch/score/include/asm/scatterlist.h | 2 ++

arch/sparc/include/asm/scatterlist.h | 2 ++
include/asm-generic/scatterlist.h | 4 ----
5 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/arch/microblaze/include/asm/scatterlist.h b/arch/microblaze/include/asm/scatterlist.h
index 35d786f..be44d94 100644
--- a/arch/microblaze/include/asm/scatterlist.h
+++ b/arch/microblaze/include/asm/scatterlist.h
@@ -1 +1,3 @@
+#define ISA_DMA_THRESHOLD (~0UL)
+
#include <asm-generic/scatterlist.h>
diff --git a/arch/s390/include/asm/scatterlist.h b/arch/s390/include/asm/scatterlist.h
index 35d786f..be44d94 100644
--- a/arch/s390/include/asm/scatterlist.h
+++ b/arch/s390/include/asm/scatterlist.h
@@ -1 +1,3 @@
+#define ISA_DMA_THRESHOLD (~0UL)
+
#include <asm-generic/scatterlist.h>
diff --git a/arch/score/include/asm/scatterlist.h b/arch/score/include/asm/scatterlist.h
index 9f533b8..4fa1a66 100644
--- a/arch/score/include/asm/scatterlist.h
+++ b/arch/score/include/asm/scatterlist.h
@@ -1,6 +1,8 @@
#ifndef _ASM_SCORE_SCATTERLIST_H
#define _ASM_SCORE_SCATTERLIST_H

+#define ISA_DMA_THRESHOLD (~0UL)
+
#include <asm-generic/scatterlist.h>

#endif /* _ASM_SCORE_SCATTERLIST_H */
diff --git a/arch/sparc/include/asm/scatterlist.h b/arch/sparc/include/asm/scatterlist.h
index d112025..0fa0d6d 100644
--- a/arch/sparc/include/asm/scatterlist.h
+++ b/arch/sparc/include/asm/scatterlist.h
@@ -3,6 +3,8 @@

#define sg_dma_len(sg) ((sg)->dma_length)

+#define ISA_DMA_THRESHOLD (~0UL)
+
#include <asm-generic/scatterlist.h>

#endif /* !(_SPARC_SCATTERLIST_H) */
diff --git a/include/asm-generic/scatterlist.h b/include/asm-generic/scatterlist.h
index 8b94544..51a7a43 100644
--- a/include/asm-generic/scatterlist.h
+++ b/include/asm-generic/scatterlist.h
@@ -34,10 +34,6 @@ struct scatterlist {
#endif /* 64 bit */
#endif /* sg_dma_len */

-#ifndef ISA_DMA_THRESHOLD
-#define ISA_DMA_THRESHOLD (~0UL)
-#endif
-
#define ARCH_HAS_SG_CHAIN

#endif /* __ASM_GENERIC_SCATTERLIST_H */
--
1.7.0

FUJITA Tomonori

unread,
Apr 4, 2010, 10:50:01 AM4/4/10
to
Signed-off-by: FUJITA Tomonori <fujita....@lab.ntt.co.jp>
Cc: Richard Henderson <r...@twiddle.net>
Cc: Ivan Kokshaysky <i...@jurassic.park.msu.ru>
Cc: Matt Turner <matt...@gmail.com>
---

arch/alpha/Kconfig | 3 +++
arch/alpha/include/asm/scatterlist.h | 21 +++------------------
2 files changed, 6 insertions(+), 18 deletions(-)

diff --git a/arch/alpha/Kconfig b/arch/alpha/Kconfig
index d1a1d83..ffc8253 100644
--- a/arch/alpha/Kconfig
+++ b/arch/alpha/Kconfig
@@ -58,6 +58,9 @@ config ZONE_DMA
config NEED_DMA_MAP_STATE
def_bool y

+config NEED_SG_DMA_LENGTH
+ def_bool y
+
config GENERIC_ISA_DMA
bool
default y
diff --git a/arch/alpha/include/asm/scatterlist.h b/arch/alpha/include/asm/scatterlist.h
index 440747c..85a0ef2 100644
--- a/arch/alpha/include/asm/scatterlist.h
+++ b/arch/alpha/include/asm/scatterlist.h
@@ -1,25 +1,10 @@
#ifndef _ALPHA_SCATTERLIST_H
#define _ALPHA_SCATTERLIST_H

-#include <asm/page.h>
-#include <asm/types.h>
-

-struct scatterlist {
-#ifdef CONFIG_DEBUG_SG
- unsigned long sg_magic;
-#endif
- unsigned long page_link;
- unsigned int offset;

-
- unsigned int length;
-
- dma_addr_t dma_address;
- __u32 dma_length;
-};
+#define ISA_DMA_THRESHOLD (~0UL)

-#define sg_dma_address(sg) ((sg)->dma_address)
-#define sg_dma_len(sg) ((sg)->dma_length)
+#include <asm-generic/scatterlist.h>

-#define ISA_DMA_THRESHOLD (~0UL)
+#undef ARCH_HAS_SG_CHAIN

#endif /* !(_ALPHA_SCATTERLIST_H) */
--
1.7.0

0 new messages