diff options
-rw-r--r-- | arch/arm/Kconfig | 2 | ||||
-rw-r--r-- | arch/arm/include/asm/edac.h | 5 | ||||
-rw-r--r-- | arch/mips/Kconfig | 1 | ||||
-rw-r--r-- | arch/mips/include/asm/edac.h | 4 | ||||
-rw-r--r-- | arch/powerpc/Kconfig | 2 | ||||
-rw-r--r-- | arch/powerpc/include/asm/edac.h | 4 | ||||
-rw-r--r-- | arch/tile/Kconfig | 1 | ||||
-rw-r--r-- | arch/tile/include/asm/edac.h | 29 | ||||
-rw-r--r-- | arch/x86/Kconfig | 2 | ||||
-rw-r--r-- | arch/x86/include/asm/edac.h | 2 | ||||
-rw-r--r-- | drivers/edac/Kconfig | 7 | ||||
-rw-r--r-- | drivers/edac/edac_mc.c | 9 |
12 files changed, 27 insertions, 41 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 45df48ba0b12..325d6f3a596a 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig | |||
@@ -15,6 +15,8 @@ config ARM | |||
15 | select CLONE_BACKWARDS | 15 | select CLONE_BACKWARDS |
16 | select CPU_PM if (SUSPEND || CPU_IDLE) | 16 | select CPU_PM if (SUSPEND || CPU_IDLE) |
17 | select DCACHE_WORD_ACCESS if HAVE_EFFICIENT_UNALIGNED_ACCESS | 17 | select DCACHE_WORD_ACCESS if HAVE_EFFICIENT_UNALIGNED_ACCESS |
18 | select EDAC_SUPPORT | ||
19 | select EDAC_ATOMIC_SCRUB | ||
18 | select GENERIC_ALLOCATOR | 20 | select GENERIC_ALLOCATOR |
19 | select GENERIC_ATOMIC64 if (CPU_V7M || CPU_V6 || !CPU_32v6K || !AEABI) | 21 | select GENERIC_ATOMIC64 if (CPU_V7M || CPU_V6 || !CPU_32v6K || !AEABI) |
20 | select GENERIC_CLOCKEVENTS_BROADCAST if SMP | 22 | select GENERIC_CLOCKEVENTS_BROADCAST if SMP |
diff --git a/arch/arm/include/asm/edac.h b/arch/arm/include/asm/edac.h index 0df7a2c1fc3d..5189fa819b60 100644 --- a/arch/arm/include/asm/edac.h +++ b/arch/arm/include/asm/edac.h | |||
@@ -18,11 +18,12 @@ | |||
18 | #define ASM_EDAC_H | 18 | #define ASM_EDAC_H |
19 | /* | 19 | /* |
20 | * ECC atomic, DMA, SMP and interrupt safe scrub function. | 20 | * ECC atomic, DMA, SMP and interrupt safe scrub function. |
21 | * Implements the per arch atomic_scrub() that EDAC use for software | 21 | * Implements the per arch edac_atomic_scrub() that EDAC use for software |
22 | * ECC scrubbing. It reads memory and then writes back the original | 22 | * ECC scrubbing. It reads memory and then writes back the original |
23 | * value, allowing the hardware to detect and correct memory errors. | 23 | * value, allowing the hardware to detect and correct memory errors. |
24 | */ | 24 | */ |
25 | static inline void atomic_scrub(void *va, u32 size) | 25 | |
26 | static inline void edac_atomic_scrub(void *va, u32 size) | ||
26 | { | 27 | { |
27 | #if __LINUX_ARM_ARCH__ >= 6 | 28 | #if __LINUX_ARM_ARCH__ >= 6 |
28 | unsigned int *virt_addr = va; | 29 | unsigned int *virt_addr = va; |
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index f5016656494f..b65edf514b40 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig | |||
@@ -819,6 +819,7 @@ config CAVIUM_OCTEON_SOC | |||
819 | select SYS_SUPPORTS_64BIT_KERNEL | 819 | select SYS_SUPPORTS_64BIT_KERNEL |
820 | select SYS_SUPPORTS_BIG_ENDIAN | 820 | select SYS_SUPPORTS_BIG_ENDIAN |
821 | select EDAC_SUPPORT | 821 | select EDAC_SUPPORT |
822 | select EDAC_ATOMIC_SCRUB | ||
822 | select SYS_SUPPORTS_LITTLE_ENDIAN | 823 | select SYS_SUPPORTS_LITTLE_ENDIAN |
823 | select SYS_SUPPORTS_HOTPLUG_CPU if CPU_BIG_ENDIAN | 824 | select SYS_SUPPORTS_HOTPLUG_CPU if CPU_BIG_ENDIAN |
824 | select SYS_HAS_EARLY_PRINTK | 825 | select SYS_HAS_EARLY_PRINTK |
diff --git a/arch/mips/include/asm/edac.h b/arch/mips/include/asm/edac.h index 94105d3f58f4..980b16527374 100644 --- a/arch/mips/include/asm/edac.h +++ b/arch/mips/include/asm/edac.h | |||
@@ -5,7 +5,7 @@ | |||
5 | 5 | ||
6 | /* ECC atomic, DMA, SMP and interrupt safe scrub function */ | 6 | /* ECC atomic, DMA, SMP and interrupt safe scrub function */ |
7 | 7 | ||
8 | static inline void atomic_scrub(void *va, u32 size) | 8 | static inline void edac_atomic_scrub(void *va, u32 size) |
9 | { | 9 | { |
10 | unsigned long *virt_addr = va; | 10 | unsigned long *virt_addr = va; |
11 | unsigned long temp; | 11 | unsigned long temp; |
@@ -21,7 +21,7 @@ static inline void atomic_scrub(void *va, u32 size) | |||
21 | 21 | ||
22 | __asm__ __volatile__ ( | 22 | __asm__ __volatile__ ( |
23 | " .set mips2 \n" | 23 | " .set mips2 \n" |
24 | "1: ll %0, %1 # atomic_scrub \n" | 24 | "1: ll %0, %1 # edac_atomic_scrub \n" |
25 | " addu %0, $0 \n" | 25 | " addu %0, $0 \n" |
26 | " sc %0, %1 \n" | 26 | " sc %0, %1 \n" |
27 | " beqz %0, 1b \n" | 27 | " beqz %0, 1b \n" |
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index 190cc48abc0c..5ef27113b898 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig | |||
@@ -153,6 +153,8 @@ config PPC | |||
153 | select NO_BOOTMEM | 153 | select NO_BOOTMEM |
154 | select HAVE_GENERIC_RCU_GUP | 154 | select HAVE_GENERIC_RCU_GUP |
155 | select HAVE_PERF_EVENTS_NMI if PPC64 | 155 | select HAVE_PERF_EVENTS_NMI if PPC64 |
156 | select EDAC_SUPPORT | ||
157 | select EDAC_ATOMIC_SCRUB | ||
156 | 158 | ||
157 | config GENERIC_CSUM | 159 | config GENERIC_CSUM |
158 | def_bool CPU_LITTLE_ENDIAN | 160 | def_bool CPU_LITTLE_ENDIAN |
diff --git a/arch/powerpc/include/asm/edac.h b/arch/powerpc/include/asm/edac.h index 6ead88bbfbb8..5571e23d253e 100644 --- a/arch/powerpc/include/asm/edac.h +++ b/arch/powerpc/include/asm/edac.h | |||
@@ -12,11 +12,11 @@ | |||
12 | #define ASM_EDAC_H | 12 | #define ASM_EDAC_H |
13 | /* | 13 | /* |
14 | * ECC atomic, DMA, SMP and interrupt safe scrub function. | 14 | * ECC atomic, DMA, SMP and interrupt safe scrub function. |
15 | * Implements the per arch atomic_scrub() that EDAC use for software | 15 | * Implements the per arch edac_atomic_scrub() that EDAC use for software |
16 | * ECC scrubbing. It reads memory and then writes back the original | 16 | * ECC scrubbing. It reads memory and then writes back the original |
17 | * value, allowing the hardware to detect and correct memory errors. | 17 | * value, allowing the hardware to detect and correct memory errors. |
18 | */ | 18 | */ |
19 | static __inline__ void atomic_scrub(void *va, u32 size) | 19 | static __inline__ void edac_atomic_scrub(void *va, u32 size) |
20 | { | 20 | { |
21 | unsigned int *virt_addr = va; | 21 | unsigned int *virt_addr = va; |
22 | unsigned int temp; | 22 | unsigned int temp; |
diff --git a/arch/tile/Kconfig b/arch/tile/Kconfig index a07e31b50d3f..59cf0b911898 100644 --- a/arch/tile/Kconfig +++ b/arch/tile/Kconfig | |||
@@ -28,6 +28,7 @@ config TILE | |||
28 | select HAVE_DEBUG_STACKOVERFLOW | 28 | select HAVE_DEBUG_STACKOVERFLOW |
29 | select ARCH_WANT_FRAME_POINTERS | 29 | select ARCH_WANT_FRAME_POINTERS |
30 | select HAVE_CONTEXT_TRACKING | 30 | select HAVE_CONTEXT_TRACKING |
31 | select EDAC_SUPPORT | ||
31 | 32 | ||
32 | # FIXME: investigate whether we need/want these options. | 33 | # FIXME: investigate whether we need/want these options. |
33 | # select HAVE_IOREMAP_PROT | 34 | # select HAVE_IOREMAP_PROT |
diff --git a/arch/tile/include/asm/edac.h b/arch/tile/include/asm/edac.h deleted file mode 100644 index 87fc83eeaffd..000000000000 --- a/arch/tile/include/asm/edac.h +++ /dev/null | |||
@@ -1,29 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright 2011 Tilera Corporation. All Rights Reserved. | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or | ||
5 | * modify it under the terms of the GNU General Public License | ||
6 | * as published by the Free Software Foundation, version 2. | ||
7 | * | ||
8 | * This program is distributed in the hope that it will be useful, but | ||
9 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
10 | * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or | ||
11 | * NON INFRINGEMENT. See the GNU General Public License for | ||
12 | * more details. | ||
13 | */ | ||
14 | |||
15 | #ifndef _ASM_TILE_EDAC_H | ||
16 | #define _ASM_TILE_EDAC_H | ||
17 | |||
18 | /* ECC atomic, DMA, SMP and interrupt safe scrub function */ | ||
19 | |||
20 | static inline void atomic_scrub(void *va, u32 size) | ||
21 | { | ||
22 | /* | ||
23 | * These is nothing to be done here because CE is | ||
24 | * corrected by the mshim. | ||
25 | */ | ||
26 | return; | ||
27 | } | ||
28 | |||
29 | #endif /* _ASM_TILE_EDAC_H */ | ||
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 226d5696e1d1..482c160a9fe9 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig | |||
@@ -143,6 +143,8 @@ config X86 | |||
143 | select ACPI_LEGACY_TABLES_LOOKUP if ACPI | 143 | select ACPI_LEGACY_TABLES_LOOKUP if ACPI |
144 | select X86_FEATURE_NAMES if PROC_FS | 144 | select X86_FEATURE_NAMES if PROC_FS |
145 | select SRCU | 145 | select SRCU |
146 | select EDAC_SUPPORT | ||
147 | select EDAC_ATOMIC_SCRUB | ||
146 | 148 | ||
147 | config INSTRUCTION_DECODER | 149 | config INSTRUCTION_DECODER |
148 | def_bool y | 150 | def_bool y |
diff --git a/arch/x86/include/asm/edac.h b/arch/x86/include/asm/edac.h index e9b57ecc70c5..cf8fdf83b231 100644 --- a/arch/x86/include/asm/edac.h +++ b/arch/x86/include/asm/edac.h | |||
@@ -3,7 +3,7 @@ | |||
3 | 3 | ||
4 | /* ECC atomic, DMA, SMP and interrupt safe scrub function */ | 4 | /* ECC atomic, DMA, SMP and interrupt safe scrub function */ |
5 | 5 | ||
6 | static inline void atomic_scrub(void *va, u32 size) | 6 | static inline void edac_atomic_scrub(void *va, u32 size) |
7 | { | 7 | { |
8 | u32 i, *virt_addr = va; | 8 | u32 i, *virt_addr = va; |
9 | 9 | ||
diff --git a/drivers/edac/Kconfig b/drivers/edac/Kconfig index 2d2530cdf99d..a90e06ac1631 100644 --- a/drivers/edac/Kconfig +++ b/drivers/edac/Kconfig | |||
@@ -2,15 +2,16 @@ | |||
2 | # EDAC Kconfig | 2 | # EDAC Kconfig |
3 | # Copyright (c) 2008 Doug Thompson www.softwarebitmaker.com | 3 | # Copyright (c) 2008 Doug Thompson www.softwarebitmaker.com |
4 | # Licensed and distributed under the GPL | 4 | # Licensed and distributed under the GPL |
5 | # | 5 | |
6 | config EDAC_ATOMIC_SCRUB | ||
7 | bool | ||
6 | 8 | ||
7 | config EDAC_SUPPORT | 9 | config EDAC_SUPPORT |
8 | bool | 10 | bool |
9 | 11 | ||
10 | menuconfig EDAC | 12 | menuconfig EDAC |
11 | bool "EDAC (Error Detection And Correction) reporting" | 13 | bool "EDAC (Error Detection And Correction) reporting" |
12 | depends on HAS_IOMEM | 14 | depends on HAS_IOMEM && EDAC_SUPPORT |
13 | depends on X86 || PPC || TILE || ARM || EDAC_SUPPORT | ||
14 | help | 15 | help |
15 | EDAC is designed to report errors in the core system. | 16 | EDAC is designed to report errors in the core system. |
16 | These are low-level errors that are reported in the CPU or | 17 | These are low-level errors that are reported in the CPU or |
diff --git a/drivers/edac/edac_mc.c b/drivers/edac/edac_mc.c index af3be1914dbb..943ed8cf71b9 100644 --- a/drivers/edac/edac_mc.c +++ b/drivers/edac/edac_mc.c | |||
@@ -30,11 +30,16 @@ | |||
30 | #include <linux/bitops.h> | 30 | #include <linux/bitops.h> |
31 | #include <asm/uaccess.h> | 31 | #include <asm/uaccess.h> |
32 | #include <asm/page.h> | 32 | #include <asm/page.h> |
33 | #include <asm/edac.h> | ||
34 | #include "edac_core.h" | 33 | #include "edac_core.h" |
35 | #include "edac_module.h" | 34 | #include "edac_module.h" |
36 | #include <ras/ras_event.h> | 35 | #include <ras/ras_event.h> |
37 | 36 | ||
37 | #ifdef CONFIG_EDAC_ATOMIC_SCRUB | ||
38 | #include <asm/edac.h> | ||
39 | #else | ||
40 | #define edac_atomic_scrub(va, size) do { } while (0) | ||
41 | #endif | ||
42 | |||
38 | /* lock to memory controller's control array */ | 43 | /* lock to memory controller's control array */ |
39 | static DEFINE_MUTEX(mem_ctls_mutex); | 44 | static DEFINE_MUTEX(mem_ctls_mutex); |
40 | static LIST_HEAD(mc_devices); | 45 | static LIST_HEAD(mc_devices); |
@@ -874,7 +879,7 @@ static void edac_mc_scrub_block(unsigned long page, unsigned long offset, | |||
874 | virt_addr = kmap_atomic(pg); | 879 | virt_addr = kmap_atomic(pg); |
875 | 880 | ||
876 | /* Perform architecture specific atomic scrub operation */ | 881 | /* Perform architecture specific atomic scrub operation */ |
877 | atomic_scrub(virt_addr + offset, size); | 882 | edac_atomic_scrub(virt_addr + offset, size); |
878 | 883 | ||
879 | /* Unmap and complete */ | 884 | /* Unmap and complete */ |
880 | kunmap_atomic(virt_addr); | 885 | kunmap_atomic(virt_addr); |