• Yazen Ghannam's avatar
    EDAC/amd64: Handle three rank interleaving mode · 9f4873fb
    Yazen Ghannam authored
    AMD Rome systems and later support interleaving between three identical
    ranks within a channel.
    
    Check for this mode by counting the number of enabled chip selects and
    comparing their masks. If there are exactly three enabled chip selects
    and their masks are identical, then three rank interleaving is enabled.
    
    The size of a rank is determined from its mask value. However, three
    rank interleaving doesn't follow the method of swapping an interleave
    bit with the most significant bit. Rather, the interleave bit is flipped
    and the most significant bit remains the same. There is only a single
    interleave bit in this case.
    
    Account for this when determining the chip select size by keeping the
    most significant bit at its original value and ignoring any zero bits.
    This will return a full bitmask in [MSB:1].
    
    Fixes: e53a3b26 ("EDAC/amd64: Find Chip Select memory size using Address Mask")
    Signed-off-by: default avatarYazen Ghannam <yazen.ghannam@amd.com>
    Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
    Link: https://lkml.kernel.org/r/20211005154419.2060504-1-yazen.ghannam@amd.com
    9f4873fb
amd64_edac.c 102 KB