blob: 316456ba2e0a94bbbc74b963327517f8c8c68ab9 [file] [log] [blame]
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -02001.. include:: <isonum.txt>
2
3=====================================
Alan Coxda9bb1d2006-01-18 17:44:13 -08004EDAC - Error Detection And Correction
Borislav Petkov043b4312015-06-19 11:47:17 +02005=====================================
Doug Thompson87f24c32007-07-19 01:50:34 -07006
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -02007.. note::
Borislav Petkove34217c2015-11-26 14:12:56 +01008
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -02009 "bluesmoke" was the name for this device driver when it
10 was "out-of-tree" and maintained at http://bluesmoke.sourceforge.net.
11 That site is mostly archaic now and can be used only for historical
12 purposes.
Doug Thompson87f24c32007-07-19 01:50:34 -070013
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -020014 When the subsystem was pushed into 2.6.16 for the first time, it was
15 renamed to ``EDAC``.
16
17Purpose
Borislav Petkov043b4312015-06-19 11:47:17 +020018-------
Doug Thompson87f24c32007-07-19 01:50:34 -070019
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -020020The ``edac`` kernel module's goal is to detect and report hardware errors
Borislav Petkov043b4312015-06-19 11:47:17 +020021that occur within the computer system running under linux.
Doug Thompson87f24c32007-07-19 01:50:34 -070022
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -020023Memory
Borislav Petkov043b4312015-06-19 11:47:17 +020024------
Doug Thompson87f24c32007-07-19 01:50:34 -070025
Borislav Petkov043b4312015-06-19 11:47:17 +020026Memory Correctable Errors (CE) and Uncorrectable Errors (UE) are the
27primary errors being harvested. These types of errors are harvested by
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -020028the ``edac_mc`` device.
Alan Coxda9bb1d2006-01-18 17:44:13 -080029
30Detecting CE events, then harvesting those events and reporting them,
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -020031**can** but must not necessarily be a predictor of future UE events. With
Borislav Petkov043b4312015-06-19 11:47:17 +020032CE events only, the system can and will continue to operate as no data
33has been damaged yet.
Alan Coxda9bb1d2006-01-18 17:44:13 -080034
Borislav Petkov043b4312015-06-19 11:47:17 +020035However, preventive maintenance and proactive part replacement of memory
36DIMMs exhibiting CEs can reduce the likelihood of the dreaded UE events
37and system panics.
38
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -020039Other hardware elements
Borislav Petkov043b4312015-06-19 11:47:17 +020040-----------------------
Doug Thompson87f24c32007-07-19 01:50:34 -070041
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -020042A new feature for EDAC, the ``edac_device`` class of device, was added in
Doug Thompson87f24c32007-07-19 01:50:34 -070043the 2.6.23 version of the kernel.
44
45This new device type allows for non-memory type of ECC hardware detectors
46to have their states harvested and presented to userspace via the sysfs
47interface.
48
Borislav Petkov043b4312015-06-19 11:47:17 +020049Some architectures have ECC detectors for L1, L2 and L3 caches,
50along with DMA engines, fabric switches, main data path switches,
51interconnections, and various other hardware data paths. If the hardware
52reports it, then a edac_device device probably can be constructed to
53harvest and present that to userspace.
Doug Thompson87f24c32007-07-19 01:50:34 -070054
55
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -020056PCI bus scanning
Borislav Petkov043b4312015-06-19 11:47:17 +020057----------------
Alan Coxda9bb1d2006-01-18 17:44:13 -080058
Borislav Petkov043b4312015-06-19 11:47:17 +020059In addition, PCI devices are scanned for PCI Bus Parity and SERR Errors
60in order to determine if errors are occurring during data transfers.
Doug Thompson87f24c32007-07-19 01:50:34 -070061
Alan Coxda9bb1d2006-01-18 17:44:13 -080062The presence of PCI Parity errors must be examined with a grain of salt.
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -020063There are several add-in adapters that do **not** follow the PCI specification
Alan Coxda9bb1d2006-01-18 17:44:13 -080064with regards to Parity generation and reporting. The specification says
65the vendor should tie the parity status bits to 0 if they do not intend
66to generate parity. Some vendors do not do this, and thus the parity bit
67can "float" giving false positives.
68
Borislav Petkov043b4312015-06-19 11:47:17 +020069There is a PCI device attribute located in sysfs that is checked by
70the EDAC PCI scanning code. If that attribute is set, PCI parity/error
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -020071scanning is skipped for that device. The attribute is::
Doug Thompson87f24c32007-07-19 01:50:34 -070072
73 broken_parity_status
74
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -020075and is located in ``/sys/devices/pci<XXX>/0000:XX:YY.Z`` directories for
Doug Thompson87f24c32007-07-19 01:50:34 -070076PCI devices.
77
Alan Coxda9bb1d2006-01-18 17:44:13 -080078
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -020079Versioning
Borislav Petkov043b4312015-06-19 11:47:17 +020080----------
Alan Coxda9bb1d2006-01-18 17:44:13 -080081
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -020082EDAC is composed of a "core" module (``edac_core.ko``) and several Memory
Borislav Petkov043b4312015-06-19 11:47:17 +020083Controller (MC) driver modules. On a given system, the CORE is loaded
84and one MC driver will be loaded. Both the CORE and the MC driver (or
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -020085``edac_device`` driver) have individual versions that reflect current
Borislav Petkov043b4312015-06-19 11:47:17 +020086release level of their respective modules.
Doug Thompson87f24c32007-07-19 01:50:34 -070087
Borislav Petkov043b4312015-06-19 11:47:17 +020088Thus, to "report" on what version a system is running, one must report
89both the CORE's and the MC driver's versions.
Alan Coxda9bb1d2006-01-18 17:44:13 -080090
91
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -020092Loading
Borislav Petkov043b4312015-06-19 11:47:17 +020093-------
Alan Coxda9bb1d2006-01-18 17:44:13 -080094
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -020095If ``edac`` was statically linked with the kernel then no loading
96is necessary. If ``edac`` was built as modules then simply modprobe
97the ``edac`` pieces that you need. You should be able to modprobe
Borislav Petkov043b4312015-06-19 11:47:17 +020098hardware-specific modules and have the dependencies load the necessary
99core modules.
Alan Coxda9bb1d2006-01-18 17:44:13 -0800100
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200101Example::
Alan Coxda9bb1d2006-01-18 17:44:13 -0800102
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200103 $ modprobe amd76x_edac
Alan Coxda9bb1d2006-01-18 17:44:13 -0800104
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200105loads both the ``amd76x_edac.ko`` memory controller module and the
106``edac_mc.ko`` core module.
Alan Coxda9bb1d2006-01-18 17:44:13 -0800107
108
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200109Sysfs interface
Borislav Petkov043b4312015-06-19 11:47:17 +0200110---------------
Alan Coxda9bb1d2006-01-18 17:44:13 -0800111
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200112EDAC presents a ``sysfs`` interface for control and reporting purposes. It
Borislav Petkov043b4312015-06-19 11:47:17 +0200113lives in the /sys/devices/system/edac directory.
Alan Coxda9bb1d2006-01-18 17:44:13 -0800114
Borislav Petkov043b4312015-06-19 11:47:17 +0200115Within this directory there currently reside 2 components:
Alan Coxda9bb1d2006-01-18 17:44:13 -0800116
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200117 ======= ==============================
Alan Coxda9bb1d2006-01-18 17:44:13 -0800118 mc memory controller(s) system
Doug Thompson49c0dab72006-07-10 04:45:19 -0700119 pci PCI control and status system
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200120 ======= ==============================
Alan Coxda9bb1d2006-01-18 17:44:13 -0800121
122
Borislav Petkov043b4312015-06-19 11:47:17 +0200123
Alan Coxda9bb1d2006-01-18 17:44:13 -0800124Memory Controller (mc) Model
Borislav Petkov043b4312015-06-19 11:47:17 +0200125----------------------------
Alan Coxda9bb1d2006-01-18 17:44:13 -0800126
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200127Each ``mc`` device controls a set of DIMM memory modules. These modules
128are laid out in a Chip-Select Row (``csrowX``) and Channel table (``chX``).
Borislav Petkov043b4312015-06-19 11:47:17 +0200129There can be multiple csrows and multiple channels.
Alan Coxda9bb1d2006-01-18 17:44:13 -0800130
Borislav Petkov043b4312015-06-19 11:47:17 +0200131Memory controllers allow for several csrows, with 8 csrows being a
132typical value. Yet, the actual number of csrows depends on the layout of
133a given motherboard, memory controller and DIMM characteristics.
Alan Coxda9bb1d2006-01-18 17:44:13 -0800134
Borislav Petkov043b4312015-06-19 11:47:17 +0200135Dual channels allows for 128 bit data transfers to/from the CPU from/to
136memory. Some newer chipsets allow for more than 2 channels, like Fully
137Buffered DIMMs (FB-DIMMs). The following example will assume 2 channels:
Alan Coxda9bb1d2006-01-18 17:44:13 -0800138
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200139 +--------+-----------+-----------+
140 | | Channel 0 | Channel 1 |
141 +========+===========+===========+
142 | csrow0 | DIMM_A0 | DIMM_B0 |
143 +--------+ | |
144 | csrow1 | | |
145 +--------+-----------+-----------+
146 | csrow2 | DIMM_A1 | DIMM_B1 |
147 +--------+ | |
148 | csrow3 | | |
149 +--------+-----------+-----------+
Alan Coxda9bb1d2006-01-18 17:44:13 -0800150
151In the above example table there are 4 physical slots on the motherboard
152for memory DIMMs:
153
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200154 - DIMM_A0
155 - DIMM_B0
156 - DIMM_A1
157 - DIMM_B1
Alan Coxda9bb1d2006-01-18 17:44:13 -0800158
Borislav Petkov043b4312015-06-19 11:47:17 +0200159Labels for these slots are usually silk-screened on the motherboard.
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200160Slots labeled ``A`` are channel 0 in this example. Slots labeled ``B`` are
Borislav Petkov043b4312015-06-19 11:47:17 +0200161channel 1. Notice that there are two csrows possible on a physical DIMM.
162These csrows are allocated their csrow assignment based on the slot into
163which the memory DIMM is placed. Thus, when 1 DIMM is placed in each
164Channel, the csrows cross both DIMMs.
Alan Coxda9bb1d2006-01-18 17:44:13 -0800165
166Memory DIMMs come single or dual "ranked". A rank is a populated csrow.
167Thus, 2 single ranked DIMMs, placed in slots DIMM_A0 and DIMM_B0 above
168will have 1 csrow, csrow0. csrow1 will be empty. On the other hand,
Dave Petersonf3479812006-03-26 01:38:53 -0800169when 2 dual ranked DIMMs are similarly placed, then both csrow0 and
Alan Coxda9bb1d2006-01-18 17:44:13 -0800170csrow1 will be populated. The pattern repeats itself for csrow2 and
171csrow3.
172
Borislav Petkov043b4312015-06-19 11:47:17 +0200173The representation of the above is reflected in the directory
174tree in EDAC's sysfs interface. Starting in directory
Alan Coxda9bb1d2006-01-18 17:44:13 -0800175/sys/devices/system/edac/mc each memory controller will be represented
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200176by its own ``mcX`` directory, where ``X`` is the index of the MC::
Alan Coxda9bb1d2006-01-18 17:44:13 -0800177
178 ..../edac/mc/
179 |
180 |->mc0
181 |->mc1
182 |->mc2
183 ....
184
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200185Under each ``mcX`` directory each ``csrowX`` is again represented by a
186``csrowX``, where ``X`` is the csrow index::
Alan Coxda9bb1d2006-01-18 17:44:13 -0800187
188 .../mc/mc0/
189 |
190 |->csrow0
191 |->csrow2
192 |->csrow3
193 ....
194
Borislav Petkov043b4312015-06-19 11:47:17 +0200195Notice that there is no csrow1, which indicates that csrow0 is composed
196of a single ranked DIMMs. This should also apply in both Channels, in
197order to have dual-channel mode be operational. Since both csrow2 and
198csrow3 are populated, this indicates a dual ranked set of DIMMs for
199channels 0 and 1.
Alan Coxda9bb1d2006-01-18 17:44:13 -0800200
201
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200202Within each of the ``mcX`` and ``csrowX`` directories are several EDAC
Borislav Petkov043b4312015-06-19 11:47:17 +0200203control and attribute files.
Alan Coxda9bb1d2006-01-18 17:44:13 -0800204
Alan Coxda9bb1d2006-01-18 17:44:13 -0800205
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200206``mcX`` directories
207-------------------
Alan Coxda9bb1d2006-01-18 17:44:13 -0800208
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200209In ``mcX`` directories are EDAC control and attribute files for
210this ``X`` instance of the memory controllers.
Alan Coxda9bb1d2006-01-18 17:44:13 -0800211
Mauro Carvalho Chehab8b6f04c2012-04-17 08:53:34 -0300212For a description of the sysfs API, please see:
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200213
Rami Rosen3aae9ed2015-06-19 09:18:34 +0300214 Documentation/ABI/testing/sysfs-devices-edac
Alan Coxda9bb1d2006-01-18 17:44:13 -0800215
216
Mauro Carvalho Chehab032d0ab2016-10-27 10:00:46 -0200217``dimmX`` or ``rankX`` directories
218----------------------------------
219
220The recommended way to use the EDAC subsystem is to look at the information
221provided by the ``dimmX`` or ``rankX`` directories [#f5]_.
222
223A typical EDAC system has the following structure under
224``/sys/devices/system/edac/``\ [#f6]_::
225
226 /sys/devices/system/edac/
227 ├── mc
228 │   ├── mc0
229 │   │   ├── ce_count
230 │   │   ├── ce_noinfo_count
231 │   │   ├── dimm0
232 │   │   │   ├── dimm_dev_type
233 │   │   │   ├── dimm_edac_mode
234 │   │   │   ├── dimm_label
235 │   │   │   ├── dimm_location
236 │   │   │   ├── dimm_mem_type
237 │   │   │   ├── size
238 │   │   │   └── uevent
239 │   │   ├── max_location
240 │   │   ├── mc_name
241 │   │   ├── reset_counters
242 │   │   ├── seconds_since_reset
243 │   │   ├── size_mb
244 │   │   ├── ue_count
245 │   │   ├── ue_noinfo_count
246 │   │   └── uevent
247 │   ├── mc1
248 │   │   ├── ce_count
249 │   │   ├── ce_noinfo_count
250 │   │   ├── dimm0
251 │   │   │   ├── dimm_dev_type
252 │   │   │   ├── dimm_edac_mode
253 │   │   │   ├── dimm_label
254 │   │   │   ├── dimm_location
255 │   │   │   ├── dimm_mem_type
256 │   │   │   ├── size
257 │   │   │   └── uevent
258 │   │   ├── max_location
259 │   │   ├── mc_name
260 │   │   ├── reset_counters
261 │   │   ├── seconds_since_reset
262 │   │   ├── size_mb
263 │   │   ├── ue_count
264 │   │   ├── ue_noinfo_count
265 │   │   └── uevent
266 │   └── uevent
267 └── uevent
268
269In the ``dimmX`` directories are EDAC control and attribute files for
270this ``X`` memory module:
271
272- ``size`` - Total memory managed by this csrow attribute file
273
274 This attribute file displays, in count of megabytes, the memory
275 that this csrow contains.
276
277- ``dimm_dev_type`` - Device type attribute file
278
279 This attribute file will display what type of DRAM device is
280 being utilized on this DIMM.
281 Examples:
282
283 - x1
284 - x2
285 - x4
286 - x8
287
288- ``dimm_edac_mode`` - EDAC Mode of operation attribute file
289
290 This attribute file will display what type of Error detection
291 and correction is being utilized.
292
293- ``dimm_label`` - memory module label control file
294
295 This control file allows this DIMM to have a label assigned
296 to it. With this label in the module, when errors occur
297 the output can provide the DIMM label in the system log.
298 This becomes vital for panic events to isolate the
299 cause of the UE event.
300
301 DIMM Labels must be assigned after booting, with information
302 that correctly identifies the physical slot with its
303 silk screen label. This information is currently very
304 motherboard specific and determination of this information
305 must occur in userland at this time.
306
307- ``dimm_location`` - location of the memory module
308
309 The location can have up to 3 levels, and describe how the
310 memory controller identifies the location of a memory module.
311 Depending on the type of memory and memory controller, it
312 can be:
313
314 - *csrow* and *channel* - used when the memory controller
315 doesn't identify a single DIMM - e. g. in ``rankX`` dir;
316 - *branch*, *channel*, *slot* - typically used on FB-DIMM memory
317 controllers;
318 - *channel*, *slot* - used on Nehalem and newer Intel drivers.
319
320- ``dimm_mem_type`` - Memory Type attribute file
321
322 This attribute file will display what type of memory is currently
323 on this csrow. Normally, either buffered or unbuffered memory.
324 Examples:
325
326 - Registered-DDR
327 - Unbuffered-DDR
328
329.. [#f5] On some systems, the memory controller doesn't have any logic
330 to identify the memory module. On such systems, the directory is called ``rankX`` and works on a similar way as the ``csrowX`` directories.
331 On modern Intel memory controllers, the memory controller identifies the
332 memory modules directly. On such systems, the directory is called ``dimmX``.
333
334.. [#f6] There are also some ``power`` directories and ``subsystem``
335 symlinks inside the sysfs mapping that are automatically created by
336 the sysfs subsystem. Currently, they serve no purpose.
Alan Coxda9bb1d2006-01-18 17:44:13 -0800337
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200338``csrowX`` directories
339----------------------
Borislav Petkov043b4312015-06-19 11:47:17 +0200340
341When CONFIG_EDAC_LEGACY_SYSFS is enabled, sysfs will contain the csrowX
342directories. As this API doesn't work properly for Rambus, FB-DIMMs and
343modern Intel Memory Controllers, this is being deprecated in favor of
344dimmX directories.
Mauro Carvalho Chehab8b6f04c2012-04-17 08:53:34 -0300345
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200346In the ``csrowX`` directories are EDAC control and attribute files for
347this ``X`` instance of csrow:
Alan Coxda9bb1d2006-01-18 17:44:13 -0800348
349
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200350- ``ue_count`` - Total Uncorrectable Errors count attribute file
Alan Coxda9bb1d2006-01-18 17:44:13 -0800351
352 This attribute file displays the total count of uncorrectable
353 errors that have occurred on this csrow. If panic_on_ue is set
354 this counter will not have a chance to increment, since EDAC
355 will panic the system.
356
357
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200358- ``ce_count`` - Total Correctable Errors count attribute file
Alan Coxda9bb1d2006-01-18 17:44:13 -0800359
360 This attribute file displays the total count of correctable
Borislav Petkov043b4312015-06-19 11:47:17 +0200361 errors that have occurred on this csrow. This count is very
362 important to examine. CEs provide early indications that a
363 DIMM is beginning to fail. This count field should be
364 monitored for non-zero values and report such information
365 to the system administrator.
Alan Coxda9bb1d2006-01-18 17:44:13 -0800366
367
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200368- ``size_mb`` - Total memory managed by this csrow attribute file
Alan Coxda9bb1d2006-01-18 17:44:13 -0800369
Rami Rosen3aae9ed2015-06-19 09:18:34 +0300370 This attribute file displays, in count of megabytes, the memory
Dave Petersonf3479812006-03-26 01:38:53 -0800371 that this csrow contains.
Alan Coxda9bb1d2006-01-18 17:44:13 -0800372
373
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200374- ``mem_type`` - Memory Type attribute file
Alan Coxda9bb1d2006-01-18 17:44:13 -0800375
376 This attribute file will display what type of memory is currently
377 on this csrow. Normally, either buffered or unbuffered memory.
Doug Thompson49c0dab72006-07-10 04:45:19 -0700378 Examples:
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200379
380 - Registered-DDR
381 - Unbuffered-DDR
Alan Coxda9bb1d2006-01-18 17:44:13 -0800382
383
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200384- ``edac_mode`` - EDAC Mode of operation attribute file
Alan Coxda9bb1d2006-01-18 17:44:13 -0800385
386 This attribute file will display what type of Error detection
387 and correction is being utilized.
388
389
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200390- ``dev_type`` - Device type attribute file
Alan Coxda9bb1d2006-01-18 17:44:13 -0800391
Doug Thompson49c0dab72006-07-10 04:45:19 -0700392 This attribute file will display what type of DRAM device is
393 being utilized on this DIMM.
394 Examples:
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200395
396 - x1
397 - x2
398 - x4
399 - x8
Alan Coxda9bb1d2006-01-18 17:44:13 -0800400
401
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200402- ``ch0_ce_count`` - Channel 0 CE Count attribute file
Alan Coxda9bb1d2006-01-18 17:44:13 -0800403
404 This attribute file will display the count of CEs on this
405 DIMM located in channel 0.
406
407
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200408- ``ch0_ue_count`` - Channel 0 UE Count attribute file
Alan Coxda9bb1d2006-01-18 17:44:13 -0800409
410 This attribute file will display the count of UEs on this
411 DIMM located in channel 0.
412
413
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200414- ``ch0_dimm_label`` - Channel 0 DIMM Label control file
Alan Coxda9bb1d2006-01-18 17:44:13 -0800415
Alan Coxda9bb1d2006-01-18 17:44:13 -0800416
417 This control file allows this DIMM to have a label assigned
418 to it. With this label in the module, when errors occur
419 the output can provide the DIMM label in the system log.
420 This becomes vital for panic events to isolate the
421 cause of the UE event.
422
423 DIMM Labels must be assigned after booting, with information
424 that correctly identifies the physical slot with its
425 silk screen label. This information is currently very
426 motherboard specific and determination of this information
427 must occur in userland at this time.
428
429
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200430- ``ch1_ce_count`` - Channel 1 CE Count attribute file
Alan Coxda9bb1d2006-01-18 17:44:13 -0800431
Alan Coxda9bb1d2006-01-18 17:44:13 -0800432
433 This attribute file will display the count of CEs on this
434 DIMM located in channel 1.
435
436
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200437- ``ch1_ue_count`` - Channel 1 UE Count attribute file
Alan Coxda9bb1d2006-01-18 17:44:13 -0800438
Alan Coxda9bb1d2006-01-18 17:44:13 -0800439
440 This attribute file will display the count of UEs on this
441 DIMM located in channel 0.
442
443
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200444- ``ch1_dimm_label`` - Channel 1 DIMM Label control file
Alan Coxda9bb1d2006-01-18 17:44:13 -0800445
446 This control file allows this DIMM to have a label assigned
447 to it. With this label in the module, when errors occur
448 the output can provide the DIMM label in the system log.
449 This becomes vital for panic events to isolate the
450 cause of the UE event.
451
452 DIMM Labels must be assigned after booting, with information
453 that correctly identifies the physical slot with its
454 silk screen label. This information is currently very
455 motherboard specific and determination of this information
456 must occur in userland at this time.
457
Alan Coxda9bb1d2006-01-18 17:44:13 -0800458
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200459System Logging
Borislav Petkov043b4312015-06-19 11:47:17 +0200460--------------
461
462If logging for UEs and CEs is enabled, then system logs will contain
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200463information indicating that errors have been detected::
Alan Coxda9bb1d2006-01-18 17:44:13 -0800464
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200465 EDAC MC0: CE page 0x283, offset 0xce0, grain 8, syndrome 0x6ec3, row 0, channel 1 "DIMM_B1": amd76x_edac
466 EDAC MC0: CE page 0x1e5, offset 0xfb0, grain 8, syndrome 0xb741, row 0, channel 1 "DIMM_B1": amd76x_edac
Alan Coxda9bb1d2006-01-18 17:44:13 -0800467
468
469The structure of the message is:
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200470
471 +---------------------------------------+-------------+
472 | Content + Example |
473 +=======================================+=============+
474 | The memory controller | MC0 |
475 +---------------------------------------+-------------+
476 | Error type | CE |
477 +---------------------------------------+-------------+
478 | Memory page | 0x283 |
479 +---------------------------------------+-------------+
480 | Offset in the page | 0xce0 |
481 +---------------------------------------+-------------+
482 | The byte granularity | grain 8 |
483 | or resolution of the error | |
484 +---------------------------------------+-------------+
485 | The error syndrome | 0xb741 |
486 +---------------------------------------+-------------+
487 | Memory row | row 0 +
488 +---------------------------------------+-------------+
489 | Memory channel | channel 1 |
490 +---------------------------------------+-------------+
491 | DIMM label, if set prior | DIMM B1 |
492 +---------------------------------------+-------------+
493 | And then an optional, driver-specific | |
494 | message that may have additional | |
495 | information. | |
496 +---------------------------------------+-------------+
Alan Coxda9bb1d2006-01-18 17:44:13 -0800497
Borislav Petkov043b4312015-06-19 11:47:17 +0200498Both UEs and CEs with no info will lack all but memory controller, error
499type, a notice of "no info" and then an optional, driver-specific error
500message.
Alan Coxda9bb1d2006-01-18 17:44:13 -0800501
502
Alan Coxda9bb1d2006-01-18 17:44:13 -0800503PCI Bus Parity Detection
Borislav Petkov043b4312015-06-19 11:47:17 +0200504------------------------
Alan Coxda9bb1d2006-01-18 17:44:13 -0800505
Borislav Petkov043b4312015-06-19 11:47:17 +0200506On Header Type 00 devices, the primary status is looked at for any
507parity error regardless of whether parity is enabled on the device or
508not. (The spec indicates parity is generated in some cases). On Header
509Type 01 bridges, the secondary status register is also looked at to see
510if parity occurred on the bus on the other side of the bridge.
Alan Coxda9bb1d2006-01-18 17:44:13 -0800511
512
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200513Sysfs configuration
Borislav Petkov043b4312015-06-19 11:47:17 +0200514-------------------
Alan Coxda9bb1d2006-01-18 17:44:13 -0800515
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200516Under ``/sys/devices/system/edac/pci`` are control and attribute files as
517follows:
Alan Coxda9bb1d2006-01-18 17:44:13 -0800518
519
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200520- ``check_pci_parity`` - Enable/Disable PCI Parity checking control file
Alan Coxda9bb1d2006-01-18 17:44:13 -0800521
522 This control file enables or disables the PCI Bus Parity scanning
523 operation. Writing a 1 to this file enables the scanning. Writing
524 a 0 to this file disables the scanning.
525
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200526 Enable::
Alan Coxda9bb1d2006-01-18 17:44:13 -0800527
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200528 echo "1" >/sys/devices/system/edac/pci/check_pci_parity
529
530 Disable::
531
532 echo "0" >/sys/devices/system/edac/pci/check_pci_parity
Alan Coxda9bb1d2006-01-18 17:44:13 -0800533
534
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200535- ``pci_parity_count`` - Parity Count
Arthur Jones327dafb2008-07-25 01:49:10 -0700536
537 This attribute file will display the number of parity errors that
538 have been detected.
539
540
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200541Module parameters
Borislav Petkov043b4312015-06-19 11:47:17 +0200542-----------------
Arthur Jones327dafb2008-07-25 01:49:10 -0700543
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200544- ``edac_mc_panic_on_ue`` - Panic on UE control file
Arthur Jones327dafb2008-07-25 01:49:10 -0700545
546 An uncorrectable error will cause a machine panic. This is usually
547 desirable. It is a bad idea to continue when an uncorrectable error
548 occurs - it is indeterminate what was uncorrected and the operating
549 system context might be so mangled that continuing will lead to further
550 corruption. If the kernel has MCE configured, then EDAC will never
551 notice the UE.
552
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200553 LOAD TIME::
Arthur Jones327dafb2008-07-25 01:49:10 -0700554
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200555 module/kernel parameter: edac_mc_panic_on_ue=[0|1]
556
557 RUN TIME::
558
559 echo "1" > /sys/module/edac_core/parameters/edac_mc_panic_on_ue
Arthur Jones327dafb2008-07-25 01:49:10 -0700560
561
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200562- ``edac_mc_log_ue`` - Log UE control file
Arthur Jones327dafb2008-07-25 01:49:10 -0700563
Arthur Jones327dafb2008-07-25 01:49:10 -0700564
565 Generate kernel messages describing uncorrectable errors. These errors
566 are reported through the system message log system. UE statistics
567 will be accumulated even when UE logging is disabled.
568
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200569 LOAD TIME::
Arthur Jones327dafb2008-07-25 01:49:10 -0700570
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200571 module/kernel parameter: edac_mc_log_ue=[0|1]
572
573 RUN TIME::
574
575 echo "1" > /sys/module/edac_core/parameters/edac_mc_log_ue
Arthur Jones327dafb2008-07-25 01:49:10 -0700576
577
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200578- ``edac_mc_log_ce`` - Log CE control file
Arthur Jones327dafb2008-07-25 01:49:10 -0700579
Arthur Jones327dafb2008-07-25 01:49:10 -0700580
581 Generate kernel messages describing correctable errors. These
582 errors are reported through the system message log system.
583 CE statistics will be accumulated even when CE logging is disabled.
584
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200585 LOAD TIME::
Arthur Jones327dafb2008-07-25 01:49:10 -0700586
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200587 module/kernel parameter: edac_mc_log_ce=[0|1]
588
589 RUN TIME::
590
591 echo "1" > /sys/module/edac_core/parameters/edac_mc_log_ce
Arthur Jones327dafb2008-07-25 01:49:10 -0700592
593
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200594- ``edac_mc_poll_msec`` - Polling period control file
Arthur Jones327dafb2008-07-25 01:49:10 -0700595
Arthur Jones327dafb2008-07-25 01:49:10 -0700596
597 The time period, in milliseconds, for polling for error information.
598 Too small a value wastes resources. Too large a value might delay
599 necessary handling of errors and might loose valuable information for
600 locating the error. 1000 milliseconds (once each second) is the current
601 default. Systems which require all the bandwidth they can get, may
602 increase this.
603
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200604 LOAD TIME::
Arthur Jones327dafb2008-07-25 01:49:10 -0700605
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200606 module/kernel parameter: edac_mc_poll_msec=[0|1]
607
608 RUN TIME::
609
610 echo "1000" > /sys/module/edac_core/parameters/edac_mc_poll_msec
Arthur Jones327dafb2008-07-25 01:49:10 -0700611
Alan Coxda9bb1d2006-01-18 17:44:13 -0800612
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200613- ``panic_on_pci_parity`` - Panic on PCI PARITY Error
Alan Coxda9bb1d2006-01-18 17:44:13 -0800614
615
Rami Rosen3aae9ed2015-06-19 09:18:34 +0300616 This control file enables or disables panicking when a parity
Alan Coxda9bb1d2006-01-18 17:44:13 -0800617 error has been detected.
618
619
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200620 module/kernel parameter::
Alan Coxda9bb1d2006-01-18 17:44:13 -0800621
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200622 edac_panic_on_pci_pe=[0|1]
Alan Coxda9bb1d2006-01-18 17:44:13 -0800623
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200624 Enable::
625
626 echo "1" > /sys/module/edac_core/parameters/edac_panic_on_pci_pe
627
628 Disable::
629
630 echo "0" > /sys/module/edac_core/parameters/edac_panic_on_pci_pe
Alan Coxda9bb1d2006-01-18 17:44:13 -0800631
632
633
Borislav Petkov043b4312015-06-19 11:47:17 +0200634EDAC device type
635----------------
Doug Thompson87f24c32007-07-19 01:50:34 -0700636
637In the header file, edac_core.h, there is a series of edac_device structures
638and APIs for the EDAC_DEVICE.
639
640User space access to an edac_device is through the sysfs interface.
641
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200642At the location ``/sys/devices/system/edac`` (sysfs) new edac_device devices
643will appear.
Doug Thompson87f24c32007-07-19 01:50:34 -0700644
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200645There is a three level tree beneath the above ``edac`` directory. For example,
646the ``test_device_edac`` device (found at the http://bluesmoke.sourceforget.net
647website) installs itself as::
Doug Thompson87f24c32007-07-19 01:50:34 -0700648
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200649 /sys/devices/system/edac/test-instance
Doug Thompson87f24c32007-07-19 01:50:34 -0700650
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200651in this directory are various controls, a symlink and one or more ``instance``
Carlos Garciac98be0c2014-04-04 22:31:00 -0400652directories.
Doug Thompson87f24c32007-07-19 01:50:34 -0700653
654The standard default controls are:
655
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200656 ============== =======================================================
Doug Thompson87f24c32007-07-19 01:50:34 -0700657 log_ce boolean to log CE events
658 log_ue boolean to log UE events
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200659 panic_on_ue boolean to ``panic`` the system if an UE is encountered
Doug Thompson87f24c32007-07-19 01:50:34 -0700660 (default off, can be set true via startup script)
661 poll_msec time period between POLL cycles for events
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200662 ============== =======================================================
Doug Thompson87f24c32007-07-19 01:50:34 -0700663
664The test_device_edac device adds at least one of its own custom control:
665
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200666 ============== ==================================================
Doug Thompson87f24c32007-07-19 01:50:34 -0700667 test_bits which in the current test driver does nothing but
668 show how it is installed. A ported driver can
669 add one or more such controls and/or attributes
670 for specific uses.
671 One out-of-tree driver uses controls here to allow
672 for ERROR INJECTION operations to hardware
673 injection registers
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200674 ============== ==================================================
Doug Thompson87f24c32007-07-19 01:50:34 -0700675
676The symlink points to the 'struct dev' that is registered for this edac_device.
677
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200678Instances
Borislav Petkov043b4312015-06-19 11:47:17 +0200679---------
Doug Thompson87f24c32007-07-19 01:50:34 -0700680
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200681One or more instance directories are present. For the ``test_device_edac``
682case:
Doug Thompson87f24c32007-07-19 01:50:34 -0700683
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200684 +----------------+
685 | test-instance0 |
686 +----------------+
Doug Thompson87f24c32007-07-19 01:50:34 -0700687
688
689In this directory there are two default counter attributes, which are totals of
690counter in deeper subdirectories.
691
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200692 ============== ====================================
Doug Thompson87f24c32007-07-19 01:50:34 -0700693 ce_count total of CE events of subdirectories
694 ue_count total of UE events of subdirectories
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200695 ============== ====================================
Doug Thompson87f24c32007-07-19 01:50:34 -0700696
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200697Blocks
Borislav Petkov043b4312015-06-19 11:47:17 +0200698------
Doug Thompson87f24c32007-07-19 01:50:34 -0700699
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200700At the lowest directory level is the ``block`` directory. There can be 0, 1
701or more blocks specified in each instance:
Doug Thompson87f24c32007-07-19 01:50:34 -0700702
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200703 +-------------+
704 | test-block0 |
705 +-------------+
Doug Thompson87f24c32007-07-19 01:50:34 -0700706
707In this directory the default attributes are:
708
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200709 ============== ================================================
710 ce_count which is counter of CE events for this ``block``
Doug Thompson87f24c32007-07-19 01:50:34 -0700711 of hardware being monitored
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200712 ue_count which is counter of UE events for this ``block``
Doug Thompson87f24c32007-07-19 01:50:34 -0700713 of hardware being monitored
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200714 ============== ================================================
Doug Thompson87f24c32007-07-19 01:50:34 -0700715
716
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200717The ``test_device_edac`` device adds 4 attributes and 1 control:
Doug Thompson87f24c32007-07-19 01:50:34 -0700718
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200719 ================== ====================================================
Doug Thompson87f24c32007-07-19 01:50:34 -0700720 test-block-bits-0 for every POLL cycle this counter
721 is incremented
722 test-block-bits-1 every 10 cycles, this counter is bumped once,
723 and test-block-bits-0 is set to 0
724 test-block-bits-2 every 100 cycles, this counter is bumped once,
725 and test-block-bits-1 is set to 0
726 test-block-bits-3 every 1000 cycles, this counter is bumped once,
727 and test-block-bits-2 is set to 0
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200728 ================== ====================================================
Doug Thompson87f24c32007-07-19 01:50:34 -0700729
730
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200731 ================== ====================================================
Doug Thompson87f24c32007-07-19 01:50:34 -0700732 reset-counters writing ANY thing to this control will
733 reset all the above counters.
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200734 ================== ====================================================
Doug Thompson87f24c32007-07-19 01:50:34 -0700735
736
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200737Use of the ``test_device_edac`` driver should enable any others to create their own
Doug Thompson87f24c32007-07-19 01:50:34 -0700738unique drivers for their hardware systems.
739
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200740The ``test_device_edac`` sample driver is located at the
741http://bluesmoke.sourceforge.net project site for EDAC.
Doug Thompson87f24c32007-07-19 01:50:34 -0700742
Borislav Petkov043b4312015-06-19 11:47:17 +0200743
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200744Nehalem Usage of EDAC APIs
Borislav Petkov043b4312015-06-19 11:47:17 +0200745--------------------------
Mauro Carvalho Chehab31983a02009-08-05 21:16:56 -0300746
747This chapter documents some EXPERIMENTAL mappings for EDAC API to handle
748Nehalem EDAC driver. They will likely be changed on future versions
749of the driver.
750
751Due to the way Nehalem exports Memory Controller data, some adjustments
752were done at i7core_edac driver. This chapter will cover those differences
753
Rami Rosen3aae9ed2015-06-19 09:18:34 +03007541) On Nehalem, there is one Memory Controller per Quick Patch Interconnect
Mauro Carvalho Chehabc3444362009-09-05 05:10:15 -0300755 (QPI). At the driver, the term "socket" means one QPI. This is
756 associated with a physical CPU socket.
Mauro Carvalho Chehab31983a02009-08-05 21:16:56 -0300757
758 Each MC have 3 physical read channels, 3 physical write channels and
Masanari Iidac94bed8e2012-04-10 00:22:13 +0900759 3 logic channels. The driver currently sees it as just 3 channels.
Mauro Carvalho Chehab31983a02009-08-05 21:16:56 -0300760 Each channel can have up to 3 DIMMs.
761
762 The minimum known unity is DIMMs. There are no information about csrows.
Rami Rosen3aae9ed2015-06-19 09:18:34 +0300763 As EDAC API maps the minimum unity is csrows, the driver sequentially
Mauro Carvalho Chehabc3444362009-09-05 05:10:15 -0300764 maps channel/dimm into different csrows.
765
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200766 For example, supposing the following layout::
767
Mauro Carvalho Chehabc3444362009-09-05 05:10:15 -0300768 Ch0 phy rd0, wr0 (0x063f4031): 2 ranks, UDIMMs
769 dimm 0 1024 Mb offset: 0, bank: 8, rank: 1, row: 0x4000, col: 0x400
770 dimm 1 1024 Mb offset: 4, bank: 8, rank: 1, row: 0x4000, col: 0x400
771 Ch1 phy rd1, wr1 (0x063f4031): 2 ranks, UDIMMs
772 dimm 0 1024 Mb offset: 0, bank: 8, rank: 1, row: 0x4000, col: 0x400
773 Ch2 phy rd3, wr3 (0x063f4031): 2 ranks, UDIMMs
774 dimm 0 1024 Mb offset: 0, bank: 8, rank: 1, row: 0x4000, col: 0x400
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200775
776 The driver will map it as::
777
Mauro Carvalho Chehabc3444362009-09-05 05:10:15 -0300778 csrow0: channel 0, dimm0
779 csrow1: channel 0, dimm1
780 csrow2: channel 1, dimm0
781 csrow3: channel 2, dimm0
782
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200783 exports one DIMM per csrow.
Mauro Carvalho Chehab31983a02009-08-05 21:16:56 -0300784
Mauro Carvalho Chehabc3444362009-09-05 05:10:15 -0300785 Each QPI is exported as a different memory controller.
Mauro Carvalho Chehab31983a02009-08-05 21:16:56 -0300786
Rami Rosen3aae9ed2015-06-19 09:18:34 +03007872) Nehalem MC has the ability to generate errors. The driver implements this
Mauro Carvalho Chehab31983a02009-08-05 21:16:56 -0300788 functionality via some error injection nodes:
789
790 For injecting a memory error, there are some sysfs nodes, under
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200791 ``/sys/devices/system/edac/mc/mc?/``:
Mauro Carvalho Chehab31983a02009-08-05 21:16:56 -0300792
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200793 - ``inject_addrmatch/*``:
Mauro Carvalho Chehab31983a02009-08-05 21:16:56 -0300794 Controls the error injection mask register. It is possible to specify
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200795 several characteristics of the address to match an error code::
796
Mauro Carvalho Chehab31983a02009-08-05 21:16:56 -0300797 dimm = the affected dimm. Numbers are relative to a channel;
798 rank = the memory rank;
799 channel = the channel that will generate an error;
800 bank = the affected bank;
801 page = the page address;
802 column (or col) = the address column.
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200803
Mauro Carvalho Chehab31983a02009-08-05 21:16:56 -0300804 each of the above values can be set to "any" to match any valid value.
805
806 At driver init, all values are set to any.
807
808 For example, to generate an error at rank 1 of dimm 2, for any channel,
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200809 any bank, any page, any column::
810
Mauro Carvalho Chehab35be9542009-09-24 17:28:50 -0300811 echo 2 >/sys/devices/system/edac/mc/mc0/inject_addrmatch/dimm
812 echo 1 >/sys/devices/system/edac/mc/mc0/inject_addrmatch/rank
Mauro Carvalho Chehab31983a02009-08-05 21:16:56 -0300813
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200814 To return to the default behaviour of matching any, you can do::
815
Mauro Carvalho Chehab35be9542009-09-24 17:28:50 -0300816 echo any >/sys/devices/system/edac/mc/mc0/inject_addrmatch/dimm
817 echo any >/sys/devices/system/edac/mc/mc0/inject_addrmatch/rank
Mauro Carvalho Chehab31983a02009-08-05 21:16:56 -0300818
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200819 - ``inject_eccmask``:
820 specifies what bits will have troubles,
Mauro Carvalho Chehab31983a02009-08-05 21:16:56 -0300821
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200822 - ``inject_section``:
823 specifies what ECC cache section will get the error::
824
Mauro Carvalho Chehab31983a02009-08-05 21:16:56 -0300825 3 for both
826 2 for the highest
827 1 for the lowest
828
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200829 - ``inject_type``:
830 specifies the type of error, being a combination of the following bits::
831
Mauro Carvalho Chehab31983a02009-08-05 21:16:56 -0300832 bit 0 - repeat
833 bit 1 - ecc
834 bit 2 - parity
835
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200836 - ``inject_enable``:
837 starts the error generation when something different than 0 is written.
Mauro Carvalho Chehab31983a02009-08-05 21:16:56 -0300838
839 All inject vars can be read. root permission is needed for write.
840
841 Datasheet states that the error will only be generated after a write on an
842 address that matches inject_addrmatch. It seems, however, that reading will
843 also produce an error.
844
845 For example, the following code will generate an error for any write access
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200846 at socket 0, on any DIMM/address on channel 2::
Mauro Carvalho Chehab31983a02009-08-05 21:16:56 -0300847
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200848 echo 2 >/sys/devices/system/edac/mc/mc0/inject_addrmatch/channel
849 echo 2 >/sys/devices/system/edac/mc/mc0/inject_type
850 echo 64 >/sys/devices/system/edac/mc/mc0/inject_eccmask
851 echo 3 >/sys/devices/system/edac/mc/mc0/inject_section
852 echo 1 >/sys/devices/system/edac/mc/mc0/inject_enable
853 dd if=/dev/mem of=/dev/null seek=16k bs=4k count=1 >& /dev/null
Mauro Carvalho Chehab31983a02009-08-05 21:16:56 -0300854
Mauro Carvalho Chehabc3444362009-09-05 05:10:15 -0300855 For socket 1, it is needed to replace "mc0" by "mc1" at the above
856 commands.
857
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200858 The generated error message will look like::
Mauro Carvalho Chehab31983a02009-08-05 21:16:56 -0300859
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200860 EDAC MC0: UE row 0, channel-a= 0 channel-b= 0 labels "-": NON_FATAL (addr = 0x0075b980, socket=0, Dimm=0, Channel=2, syndrome=0x00000040, count=1, Err=8c0000400001009f:4000080482 (read error: read ECC error))
Mauro Carvalho Chehab31983a02009-08-05 21:16:56 -0300861
8623) Nehalem specific Corrected Error memory counters
863
Mauro Carvalho Chehab35be9542009-09-24 17:28:50 -0300864 Nehalem have some registers to count memory errors. The driver uses those
865 registers to report Corrected Errors on devices with Registered Dimms.
Mauro Carvalho Chehab31983a02009-08-05 21:16:56 -0300866
Mauro Carvalho Chehab35be9542009-09-24 17:28:50 -0300867 However, those counters don't work with Unregistered Dimms. As the chipset
868 offers some counters that also work with UDIMMS (but with a worse level of
869 granularity than the default ones), the driver exposes those registers for
870 UDIMM memories.
Mauro Carvalho Chehabc3444362009-09-05 05:10:15 -0300871
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200872 They can be read by looking at the contents of ``all_channel_counts/``::
Mauro Carvalho Chehab31983a02009-08-05 21:16:56 -0300873
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200874 $ for i in /sys/devices/system/edac/mc/mc0/all_channel_counts/*; do echo $i; cat $i; done
Mauro Carvalho Chehab35be9542009-09-24 17:28:50 -0300875 /sys/devices/system/edac/mc/mc0/all_channel_counts/udimm0
876 0
877 /sys/devices/system/edac/mc/mc0/all_channel_counts/udimm1
878 0
879 /sys/devices/system/edac/mc/mc0/all_channel_counts/udimm2
880 0
Mauro Carvalho Chehabc3444362009-09-05 05:10:15 -0300881
882 What happens here is that errors on different csrows, but at the same
883 dimm number will increment the same counter.
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200884 So, in this memory mapping::
885
Mauro Carvalho Chehabc3444362009-09-05 05:10:15 -0300886 csrow0: channel 0, dimm0
887 csrow1: channel 0, dimm1
888 csrow2: channel 1, dimm0
889 csrow3: channel 2, dimm0
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200890
Mauro Carvalho Chehab35be9542009-09-24 17:28:50 -0300891 The hardware will increment udimm0 for an error at the first dimm at either
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200892 csrow0, csrow2 or csrow3;
893
Mauro Carvalho Chehab35be9542009-09-24 17:28:50 -0300894 The hardware will increment udimm1 for an error at the second dimm at either
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200895 csrow0, csrow2 or csrow3;
896
Mauro Carvalho Chehab35be9542009-09-24 17:28:50 -0300897 The hardware will increment udimm2 for an error at the third dimm at either
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200898 csrow0, csrow2 or csrow3;
Mauro Carvalho Chehabc3444362009-09-05 05:10:15 -0300899
9004) Standard error counters
901
902 The standard error counters are generated when an mcelog error is received
Mauro Carvalho Chehab35be9542009-09-24 17:28:50 -0300903 by the driver. Since, with udimm, this is counted by software, it is
Rami Rosen3aae9ed2015-06-19 09:18:34 +0300904 possible that some errors could be lost. With rdimm's, they display the
Mauro Carvalho Chehab35be9542009-09-24 17:28:50 -0300905 contents of the registers
Borislav Petkov043b4312015-06-19 11:47:17 +0200906
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200907Reference documents used on ``amd64_edac``
908------------------------------------------
909
910``amd64_edac`` module is based on the following documents
Aravind Gopalakrishnan6b7464b2015-09-28 06:44:31 -0500911(available from http://support.amd.com/en-us/search/tech-docs):
912
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -02009131. :Title: BIOS and Kernel Developer's Guide for AMD Athlon 64 and AMD
Aravind Gopalakrishnan6b7464b2015-09-28 06:44:31 -0500914 Opteron Processors
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200915 :AMD publication #: 26094
916 :Revision: 3.26
917 :Link: http://support.amd.com/TechDocs/26094.PDF
Aravind Gopalakrishnan6b7464b2015-09-28 06:44:31 -0500918
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -02009192. :Title: BIOS and Kernel Developer's Guide for AMD NPT Family 0Fh
Aravind Gopalakrishnan6b7464b2015-09-28 06:44:31 -0500920 Processors
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200921 :AMD publication #: 32559
922 :Revision: 3.00
923 :Issue Date: May 2006
924 :Link: http://support.amd.com/TechDocs/32559.pdf
Aravind Gopalakrishnan6b7464b2015-09-28 06:44:31 -0500925
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -02009263. :Title: BIOS and Kernel Developer's Guide (BKDG) For AMD Family 10h
Aravind Gopalakrishnan6b7464b2015-09-28 06:44:31 -0500927 Processors
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200928 :AMD publication #: 31116
929 :Revision: 3.00
930 :Issue Date: September 07, 2007
931 :Link: http://support.amd.com/TechDocs/31116.pdf
Aravind Gopalakrishnan6b7464b2015-09-28 06:44:31 -0500932
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -02009334. :Title: BIOS and Kernel Developer's Guide (BKDG) for AMD Family 15h
Aravind Gopalakrishnan6b7464b2015-09-28 06:44:31 -0500934 Models 30h-3Fh Processors
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200935 :AMD publication #: 49125
936 :Revision: 3.06
937 :Issue Date: 2/12/2015 (latest release)
938 :Link: http://support.amd.com/TechDocs/49125_15h_Models_30h-3Fh_BKDG.pdf
Aravind Gopalakrishnan6b7464b2015-09-28 06:44:31 -0500939
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -02009405. :Title: BIOS and Kernel Developer's Guide (BKDG) for AMD Family 15h
Aravind Gopalakrishnan6b7464b2015-09-28 06:44:31 -0500941 Models 60h-6Fh Processors
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200942 :AMD publication #: 50742
943 :Revision: 3.01
944 :Issue Date: 7/23/2015 (latest release)
945 :Link: http://support.amd.com/TechDocs/50742_15h_Models_60h-6Fh_BKDG.pdf
Aravind Gopalakrishnan6b7464b2015-09-28 06:44:31 -0500946
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -02009476. :Title: BIOS and Kernel Developer's Guide (BKDG) for AMD Family 16h
Aravind Gopalakrishnan6b7464b2015-09-28 06:44:31 -0500948 Models 00h-0Fh Processors
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200949 :AMD publication #: 48751
950 :Revision: 3.03
951 :Issue Date: 2/23/2015 (latest release)
952 :Link: http://support.amd.com/TechDocs/48751_16h_bkdg.pdf
Aravind Gopalakrishnan6b7464b2015-09-28 06:44:31 -0500953
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200954Credits
955=======
Borislav Petkov043b4312015-06-19 11:47:17 +0200956
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200957* Written by Doug Thompson <dougthompson@xmission.com>
Borislav Petkov043b4312015-06-19 11:47:17 +0200958
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200959 - 7 Dec 2005
960 - 17 Jul 2007 Updated
Borislav Petkov043b4312015-06-19 11:47:17 +0200961
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200962* |copy| Mauro Carvalho Chehab
Borislav Petkov043b4312015-06-19 11:47:17 +0200963
Mauro Carvalho Chehabb27a2d02016-10-26 08:14:12 -0200964 - 05 Aug 2009 Nehalem interface
965
966* EDAC authors/maintainers:
967
968 - Doug Thompson, Dave Jiang, Dave Peterson et al,
969 - Mauro Carvalho Chehab
970 - Borislav Petkov
971 - original author: Thayne Harbaugh