* [PATCH v3 0/2] EDAC/amd64: Fix UMC csrow decode and consolidate Family 1Ah setup @ 2026-10-02 11:32 Vishal Badole 2026-10-02 11:32 ` [PATCH v3 1/2] EDAC/amd64: Mask UMC chip select to the four implemented selects Vishal Badole 2026-10-02 11:32 ` [PATCH v3 2/2] EDAC/amd64: Set zn_regs_v2 for all Family 1Ah models Vishal Badole 0 siblings, 2 replies; 11+ messages in thread From: Vishal Badole @ 2026-10-02 11:32 UTC (permalink / raw) To: bp, yazen.ghannam, tony.luck, linux-edac, linux-kernel; +Cc: Vishal Badole Two small amd64_edac fixes/cleanups for AMD Family 1Ah. Patch 1 is the fix: mask the UMC chip select with 0x3, not 0x7. Only four chip selects exist, so the old mask could decode an out-of-range csrow and trip an EDAC warning. Patch 2 sets zn_regs_v2 once at the Family 1Ah level instead of in each model case, so future models cannot miss the v2 register layout. Changes since v2: - Patch 1 (fix): Simplified the commit message and updated the code comment. Changes since v1: - Patch 1 (fix): Added Fixes: and Cc: stable, and move the fix first. - Patch 2 (cleanup): Updated the commit message. v2: https://lore.kernel.org/all/20260928180935.472319-1-Vishal.Badole@amd.com/ v1: https://lore.kernel.org/all/20260925172639.97063-1-Vishal.Badole@amd.com/ Vishal Badole (2): EDAC/amd64: Mask UMC chip select to the four implemented selects EDAC/amd64: Set zn_regs_v2 for all Family 1Ah models drivers/edac/amd64_edac.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) -- 2.34.1 ^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v3 1/2] EDAC/amd64: Mask UMC chip select to the four implemented selects 2026-10-02 11:32 [PATCH v3 0/2] EDAC/amd64: Fix UMC csrow decode and consolidate Family 1Ah setup Vishal Badole @ 2026-10-02 11:32 ` Vishal Badole 2026-10-05 18:19 ` Borislav Petkov 2026-10-02 11:32 ` [PATCH v3 2/2] EDAC/amd64: Set zn_regs_v2 for all Family 1Ah models Vishal Badole 1 sibling, 1 reply; 11+ messages in thread From: Vishal Badole @ 2026-10-02 11:32 UTC (permalink / raw) To: bp, yazen.ghannam, tony.luck, linux-edac, linux-kernel Cc: Vishal Badole, stable For DRAM ECC errors, the chip select value can be found in the MCA_SYND[ErrorInformation] field. ErrorInformation[2:0] was first documented in Zen1. The 3 bit field implied that up to 8 chip selects may be used. However, all Zen-based systems have only ever had up to 4 chip selects. So only bits [1:0] would contain a valid chip select value. Future systems are redefining the field to ErrorInformation[1:0]. This matches the existing 'up to 4 chip selects' implementations. And it frees up the extra bit for other decoding. Change the current chip select mask from 0x7 to 0x3 to prepare for the decode change. Fixes: 713ad54675fd ("EDAC, amd64: Define and register UMC error decode function") Cc: <stable@vger.kernel.org> Suggested-by: Yazen Ghannam <yazen.ghannam@amd.com> Signed-off-by: Vishal Badole <Vishal.Badole@amd.com> Reviewed-by: Yazen Ghannam <yazen.ghannam@amd.com> --- drivers/edac/amd64_edac.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c index 475235c402e8..0c0d11c72925 100644 --- a/drivers/edac/amd64_edac.c +++ b/drivers/edac/amd64_edac.c @@ -2796,13 +2796,13 @@ static inline void decode_bus_error(int node_id, struct mce *m) * the instance_id. For example, instance_id=0xYXXXXX where Y is the channel * number. * - * For DRAM ECC errors, the Chip Select number is given in bits [2:0] of + * For DRAM ECC errors, the Chip Select number is given in bits [1:0] of * the MCA_SYND[ErrorInformation] field. */ static void umc_get_err_info(struct mce *m, struct err_info *err) { err->channel = (m->ipid & GENMASK(31, 0)) >> 20; - err->csrow = m->synd & 0x7; + err->csrow = m->synd & 0x3; } static void decode_umc_error(int node_id, struct mce *m) -- 2.34.1 ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v3 1/2] EDAC/amd64: Mask UMC chip select to the four implemented selects 2026-10-02 11:32 ` [PATCH v3 1/2] EDAC/amd64: Mask UMC chip select to the four implemented selects Vishal Badole @ 2026-10-05 18:19 ` Borislav Petkov 0 siblings, 0 replies; 11+ messages in thread From: Borislav Petkov @ 2026-10-05 18:19 UTC (permalink / raw) To: Vishal Badole; +Cc: yazen.ghannam, tony.luck, linux-edac, linux-kernel, stable On Fri, Oct 02, 2026 at 05:02:03PM +0530, Vishal Badole wrote: > For DRAM ECC errors, the chip select value can be found in the > MCA_SYND[ErrorInformation] field. > > ErrorInformation[2:0] was first documented in Zen1. The 3 bit field > implied that up to 8 chip selects may be used. > > However, all Zen-based systems have only ever had up to 4 chip selects. > So only bits [1:0] would contain a valid chip select value. > > Future systems are redefining the field to ErrorInformation[1:0]. This > matches the existing 'up to 4 chip selects' implementations. And it > frees up the extra bit for other decoding. > > Change the current chip select mask from 0x7 to 0x3 to prepare for the > decode change. > > Fixes: 713ad54675fd ("EDAC, amd64: Define and register UMC error decode function") > Cc: <stable@vger.kernel.org> > Suggested-by: Yazen Ghannam <yazen.ghannam@amd.com> > Signed-off-by: Vishal Badole <Vishal.Badole@amd.com> > Reviewed-by: Yazen Ghannam <yazen.ghannam@amd.com> > --- > drivers/edac/amd64_edac.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) Applied, thanks. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette ^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v3 2/2] EDAC/amd64: Set zn_regs_v2 for all Family 1Ah models 2026-10-02 11:32 [PATCH v3 0/2] EDAC/amd64: Fix UMC csrow decode and consolidate Family 1Ah setup Vishal Badole 2026-10-02 11:32 ` [PATCH v3 1/2] EDAC/amd64: Mask UMC chip select to the four implemented selects Vishal Badole @ 2026-10-02 11:32 ` Vishal Badole 2026-10-03 1:22 ` Borislav Petkov 1 sibling, 1 reply; 11+ messages in thread From: Vishal Badole @ 2026-10-02 11:32 UTC (permalink / raw) To: bp, yazen.ghannam, tony.luck, linux-edac, linux-kernel; +Cc: Vishal Badole All Family 1Ah models use the v2 register layout. Today zn_regs_v2 is set in each model case. This works, but a new model could forget to set it and read the UMC registers at the wrong offsets. Set zn_regs_v2 once at the Family 1Ah level so it applies to all models uniformly, and drop the per-model assignments. No functional change intended. Suggested-by: Yazen Ghannam <yazen.ghannam@amd.com> Signed-off-by: Vishal Badole <Vishal.Badole@amd.com> Reviewed-by: Yazen Ghannam <yazen.ghannam@amd.com> --- drivers/edac/amd64_edac.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c index 0c0d11c72925..708fc1b4a999 100644 --- a/drivers/edac/amd64_edac.c +++ b/drivers/edac/amd64_edac.c @@ -3887,23 +3887,19 @@ static int per_family_init(struct amd64_pvt *pvt) break; case 0x1A: + pvt->flags.zn_regs_v2 = 1; + switch (pvt->model) { case 0x00 ... 0x1f: pvt->max_mcs = 12; - pvt->flags.zn_regs_v2 = 1; - break; - case 0x40 ... 0x4f: - pvt->flags.zn_regs_v2 = 1; break; case 0x50 ... 0x57: case 0xc0 ... 0xc7: pvt->max_mcs = 16; - pvt->flags.zn_regs_v2 = 1; break; case 0x90 ... 0x9f: case 0xa0 ... 0xaf: pvt->max_mcs = 8; - pvt->flags.zn_regs_v2 = 1; break; } break; -- 2.34.1 ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v3 2/2] EDAC/amd64: Set zn_regs_v2 for all Family 1Ah models 2026-10-02 11:32 ` [PATCH v3 2/2] EDAC/amd64: Set zn_regs_v2 for all Family 1Ah models Vishal Badole @ 2026-10-03 1:22 ` Borislav Petkov 2026-10-04 15:14 ` Yazen Ghannam 0 siblings, 1 reply; 11+ messages in thread From: Borislav Petkov @ 2026-10-03 1:22 UTC (permalink / raw) To: Vishal Badole; +Cc: yazen.ghannam, tony.luck, linux-edac, linux-kernel On Fri, Oct 02, 2026 at 05:02:04PM +0530, Vishal Badole wrote: > All Family 1Ah models use the v2 register layout. Today zn_regs_v2 is > set in each model case. This works, but a new model could forget to set > it and read the UMC registers at the wrong offsets. > > Set zn_regs_v2 once at the Family 1Ah level so it applies to all models > uniformly, and drop the per-model assignments. > > No functional change intended. > > Suggested-by: Yazen Ghannam <yazen.ghannam@amd.com> > Signed-off-by: Vishal Badole <Vishal.Badole@amd.com> > Reviewed-by: Yazen Ghannam <yazen.ghannam@amd.com> > --- > drivers/edac/amd64_edac.c | 8 ++------ > 1 file changed, 2 insertions(+), 6 deletions(-) > > diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c > index 0c0d11c72925..708fc1b4a999 100644 > --- a/drivers/edac/amd64_edac.c > +++ b/drivers/edac/amd64_edac.c > @@ -3887,23 +3887,19 @@ static int per_family_init(struct amd64_pvt *pvt) > break; > > case 0x1A: > + pvt->flags.zn_regs_v2 = 1; > + > switch (pvt->model) { > case 0x00 ... 0x1f: > pvt->max_mcs = 12; > - pvt->flags.zn_regs_v2 = 1; > - break; > - case 0x40 ... 0x4f: ^^^^^^^^^^^^^^^^^^^ Why? > - pvt->flags.zn_regs_v2 = 1; > break; > case 0x50 ... 0x57: > case 0xc0 ... 0xc7: > pvt->max_mcs = 16; > - pvt->flags.zn_regs_v2 = 1; > break; > case 0x90 ... 0x9f: > case 0xa0 ... 0xaf: > pvt->max_mcs = 8; > - pvt->flags.zn_regs_v2 = 1; > break; > } > break; > -- > 2.34.1 > > -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v3 2/2] EDAC/amd64: Set zn_regs_v2 for all Family 1Ah models 2026-10-03 1:22 ` Borislav Petkov @ 2026-10-04 15:14 ` Yazen Ghannam 2026-10-04 16:04 ` Borislav Petkov 0 siblings, 1 reply; 11+ messages in thread From: Yazen Ghannam @ 2026-10-04 15:14 UTC (permalink / raw) To: Borislav Petkov; +Cc: Vishal Badole, tony.luck, linux-edac, linux-kernel On Fri, Oct 02, 2026 at 06:22:38PM -0700, Borislav Petkov wrote: > On Fri, Oct 02, 2026 at 05:02:04PM +0530, Vishal Badole wrote: > > All Family 1Ah models use the v2 register layout. Today zn_regs_v2 is > > set in each model case. This works, but a new model could forget to set > > it and read the UMC registers at the wrong offsets. > > > > Set zn_regs_v2 once at the Family 1Ah level so it applies to all models > > uniformly, and drop the per-model assignments. > > > > No functional change intended. > > > > Suggested-by: Yazen Ghannam <yazen.ghannam@amd.com> > > Signed-off-by: Vishal Badole <Vishal.Badole@amd.com> > > Reviewed-by: Yazen Ghannam <yazen.ghannam@amd.com> > > --- > > drivers/edac/amd64_edac.c | 8 ++------ > > 1 file changed, 2 insertions(+), 6 deletions(-) > > > > diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c > > index 0c0d11c72925..708fc1b4a999 100644 > > --- a/drivers/edac/amd64_edac.c > > +++ b/drivers/edac/amd64_edac.c > > @@ -3887,23 +3887,19 @@ static int per_family_init(struct amd64_pvt *pvt) > > break; > > > > case 0x1A: > > + pvt->flags.zn_regs_v2 = 1; > > + > > switch (pvt->model) { > > case 0x00 ... 0x1f: > > pvt->max_mcs = 12; > > - pvt->flags.zn_regs_v2 = 1; > > - break; > > - case 0x40 ... 0x4f: > ^^^^^^^^^^^^^^^^^^^ > > Why? > > > - pvt->flags.zn_regs_v2 = 1; > > break; Because it becomes an empty case once this flag set is moved up. Thanks, Yazen ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v3 2/2] EDAC/amd64: Set zn_regs_v2 for all Family 1Ah models 2026-10-04 15:14 ` Yazen Ghannam @ 2026-10-04 16:04 ` Borislav Petkov 2026-10-04 17:05 ` Yazen Ghannam 0 siblings, 1 reply; 11+ messages in thread From: Borislav Petkov @ 2026-10-04 16:04 UTC (permalink / raw) To: Yazen Ghannam; +Cc: Vishal Badole, tony.luck, linux-edac, linux-kernel On Sun, Oct 04, 2026 at 11:14:47AM -0400, Yazen Ghannam wrote: > Because it becomes an empty case once this flag set is moved up. No, models 0x40... are supported. The others which are not explicitly listed there are not. And no, the code doesn't enforce it yet but probably it should. And there should be a default: label for the models too which returns -ENODEV, like it does for the unknown families. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v3 2/2] EDAC/amd64: Set zn_regs_v2 for all Family 1Ah models 2026-10-04 16:04 ` Borislav Petkov @ 2026-10-04 17:05 ` Yazen Ghannam 2026-10-04 17:50 ` Borislav Petkov 0 siblings, 1 reply; 11+ messages in thread From: Yazen Ghannam @ 2026-10-04 17:05 UTC (permalink / raw) To: Borislav Petkov; +Cc: Vishal Badole, tony.luck, linux-edac, linux-kernel On Sun, Oct 04, 2026 at 09:04:12AM -0700, Borislav Petkov wrote: > On Sun, Oct 04, 2026 at 11:14:47AM -0400, Yazen Ghannam wrote: > > Because it becomes an empty case once this flag set is moved up. > > No, models 0x40... are supported. The others which are not explicitly listed > there are not. > > And no, the code doesn't enforce it yet but probably it should. And there > should be a default: label for the models too which returns -ENODEV, like it > does for the unknown families. > I see what you mean, but I think that's a bigger issue with the current design. And I want to move away from that. The current design is "opt-in" for each new model/group even if there's no technical difference. So we keep having to write these minor model check patches just to load the module. I'd rather we load unconditionally for all models with the same base behavior using sane defaults. Then we can have model-specific patches for variations, if needed. Essentially, we could avoid a whole class of patches for derivative (client, embedded, etc.) products. The module would load with the sane defaults. If the test folks find an issue, then we can have a model-specific patch. This is how we've been trending with AMD64 EDAC. The family init has been shrinking over the years. Thanks, Yazen ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v3 2/2] EDAC/amd64: Set zn_regs_v2 for all Family 1Ah models 2026-10-04 17:05 ` Yazen Ghannam @ 2026-10-04 17:50 ` Borislav Petkov 2026-10-05 15:07 ` Yazen Ghannam 0 siblings, 1 reply; 11+ messages in thread From: Borislav Petkov @ 2026-10-04 17:50 UTC (permalink / raw) To: Yazen Ghannam; +Cc: Vishal Badole, tony.luck, linux-edac, linux-kernel On Sun, Oct 04, 2026 at 01:05:25PM -0400, Yazen Ghannam wrote: > I'd rather we load unconditionally for all models with the same base > behavior using sane defaults. Then we can have model-specific patches > for variations, if needed. I'd rather not because I keep getting all those: amd64_edac doesn't load on my machine reports. Well, after a while it turns out that it should not load there in the first place. And then there's the managerial checkbox patch which needs to add support for their new model just because... does it even make sense to add support? Oh, we didn't even think of that but it says "Unsupported" so we thought we should "fix" the error message... So I don't want to have that unnecessary waste of everything. And if a f/m/s would keep my sanity, then I'm perfectly fine with it. > Essentially, we could avoid a whole class of patches for derivative > (client, embedded, etc.) products. The module would load with the sane > defaults. If the test folks find an issue, then we can have a > model-specific patch. Only on well-tested and supported configurations. Everything else doesn't work. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v3 2/2] EDAC/amd64: Set zn_regs_v2 for all Family 1Ah models 2026-10-04 17:50 ` Borislav Petkov @ 2026-10-05 15:07 ` Yazen Ghannam 2026-10-06 5:39 ` Badole, Vishal 0 siblings, 1 reply; 11+ messages in thread From: Yazen Ghannam @ 2026-10-05 15:07 UTC (permalink / raw) To: Borislav Petkov; +Cc: Vishal Badole, tony.luck, linux-edac, linux-kernel On Sun, Oct 04, 2026 at 10:50:48AM -0700, Borislav Petkov wrote: > On Sun, Oct 04, 2026 at 01:05:25PM -0400, Yazen Ghannam wrote: > > I'd rather we load unconditionally for all models with the same base > > behavior using sane defaults. Then we can have model-specific patches > > for variations, if needed. > > I'd rather not because I keep getting all those: amd64_edac doesn't load on my > machine reports. Well, after a while it turns out that it should not load > there in the first place. > > And then there's the managerial checkbox patch which needs to add support for > their new model just because... does it even make sense to add support? Oh, we > didn't even think of that but it says "Unsupported" so we thought we should > "fix" the error message... > > So I don't want to have that unnecessary waste of everything. And if a f/m/s > would keep my sanity, then I'm perfectly fine with it. > > > Essentially, we could avoid a whole class of patches for derivative > > (client, embedded, etc.) products. The module would load with the sane > > defaults. If the test folks find an issue, then we can have a > > model-specific patch. > > Only on well-tested and supported configurations. Everything else doesn't > work. > Okay, fair enough. Vishal, you should be able to combine the current version with the suggestion from Boris. 1) Move the zn v2 flag to the top of the 1Ah case. 2) Add 'failure' for the default case. 3) Leave the 40h model group and add the new group with it. Basically, there will be two model ranges sharing the 'empty' case. 4) Update the commit message with the new details. Make sure to describe 'why' rather than 'what'. Thanks, Yazen ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v3 2/2] EDAC/amd64: Set zn_regs_v2 for all Family 1Ah models 2026-10-05 15:07 ` Yazen Ghannam @ 2026-10-06 5:39 ` Badole, Vishal 0 siblings, 0 replies; 11+ messages in thread From: Badole, Vishal @ 2026-10-06 5:39 UTC (permalink / raw) To: Yazen Ghannam, Borislav Petkov; +Cc: tony.luck, linux-edac, linux-kernel On 10/5/2026 8:37 PM, Yazen Ghannam wrote: > On Sun, Oct 04, 2026 at 10:50:48AM -0700, Borislav Petkov wrote: >> On Sun, Oct 04, 2026 at 01:05:25PM -0400, Yazen Ghannam wrote: >>> I'd rather we load unconditionally for all models with the same base >>> behavior using sane defaults. Then we can have model-specific patches >>> for variations, if needed. >> >> I'd rather not because I keep getting all those: amd64_edac doesn't load on my >> machine reports. Well, after a while it turns out that it should not load >> there in the first place. >> >> And then there's the managerial checkbox patch which needs to add support for >> their new model just because... does it even make sense to add support? Oh, we >> didn't even think of that but it says "Unsupported" so we thought we should >> "fix" the error message... >> >> So I don't want to have that unnecessary waste of everything. And if a f/m/s >> would keep my sanity, then I'm perfectly fine with it. >> >>> Essentially, we could avoid a whole class of patches for derivative >>> (client, embedded, etc.) products. The module would load with the sane >>> defaults. If the test folks find an issue, then we can have a >>> model-specific patch. >> >> Only on well-tested and supported configurations. Everything else doesn't >> work. >> > > Okay, fair enough. > > Vishal, you should be able to combine the current version with the > suggestion from Boris. > > 1) Move the zn v2 flag to the top of the 1Ah case. > 2) Add 'failure' for the default case. > 3) Leave the 40h model group and add the new group with it. Basically, > there will be two model ranges sharing the 'empty' case. > 4) Update the commit message with the new details. Make sure to describe > 'why' rather than 'what'. > > Thanks, > Yazen Sure, I will address the review comments and submit the changes as a separate patch. Since patch 1 has already been accepted, I will keep these updates isolated in a follow-up patch. Thanks, Vishal ^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2026-10-06 5:39 UTC | newest] Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2026-10-02 11:32 [PATCH v3 0/2] EDAC/amd64: Fix UMC csrow decode and consolidate Family 1Ah setup Vishal Badole 2026-10-02 11:32 ` [PATCH v3 1/2] EDAC/amd64: Mask UMC chip select to the four implemented selects Vishal Badole 2026-10-05 18:19 ` Borislav Petkov 2026-10-02 11:32 ` [PATCH v3 2/2] EDAC/amd64: Set zn_regs_v2 for all Family 1Ah models Vishal Badole 2026-10-03 1:22 ` Borislav Petkov 2026-10-04 15:14 ` Yazen Ghannam 2026-10-04 16:04 ` Borislav Petkov 2026-10-04 17:05 ` Yazen Ghannam 2026-10-04 17:50 ` Borislav Petkov 2026-10-05 15:07 ` Yazen Ghannam 2026-10-06 5:39 ` Badole, Vishal
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®