• Mauro Carvalho Chehab's avatar
    edac: Only expose csrows/channels on legacy API if they're populated · e39f4ea9
    Mauro Carvalho Chehab authored
    
    
    This patch actually fixes a bug with the legacy API, where, at the
    same csrow, some channels may have different DIMMs. This can happen
    on FB-DIMM/RAMBUS and modern Intel controllers.
    
    This is the case, for example, of Nehalem machines:
    
    $ ./edac-ctl --layout
           +-----------------------------------+
           |                mc0                |
           | channel0  | channel1  | channel2  |
    -------+-----------------------------------+
    slot2: |     0 MB  |     0 MB  |     0 MB  |
    slot1: |  1024 MB  |     0 MB  |     0 MB  |
    slot0: |  1024 MB  |  1024 MB  |  1024 MB  |
    -------+-----------------------------------+
    
    Before this patch, non-filled memories were shown. Now, only what's
    filled is there:
    
    grep . /sys/devices/system/edac/mc/mc0/csrow*/ch?*
    /sys/devices/system/edac/mc/mc0/csrow0/ch0_ce_count:0
    /sys/devices/system/edac/mc/mc0/csrow0/ch0_dimm_label:CPU#0Channel#0_DIMM#0
    /sys/devices/system/edac/mc/mc0/csrow0/ch1_ce_count:0
    /sys/devices/system/edac/mc/mc0/csrow0/ch1_dimm_label:CPU#0Channel#0_DIMM#1
    /sys/devices/system/edac/mc/mc0/csrow1/ch0_ce_count:0
    /sys/devices/system/edac/mc/mc0/csrow1/ch0_dimm_label:CPU#0Channel#1_DIMM#0
    /sys/devices/system/edac/mc/mc0/csrow2/ch0_ce_count:0
    /sys/devices/system/edac/mc/mc0/csrow2/ch0_dimm_label:CPU#0Channel#2_DIMM#0
    
    Thanks-to: Aristeu Rozanski Filho <arozansk@redhat.com>
    Reviewed-by: default avatarAristeu Rozanski <arozansk@redhat.com>
    Cc: Doug Thompson <norsk5@yahoo.com>
    Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
    e39f4ea9
edac_mc_sysfs.c 27.7 KB