Skip to contentSkip to conversation

sparc: use generic dma_noncoherent_ops

PATCH Superseded Christoph Hellwig 2 participants 2 messages Jul 30, 2018 1 message not in the archive

Subsystems (2)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sparc: use generic dma_noncoherent_ops

Switch to the generic noncoherent direct mapping implementation.

This removes the previous sync_single_for_device implementation, which looks bogus given that no syncing is happening in the similar but more important map_single case.

---
 Makefile                             |   2 +-
 arch/sparc/Kconfig                   |   2 +
 arch/sparc/include/asm/dma-mapping.h |   5 +-
 arch/sparc/kernel/ioport.c           | 193 +++++----------------------
 4 files changed, 36 insertions(+), 166 deletions(-)
Makefile +1 -1
index 85f3481a56d6..8a3fd0c4a76e 100644
@@ -368,7 +368,7 @@ HOST_LOADLIBES := $(HOST_LFS_LIBS)
 # Make variables (CC, etc...)
 AS		= $(CROSS_COMPILE)as
 LD		= $(CROSS_COMPILE)ld
-CC		= $(CROSS_COMPILE)gcc
+CC		= sparc64-linux-gnu-gcc-8
 CPP		= $(CC) -E
 AR		= $(CROSS_COMPILE)ar
 NM		= $(CROSS_COMPILE)nm
arch/sparc/Kconfig +2 -0
index 0f535debf802..79f29c67291a 100644
@@ -48,6 +48,8 @@ config SPARC
 
 config SPARC32
 	def_bool !64BIT
+	select ARCH_HAS_SYNC_DMA_FOR_CPU
+	select DMA_NONCOHERENT_OPS
 	select GENERIC_ATOMIC64
 	select CLZ_TAB
 	select HAVE_UID16
arch/sparc/include/asm/dma-mapping.h +2 -3
index 12ae33daf52f..e17566376934 100644
@@ -7,7 +7,6 @@
 #include <linux/dma-debug.h>
 
 extern const struct dma_map_ops *dma_ops;
-extern const struct dma_map_ops pci32_dma_ops;
 
 extern struct bus_type pci_bus_type;
 
@@ -15,11 +14,11 @@ static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus)
 {
 #ifdef CONFIG_SPARC_LEON
 	if (sparc_cpu_model == sparc_leon)
-		return &pci32_dma_ops;
+		return &dma_noncoherent_ops;
 #endif
 #if defined(CONFIG_SPARC32) && defined(CONFIG_PCI)
 	if (bus == &pci_bus_type)
-		return &pci32_dma_ops;
+		return &dma_noncoherent_ops;
 #endif
 	return dma_ops;
 }
arch/sparc/kernel/ioport.c +31 -162

263 lines not on this page · raw message

Signature · 1 line
2.18.0

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw

Hi Christoph.

Quoted 20 lines · Christoph Hellwig

Switch to the generic noncoherent direct mapping implementation.

This removes the previous sync_single_for_device implementation, which looks bogus given that no syncing is happening in the similar but more important map_single case.

---
 Makefile                             |   2 +-
 arch/sparc/Kconfig                   |   2 +
 arch/sparc/include/asm/dma-mapping.h |   5 +-
 arch/sparc/kernel/ioport.c           | 193 +++++----------------------
 4 files changed, 36 insertions(+), 166 deletions(-)
Makefile +0 -0
index 85f3481a56d6..8a3fd0c4a76e 100644

Makefile HOST_LOADLIBES := $(HOST_LFS_LIBS) · line 374

Quoted 8 lines
Makefile +1 -1
@@ -368,7 +368,7 @@ HOST_LOADLIBES := $(HOST_LFS_LIBS)
 # Make variables (CC, etc...)
 AS		= $(CROSS_COMPILE)as
 LD		= $(CROSS_COMPILE)ld
-CC		= $(CROSS_COMPILE)gcc
+CC		= sparc64-linux-gnu-gcc-8
 CPP		= $(CC) -E
 AR		= $(CROSS_COMPILE)ar
 NM		= $(CROSS_COMPILE)nm

This sneaked in by accident...

Sam