diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-01-27 12:12:32 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-05-28 18:10:57 -0400 |
commit | a7d7d2e1a07e3811dc49af2962c940fd8bbb6c8f (patch) | |
tree | 6c3ac39bf25fb7810668f57476c7b5872d5b418b /include/linux/edac.h | |
parent | 76e10d158efb6d4516018846f60c2ab5501900bc (diff) |
edac: Create a dimm struct and move the labels into it
The way a DIMM is currently represented implies that they're
linked into a per-csrow struct. However, some drivers don't see
csrows, as they're ridden behind some chip like the AMB's
on FBDIMM's, for example.
This forced drivers to fake^Wvirtualize a csrow struct, and to create
a mess under csrow/channel original's concept.
Move the DIMM labels into a per-DIMM struct, and add there
the real location of the socket, in terms of csrow/channel.
Latter patches will modify the location to properly represent the
memory architecture.
All other drivers will use a per-csrow type of location.
Some of those drivers will require a latter conversion, as
they also fake the csrows internally.
TODO: While this patch doesn't change the existing behavior, on
csrows-based memory controllers, a csrow/channel pair points to a memory
rank. There's a known bug at the EDAC core that allows having different
labels for the same DIMM, if it has more than one rank. A latter patch
is need to merge the several ranks for a DIMM into the same dimm_info
struct, in order to avoid having different labels for the same DIMM.
The edac_mc_alloc() will now contain a per-dimm initialization loop that
will be changed by latter patches in order to match other types of
memory architectures.
Reviewed-by: Aristeu Rozanski <arozansk@redhat.com>
Reviewed-by: Borislav Petkov <borislav.petkov@amd.com>
Cc: Doug Thompson <norsk5@yahoo.com>
Cc: Ranganathan Desikan <ravi@jetztechnologies.com>
Cc: "Arvind R." <arvino55@gmail.com>
Cc: "Niklas Söderlund" <niklas.soderlund@ericsson.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'include/linux/edac.h')
-rw-r--r-- | include/linux/edac.h | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/include/linux/edac.h b/include/linux/edac.h index c621d762bb2c..52bceca85e63 100644 --- a/include/linux/edac.h +++ b/include/linux/edac.h | |||
@@ -312,23 +312,34 @@ enum scrub_type { | |||
312 | * 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. |
313 | */ | 313 | */ |
314 | 314 | ||
315 | /* FIXME: add a per-dimm ce error count */ | ||
316 | struct dimm_info { | ||
317 | char label[EDAC_MC_LABEL_LEN + 1]; /* DIMM label on motherboard */ | ||
318 | unsigned memory_controller; | ||
319 | unsigned csrow; | ||
320 | unsigned csrow_channel; | ||
321 | }; | ||
322 | |||
315 | /** | 323 | /** |
316 | * struct rank_info - contains the information for one DIMM rank | 324 | * struct rank_info - contains the information for one DIMM rank |
317 | * | 325 | * |
318 | * @chan_idx: channel number where the rank is (typically, 0 or 1) | 326 | * @chan_idx: channel number where the rank is (typically, 0 or 1) |
319 | * @ce_count: number of correctable errors for this rank | 327 | * @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 | 328 | * @csrow: A pointer to the chip select row structure (the parent |
324 | * structure). The location of the rank is given by | 329 | * structure). The location of the rank is given by |
325 | * the (csrow->csrow_idx, chan_idx) vector. | 330 | * the (csrow->csrow_idx, chan_idx) vector. |
331 | * @dimm: A pointer to the DIMM structure, where the DIMM label | ||
332 | * information is stored. | ||
333 | * | ||
334 | * FIXME: Currently, the EDAC core model will assume one DIMM per rank. | ||
335 | * This is a bad assumption, but it makes this patch easier. Later | ||
336 | * patches in this series will fix this issue. | ||
326 | */ | 337 | */ |
327 | struct rank_info { | 338 | struct rank_info { |
328 | int chan_idx; | 339 | int chan_idx; |
329 | u32 ce_count; | 340 | u32 ce_count; |
330 | char label[EDAC_MC_LABEL_LEN + 1]; | 341 | struct csrow_info *csrow; |
331 | struct csrow_info *csrow; /* the parent */ | 342 | struct dimm_info *dimm; |
332 | }; | 343 | }; |
333 | 344 | ||
334 | struct csrow_info { | 345 | struct csrow_info { |
@@ -428,6 +439,13 @@ struct mem_ctl_info { | |||
428 | int mc_idx; | 439 | int mc_idx; |
429 | int nr_csrows; | 440 | int nr_csrows; |
430 | struct csrow_info *csrows; | 441 | struct csrow_info *csrows; |
442 | |||
443 | /* | ||
444 | * DIMM info. Will eventually remove the entire csrows_info some day | ||
445 | */ | ||
446 | unsigned nr_dimms; | ||
447 | struct dimm_info *dimms; | ||
448 | |||
431 | /* | 449 | /* |
432 | * FIXME - what about controllers on other busses? - IDs must be | 450 | * FIXME - what about controllers on other busses? - IDs must be |
433 | * unique. dev pointer should be sufficiently unique, but | 451 | * unique. dev pointer should be sufficiently unique, but |