Skip to contentSkip to conversation

ARM: no longer force unbuffered DMA for realview

PATCH New Arnd Bergmann 2 participants 6 messages Feb 26, 2015 – Feb 27, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 4/10 ARM: no longer force unbuffered DMA for realview

Commit 42c4dafe803dca ("ARM: 6202/1: Do not ARM_DMA_MEM_BUFFERABLE on RealView boards with L210/L220") changed the generic setting for ARM_DMA_MEM_BUFFERABLE to be disabled on any Realview kernel that includes support for any of the ARM11 variations. Doing this was required to allow doing DMA without a lockup in the l2x0 cache controller on the Realview platform.

Unfortunately, in a kernel that also contains support for any ARMv7 based machine, the same change makes it impossible to do DMA on ARMv7, which gets in the way of enabling multiplatform support on Realview.

As confirmed by Catalin Marinas and Linus Walleij, the current code for Realview that we have in the kernel does not actually perform any DMA, and this is unlikely to change in the future. Therefore we can revert 42c4dafe803dca without introducing regressions, but we must never start using DMA on this platform in the future.

Cc Linus Walleij <[email protected]>
Cc Russell King <[email protected]>
---
 arch/arm/mm/Kconfig | 2 --
 1 file changed, 2 deletions(-)
arch/arm/mm/Kconfig +0 -2
index 9b4f29e595a4..932dde34661e 100644
@@ -972,8 +972,6 @@ config ARM_L1_CACHE_SHIFT
 
 config ARM_DMA_MEM_BUFFERABLE
 	bool "Use non-cacheable memory for DMA" if (CPU_V6 || CPU_V6K) && !CPU_V7
-	depends on !(MACH_REALVIEW_PB1176 || REALVIEW_EB_ARM11MP || \
-		     MACH_REALVIEW_PB11MP)
 	default y if CPU_V6 || CPU_V6K || CPU_V7
 	help
 	  Historically, the kernel has used strongly ordered mappings to
Signature · 1 line
2.1.0.rc2
#1 lore raw

PATCH 5/10 ARM: realview: remove private barrier implementation

The realview barrier implementation tries to avoid calling outer_sync in order to not lock up as a result of a bug in the l220 cache controller.

This gets in the way of the multiplatform support, but we can still remove it if we make sure that the outer_sync function never gets called, by replacing the function pointer with NULL, right after initialization.

---
 arch/arm/mach-realview/Kconfig                 | 2 --
 arch/arm/mach-realview/include/mach/barriers.h | 8 --------
 arch/arm/mach-realview/realview_eb.c           | 6 ++++++
 arch/arm/mach-realview/realview_pb11mp.c       | 5 +++++
 4 files changed, 11 insertions(+), 10 deletions(-)
 delete mode 100644 arch/arm/mach-realview/include/mach/barriers.h
arch/arm/mach-realview/Kconfig +0 -2
index 0fe63b543f5b..055e7355ec14 100644
@@ -36,7 +36,6 @@ config REALVIEW_EB_A9MP
 config REALVIEW_EB_ARM11MP
 	bool "Support ARM11MPCore Tile"
 	depends on MACH_REALVIEW_EB
-	select ARCH_HAS_BARRIERS if SMP
 	select CPU_V6K
 	select HAVE_ARM_SCU if SMP
 	select HAVE_ARM_TWD if SMP
@@ -57,7 +56,6 @@ config REALVIEW_EB_ARM11MP_REVB
 
 config MACH_REALVIEW_PB11MP
 	bool "Support RealView(R) Platform Baseboard for ARM11MPCore"
-	select ARCH_HAS_BARRIERS if SMP
 	select ARM_GIC
 	select CPU_V6K
 	select HAVE_ARM_SCU if SMP
arch/arm/mach-realview/include/mach/barriers.h deleted +0 -8
deleted file mode 100644
index 9a732195aa1c..000000000000
@@ -1,8 +0,0 @@
-/*
- * Barriers redefined for RealView ARM11MPCore platforms with L220 cache
- * controller to work around hardware errata causing the outer_sync()
- * operation to deadlock the system.
- */
-#define mb()		dsb()
-#define rmb()		dsb()
-#define wmb()		mb()
arch/arm/mach-realview/realview_eb.c +6 -0
index 64c88d657f9e..cebfdce1c7cd 100644
@@ -450,6 +450,12 @@ static void __init realview_eb_init(void)
 		 * Bits:  .... ...0 0111 1001 0000 .... .... ....
 		 */
 		l2x0_init(__io_address(REALVIEW_EB11MP_L220_BASE), 0x00790000, 0xfe000fff);
+
+		/*
+		 * due to a bug in the l220 cache controller, we must not call
+		 * the sync function. stub it out here instead!
+		 */
+		outer_cache.sync = NULL;
 #endif
 		pmu_device.name = core_tile_a9mp() ? "armv7-pmu" : "armv6-pmu";
 		platform_device_register(&pmu_device);
arch/arm/mach-realview/realview_pb11mp.c +5 -0
index 15c45e25095f..f9817bb5d8fa 100644
@@ -345,6 +345,11 @@ static void __init realview_pb11mp_init(void)
 	 * Bits:  .... ...0 0111 1001 0000 .... .... ....
 	 */
 	l2x0_init(__io_address(REALVIEW_TC11MP_L220_BASE), 0x00790000, 0xfe000fff);
+	/*
+	 * due to a bug in the l220 cache controller, we must not call
+	 * the sync function. stub it out here instead!
+	 */
+	outer_cache.sync = NULL;
 #endif
 
 	realview_flash_register(realview_pb11mp_flash_resource,
Signature · 1 line
2.1.0.rc2
#2 lore raw

PATCH 5/10 ARM: realview: remove private barrier implementation

Quoted 8 lines · Arnd Bergmann

The realview barrier implementation tries to avoid calling outer_sync in order to not lock up as a result of a bug in the l220 cache controller.

This gets in the way of the multiplatform support, but we can still remove it if we make sure that the outer_sync function never gets called, by replacing the function pointer with NULL, right after initialization.

Yours,
Linus Walleij

#3 lore raw

PATCH 6/10 ARM: realview: enable multiplatform

In reply to Arnd Bergmann

All obstacles are out of the way by now, so we can finally move realview to multiplatform.

Cc Linus Walleij <[email protected]>
Cc Russell King <[email protected]>
---
 arch/arm/Kconfig                | 14 ----------
 arch/arm/mach-realview/Kconfig  | 58 ++++++++++++++++++++++++++++++++---------
 arch/arm/mach-realview/Makefile |  7 ++++-
 3 files changed, 52 insertions(+), 27 deletions(-)
arch/arm/Kconfig +0 -14
index 44e5879e4efc..a4f9c932c4de 100644
@@ -322,20 +322,6 @@ config ARCH_MULTIPLATFORM
 	select SPARSE_IRQ
 	select USE_OF
 
-config ARCH_REALVIEW
-	bool "ARM Ltd. RealView family"
-	select ARCH_WANT_OPTIONAL_GPIOLIB
-	select ARM_AMBA
-	select ARM_TIMER_SP804
-	select COMMON_CLK
-	select COMMON_CLK_VERSATILE
-	select GENERIC_CLOCKEVENTS
-	select GPIO_PL061 if GPIOLIB
-	select ICST
-	select PLAT_VERSATILE
-	select PLAT_VERSATILE_SCHED_CLOCK
-	help
-	  This enables support for ARM Ltd RealView boards.
 
 config ARCH_VERSATILE
 	bool "ARM Ltd. Versatile family"
arch/arm/mach-realview/Kconfig +43 -12

114 lines not on this page · raw message

arch/arm/mach-realview/Makefile +6 -1
index e07fdf7ae8a7..ee0dfaedfa1f 100644
@@ -1,13 +1,18 @@
 #
 # Makefile for the linux kernel.
 #
+ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(srctree)/$(src)/include \
+	-I$(srctree)/arch/arm/plat-versatile/include
+
 
-obj-y					:= core.o
 obj-$(CONFIG_REALVIEW_DT)		+= realview-dt.o
+ifdef $(CONFIG_ATAGS)
+obj-y					:= core.o
 obj-$(CONFIG_MACH_REALVIEW_EB)		+= realview_eb.o
 obj-$(CONFIG_MACH_REALVIEW_PB11MP)	+= realview_pb11mp.o
 obj-$(CONFIG_MACH_REALVIEW_PB1176)	+= realview_pb1176.o
 obj-$(CONFIG_MACH_REALVIEW_PBA8)	+= realview_pba8.o
 obj-$(CONFIG_MACH_REALVIEW_PBX)		+= realview_pbx.o
+endif
 obj-$(CONFIG_SMP)			+= platsmp.o
 obj-$(CONFIG_HOTPLUG_CPU)		+= hotplug.o
Signature · 1 line
2.1.0.rc2
#5 lore raw

PATCH 4/10 ARM: no longer force unbuffered DMA for realview

In reply to Arnd Bergmann
Quoted 17 lines · Arnd Bergmann

Commit 42c4dafe803dca ("ARM: 6202/1: Do not ARM_DMA_MEM_BUFFERABLE on RealView boards with L210/L220") changed the generic setting for ARM_DMA_MEM_BUFFERABLE to be disabled on any Realview kernel that includes support for any of the ARM11 variations. Doing this was required to allow doing DMA without a lockup in the l2x0 cache controller on the Realview platform.

Unfortunately, in a kernel that also contains support for any ARMv7 based machine, the same change makes it impossible to do DMA on ARMv7, which gets in the way of enabling multiplatform support on Realview.

As confirmed by Catalin Marinas and Linus Walleij, the current code for Realview that we have in the kernel does not actually perform any DMA, and this is unlikely to change in the future. Therefore we can revert 42c4dafe803dca without introducing regressions, but we must never start using DMA on this platform in the future.

Quoted 3 lines
Cc Linus Walleij <[email protected]>
Cc Russell King <[email protected]>

The only platform that I actually got it working on was ARM PB11MPCore, and only for the PL011 serial port (MMC for example will never work). Maybe AACI works, maybe. But it's not worth the effort, so:

Yours,
Linus Walleij