RE: [PATCH] EDAC/ie31200: Give each DIMM two chip selects again

From: Qiuxu (Leo) Zhuo

Date: Sun Nov 22 2026 - 11:02:27 EST


> From: Ahmed Abdelfattah via B4 Relay
> <devnull+me.ahmedabdelfattah.dev@xxxxxxxxxx>
> Sent: Friday, November 20, 2026 2:33 AM
> To: Jason Baron <jbaron@xxxxxxxxxx>; Borislav Petkov <bp@xxxxxxxxx>; Tony
> Luck <tony.luck@xxxxxxxxx>; Qiuxu Zhuo <qiuxu.zhuo@xxxxxxxxx>
> Cc: linux-edac@xxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx;
> stable@xxxxxxxxxxxxxxx; Ahmed Abdelfattah <me@xxxxxxxxxxxxxxxxxxxx>
> Subject: [PATCH] EDAC/ie31200: Give each DIMM two chip selects again
>
> External email: Use caution opening links or attachments
>
>
> From: Ahmed Abdelfattah <me@xxxxxxxxxxxxxxxxxxxx>
>
> Since commit afdbc3655556 ("EDAC/ie31200: Make struct dimm_data contain
> decoded information"), ie31200_get_dimm_config() puts rank k of DIMM j at chip
> select j * ranks + k, where ranks is that DIMM's own rank count. In a channel with a
> dual-rank DIMM 0 and a single-rank DIMM 1, both DIMMs then use chip select 1:
> DIMM 1 overwrites the entry for DIMM 0's second rank, mc0/size_mb is short by
> that rank, and errors in it are reported against DIMM 1.
>
> Before that commit the stride was a fixed 2, so DIMM 0 had chip selects 0-1 and
> DIMM 1 had 2-3, and the commit did not mean to change that. The error path still
> passes the two-bit rank field of ECCERRLOG to edac_mc_handle_error() as the chip
> select. If the controller reports DIMM 1's first rank as 2, as the old layout assumed,
> those errors now land on an empty entry when DIMM 1 is single-rank (or when
> both DIMMs are, as DIMM 1 has moved to chip select 1). That trips
> WARN_ON_ONCE(!e->grain) in edac_raw_mc_handle_error() and the error is
> logged against "unknown memory".
>
> Go back to a fixed stride of 2.
>
> Fixes: afdbc3655556 ("EDAC/ie31200: Make struct dimm_data contain decoded
> information")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Ahmed Abdelfattah <me@xxxxxxxxxxxxxxxxxxxx>
> ---
> I ran into this with a QEMU model of the Kaby Lake host bridge (0x5918,
> skl_cfg) that I wrote to exercise ie31200_edac; it is not part of upstream QEMU. It
> fills MAD_DIMM in from the configured DIMMs and reports errors on DIMM S (the
> driver's DIMM 1) with ECCERRLOG rank 2 or 3, which is the layout the driver used
> up to v6.14. I have no machine with two DIMMs per channel to check what real
> controllers put in that field, so the "unknown memory" part rests on the old layout.
> The size_mb part only depends on MAD_DIMM.
>
> Tested on v7.4-rc3+ (4405c18c95d2) with both slots of both channels populated,
> injecting corrected errors on DIMM L's ranks and on DIMM S in both channels, and
> an uncorrected error on DIMM S:
>
> ranks L + S without the patch with it
> 2R + 1R mc0/size_mb 3072 instead of 4096; mc0/size_mb 4096;
> DIMM S errors on "unknown DIMM S errors on
> memory", WARN in edac_mc.c csrow 2
> 1R + 1R mc0/size_mb 4096; DIMM S errors mc0/size_mb 4096;
> on "unknown memory", WARN DIMM S errors on
> csrow 2
> 2R + 2R correct unchanged
>
> On RPL-S, MAD_DIMM can describe up to four ranks per DIMM, so this also moves
> DIMM 1 there: a 1R + 1R channel goes from chip selects 0 and 1 to
> 0 and 2. ECCERRLOG has the same two-bit rank field on RPL-S, so I think two chip
> selects per DIMM is still the right split, but I could not test it. Qiuxu, do you know
> how the RPL-S controller numbers the ranks of the second DIMM in ECCERRLOG?

I no long work at Intel, so I can't confirm the RPL-S ECCERRLOG rank encoding.

For comparison, Intel Ice Lake servers decode the per-channel rank ID from MCi_MISC as

DIMM 0: ranks 0, 1, 2, 3
DIMM 1: ranks 4, 5, 6, 7

See i10nm_mc_decode() (https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/edac/i10nm_base.c#n415).

A similar fixed allocation of ranks 0–1 and 2–3 on RPL-S looks reasonable, although I have not
verified that ECCERRLOG uses this mapping.

Your patch restores the previous fixed stride and fixes the demonstrated overlap with mixed-rank DIMMs.
The change looks good to me.

Reviewed-by: Qiuxu Zhuo qzhuo@xxxxxxxxxx (qzhuo@xxxxxxxxxx)

Thanks.