diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-03-28 17:24:40 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-03-28 17:24:40 -0400 |
commit | f0f3680e50352c57b6cfc5b0d44d63bb0aa20f80 (patch) | |
tree | 2005ec90f9d90f25ceeba147dfe09db8c8036fa6 /include/linux/edac.h | |
parent | 61e5191c9d96268746bd57ed55d035678a1a2cf9 (diff) | |
parent | a4b4be3fd7a76021f67380b03d8bccebf067db72 (diff) |
Merge branch 'linux_next' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-edac
Pull EDAC fixes from Mauro Carvalho Chehab:
"A series of EDAC driver fixes. It also has one core fix at the
documentation, and a rename patch, fixing the name of the struct that
contains the rank information."
* 'linux_next' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-edac:
edac: rename channel_info to rank_info
i5400_edac: Avoid calling pci_put_device() twice
edac: i5100 ack error detection register after each read
edac: i5100 fix erroneous define for M1Err
edac: sb_edac: Fix a wrong value setting for the previous value
edac: sb_edac: Fix a INTERLEAVE_MODE() misuse
edac: sb_edac: Let the driver depend on PCI_MMCONFIG
edac: Improve the comments to better describe the memory concepts
edac/ppc4xx_edac: Fix compilation
Fix sb_edac compilation with 32 bits kernels
Diffstat (limited to 'include/linux/edac.h')
-rw-r--r-- | include/linux/edac.h | 179 |
1 files changed, 128 insertions, 51 deletions
diff --git a/include/linux/edac.h b/include/linux/edac.h index ba317e2930a1..c621d762bb2c 100644 --- a/include/linux/edac.h +++ b/include/linux/edac.h | |||
@@ -70,25 +70,64 @@ enum dev_type { | |||
70 | #define DEV_FLAG_X32 BIT(DEV_X32) | 70 | #define DEV_FLAG_X32 BIT(DEV_X32) |
71 | #define DEV_FLAG_X64 BIT(DEV_X64) | 71 | #define DEV_FLAG_X64 BIT(DEV_X64) |
72 | 72 | ||
73 | /* memory types */ | 73 | /** |
74 | * enum mem_type - memory types. For a more detailed reference, please see | ||
75 | * http://en.wikipedia.org/wiki/DRAM | ||
76 | * | ||
77 | * @MEM_EMPTY Empty csrow | ||
78 | * @MEM_RESERVED: Reserved csrow type | ||
79 | * @MEM_UNKNOWN: Unknown csrow type | ||
80 | * @MEM_FPM: FPM - Fast Page Mode, used on systems up to 1995. | ||
81 | * @MEM_EDO: EDO - Extended data out, used on systems up to 1998. | ||
82 | * @MEM_BEDO: BEDO - Burst Extended data out, an EDO variant. | ||
83 | * @MEM_SDR: SDR - Single data rate SDRAM | ||
84 | * http://en.wikipedia.org/wiki/Synchronous_dynamic_random-access_memory | ||
85 | * They use 3 pins for chip select: Pins 0 and 2 are | ||
86 | * for rank 0; pins 1 and 3 are for rank 1, if the memory | ||
87 | * is dual-rank. | ||
88 | * @MEM_RDR: Registered SDR SDRAM | ||
89 | * @MEM_DDR: Double data rate SDRAM | ||
90 | * http://en.wikipedia.org/wiki/DDR_SDRAM | ||
91 | * @MEM_RDDR: Registered Double data rate SDRAM | ||
92 | * This is a variant of the DDR memories. | ||
93 | * A registered memory has a buffer inside it, hiding | ||
94 | * part of the memory details to the memory controller. | ||
95 | * @MEM_RMBS: Rambus DRAM, used on a few Pentium III/IV controllers. | ||
96 | * @MEM_DDR2: DDR2 RAM, as described at JEDEC JESD79-2F. | ||
97 | * Those memories are labed as "PC2-" instead of "PC" to | ||
98 | * differenciate from DDR. | ||
99 | * @MEM_FB_DDR2: Fully-Buffered DDR2, as described at JEDEC Std No. 205 | ||
100 | * and JESD206. | ||
101 | * Those memories are accessed per DIMM slot, and not by | ||
102 | * a chip select signal. | ||
103 | * @MEM_RDDR2: Registered DDR2 RAM | ||
104 | * This is a variant of the DDR2 memories. | ||
105 | * @MEM_XDR: Rambus XDR | ||
106 | * It is an evolution of the original RAMBUS memories, | ||
107 | * created to compete with DDR2. Weren't used on any | ||
108 | * x86 arch, but cell_edac PPC memory controller uses it. | ||
109 | * @MEM_DDR3: DDR3 RAM | ||
110 | * @MEM_RDDR3: Registered DDR3 RAM | ||
111 | * This is a variant of the DDR3 memories. | ||
112 | */ | ||
74 | enum mem_type { | 113 | enum mem_type { |
75 | MEM_EMPTY = 0, /* Empty csrow */ | 114 | MEM_EMPTY = 0, |
76 | MEM_RESERVED, /* Reserved csrow type */ | 115 | MEM_RESERVED, |
77 | MEM_UNKNOWN, /* Unknown csrow type */ | 116 | MEM_UNKNOWN, |
78 | MEM_FPM, /* Fast page mode */ | 117 | MEM_FPM, |
79 | MEM_EDO, /* Extended data out */ | 118 | MEM_EDO, |
80 | MEM_BEDO, /* Burst Extended data out */ | 119 | MEM_BEDO, |
81 | MEM_SDR, /* Single data rate SDRAM */ | 120 | MEM_SDR, |
82 | MEM_RDR, /* Registered single data rate SDRAM */ | 121 | MEM_RDR, |
83 | MEM_DDR, /* Double data rate SDRAM */ | 122 | MEM_DDR, |
84 | MEM_RDDR, /* Registered Double data rate SDRAM */ | 123 | MEM_RDDR, |
85 | MEM_RMBS, /* Rambus DRAM */ | 124 | MEM_RMBS, |
86 | MEM_DDR2, /* DDR2 RAM */ | 125 | MEM_DDR2, |
87 | MEM_FB_DDR2, /* fully buffered DDR2 */ | 126 | MEM_FB_DDR2, |
88 | MEM_RDDR2, /* Registered DDR2 RAM */ | 127 | MEM_RDDR2, |
89 | MEM_XDR, /* Rambus XDR */ | 128 | MEM_XDR, |
90 | MEM_DDR3, /* DDR3 RAM */ | 129 | MEM_DDR3, |
91 | MEM_RDDR3, /* Registered DDR3 RAM */ | 130 | MEM_RDDR3, |
92 | }; | 131 | }; |
93 | 132 | ||
94 | #define MEM_FLAG_EMPTY BIT(MEM_EMPTY) | 133 | #define MEM_FLAG_EMPTY BIT(MEM_EMPTY) |
@@ -166,8 +205,9 @@ enum scrub_type { | |||
166 | #define OP_OFFLINE 0x300 | 205 | #define OP_OFFLINE 0x300 |
167 | 206 | ||
168 | /* | 207 | /* |
169 | * There are several things to be aware of that aren't at all obvious: | 208 | * Concepts used at the EDAC subsystem |
170 | * | 209 | * |
210 | * There are several things to be aware of that aren't at all obvious: | ||
171 | * | 211 | * |
172 | * SOCKETS, SOCKET SETS, BANKS, ROWS, CHIP-SELECT ROWS, CHANNELS, etc.. | 212 | * SOCKETS, SOCKET SETS, BANKS, ROWS, CHIP-SELECT ROWS, CHANNELS, etc.. |
173 | * | 213 | * |
@@ -176,36 +216,61 @@ enum scrub_type { | |||
176 | * creating a common ground for discussion, terms and their definitions | 216 | * creating a common ground for discussion, terms and their definitions |
177 | * will be established. | 217 | * will be established. |
178 | * | 218 | * |
179 | * Memory devices: The individual chip on a memory stick. These devices | 219 | * Memory devices: The individual DRAM chips on a memory stick. These |
180 | * commonly output 4 and 8 bits each. Grouping several | 220 | * devices commonly output 4 and 8 bits each (x4, x8). |
181 | * of these in parallel provides 64 bits which is common | 221 | * Grouping several of these in parallel provides the |
182 | * for a memory stick. | 222 | * number of bits that the memory controller expects: |
223 | * typically 72 bits, in order to provide 64 bits + | ||
224 | * 8 bits of ECC data. | ||
183 | * | 225 | * |
184 | * Memory Stick: A printed circuit board that aggregates multiple | 226 | * Memory Stick: A printed circuit board that aggregates multiple |
185 | * memory devices in parallel. This is the atomic | 227 | * memory devices in parallel. In general, this is the |
186 | * memory component that is purchaseable by Joe consumer | 228 | * Field Replaceable Unit (FRU) which gets replaced, in |
187 | * and loaded into a memory socket. | 229 | * the case of excessive errors. Most often it is also |
230 | * called DIMM (Dual Inline Memory Module). | ||
231 | * | ||
232 | * Memory Socket: A physical connector on the motherboard that accepts | ||
233 | * a single memory stick. Also called as "slot" on several | ||
234 | * datasheets. | ||
188 | * | 235 | * |
189 | * Socket: A physical connector on the motherboard that accepts | 236 | * Channel: A memory controller channel, responsible to communicate |
190 | * a single memory stick. | 237 | * with a group of DIMMs. Each channel has its own |
238 | * independent control (command) and data bus, and can | ||
239 | * be used independently or grouped with other channels. | ||
191 | * | 240 | * |
192 | * Channel: Set of memory devices on a memory stick that must be | 241 | * Branch: It is typically the highest hierarchy on a |
193 | * grouped in parallel with one or more additional | 242 | * Fully-Buffered DIMM memory controller. |
194 | * channels from other memory sticks. This parallel | 243 | * Typically, it contains two channels. |
195 | * grouping of the output from multiple channels are | 244 | * Two channels at the same branch can be used in single |
196 | * necessary for the smallest granularity of memory access. | 245 | * mode or in lockstep mode. |
197 | * Some memory controllers are capable of single channel - | 246 | * When lockstep is enabled, the cacheline is doubled, |
198 | * which means that memory sticks can be loaded | 247 | * but it generally brings some performance penalty. |
199 | * individually. Other memory controllers are only | 248 | * Also, it is generally not possible to point to just one |
200 | * capable of dual channel - which means that memory | 249 | * memory stick when an error occurs, as the error |
201 | * sticks must be loaded as pairs (see "socket set"). | 250 | * correction code is calculated using two DIMMs instead |
251 | * of one. Due to that, it is capable of correcting more | ||
252 | * errors than on single mode. | ||
202 | * | 253 | * |
203 | * Chip-select row: All of the memory devices that are selected together. | 254 | * Single-channel: The data accessed by the memory controller is contained |
204 | * for a single, minimum grain of memory access. | 255 | * into one dimm only. E. g. if the data is 64 bits-wide, |
205 | * This selects all of the parallel memory devices across | 256 | * the data flows to the CPU using one 64 bits parallel |
206 | * all of the parallel channels. Common chip-select rows | 257 | * access. |
207 | * for single channel are 64 bits, for dual channel 128 | 258 | * Typically used with SDR, DDR, DDR2 and DDR3 memories. |
208 | * bits. | 259 | * FB-DIMM and RAMBUS use a different concept for channel, |
260 | * so this concept doesn't apply there. | ||
261 | * | ||
262 | * Double-channel: The data size accessed by the memory controller is | ||
263 | * interlaced into two dimms, accessed at the same time. | ||
264 | * E. g. if the DIMM is 64 bits-wide (72 bits with ECC), | ||
265 | * the data flows to the CPU using a 128 bits parallel | ||
266 | * access. | ||
267 | * | ||
268 | * Chip-select row: This is the name of the DRAM signal used to select the | ||
269 | * DRAM ranks to be accessed. Common chip-select rows for | ||
270 | * single channel are 64 bits, for dual channel 128 bits. | ||
271 | * It may not be visible by the memory controller, as some | ||
272 | * DIMM types have a memory buffer that can hide direct | ||
273 | * access to it from the Memory Controller. | ||
209 | * | 274 | * |
210 | * Single-Ranked stick: A Single-ranked stick has 1 chip-select row of memory. | 275 | * Single-Ranked stick: A Single-ranked stick has 1 chip-select row of memory. |
211 | * Motherboards commonly drive two chip-select pins to | 276 | * Motherboards commonly drive two chip-select pins to |
@@ -218,8 +283,8 @@ enum scrub_type { | |||
218 | * | 283 | * |
219 | * Double-sided stick: DEPRECATED TERM, see Double-Ranked stick. | 284 | * Double-sided stick: DEPRECATED TERM, see Double-Ranked stick. |
220 | * A double-sided stick has two chip-select rows which | 285 | * A double-sided stick has two chip-select rows which |
221 | * access different sets of memory devices. The two | 286 | * access different sets of memory devices. The two |
222 | * rows cannot be accessed concurrently. "Double-sided" | 287 | * rows cannot be accessed concurrently. "Double-sided" |
223 | * is irrespective of the memory devices being mounted | 288 | * is irrespective of the memory devices being mounted |
224 | * on both sides of the memory stick. | 289 | * on both sides of the memory stick. |
225 | * | 290 | * |
@@ -247,10 +312,22 @@ enum scrub_type { | |||
247 | * PS - I enjoyed writing all that about as much as you enjoyed reading it. | 312 | * PS - I enjoyed writing all that about as much as you enjoyed reading it. |
248 | */ | 313 | */ |
249 | 314 | ||
250 | struct channel_info { | 315 | /** |
251 | int chan_idx; /* channel index */ | 316 | * struct rank_info - contains the information for one DIMM rank |
252 | u32 ce_count; /* Correctable Errors for this CHANNEL */ | 317 | * |
253 | char label[EDAC_MC_LABEL_LEN + 1]; /* DIMM label on motherboard */ | 318 | * @chan_idx: channel number where the rank is (typically, 0 or 1) |
319 | * @ce_count: number of correctable errors for this rank | ||
320 | * @label: DIMM label. Different ranks for the same DIMM should be | ||
321 | * filled, on userspace, with the same label. | ||
322 | * FIXME: The core currently won't enforce it. | ||
323 | * @csrow: A pointer to the chip select row structure (the parent | ||
324 | * structure). The location of the rank is given by | ||
325 | * the (csrow->csrow_idx, chan_idx) vector. | ||
326 | */ | ||
327 | struct rank_info { | ||
328 | int chan_idx; | ||
329 | u32 ce_count; | ||
330 | char label[EDAC_MC_LABEL_LEN + 1]; | ||
254 | struct csrow_info *csrow; /* the parent */ | 331 | struct csrow_info *csrow; /* the parent */ |
255 | }; | 332 | }; |
256 | 333 | ||
@@ -274,7 +351,7 @@ struct csrow_info { | |||
274 | 351 | ||
275 | /* channel information for this csrow */ | 352 | /* channel information for this csrow */ |
276 | u32 nr_channels; | 353 | u32 nr_channels; |
277 | struct channel_info *channels; | 354 | struct rank_info *channels; |
278 | }; | 355 | }; |
279 | 356 | ||
280 | struct mcidev_sysfs_group { | 357 | struct mcidev_sysfs_group { |