Re: [PATCH 3/4] EDAC/amd64: Set zn_regs_v2 flag for all AMD Family 1Ah-based SOCs

Yazen Ghannam
2025-10-30T13:48:46Z

On Wed, Oct 29, 2025 at 06:10:57PM +0100, Borislav Petkov wrote:
> On Mon, Oct 13, 2025 at 05:30:42PM +0000, Avadhut Naik wrote:

[...]

> > --- a/drivers/edac/amd64_edac.c
> > +++ b/drivers/edac/amd64_edac.c
> > @@ -3779,6 +3779,8 @@ static int per_family_init(struct amd64_pvt *pvt)
> > else
> > pvt->ops = &dct_ops;
> >
> > + pvt->flags.zn_regs_v2 = (pvt->fam >= 0x1A) ? 1 : 0;
> > +
> > switch (pvt->fam) {
> > case 0xf:
> > tmp_name = (pvt->ext_model >= K8_REV_F) ?
> > @@ -3887,20 +3889,14 @@ static int per_family_init(struct amd64_pvt *pvt)
> > 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;
> > }
>
> I'm not sure about this: if we hoist this particular assignment up, then
> what's the point of the tabellary switch-case where you can see at a quick
> glance, all the settings that we do per model...?
>

I think we should take any opportunity to get away from family/model
checks.

Yes, we still have one item (max_mcs) left. As a follow up, we can see
if this can be removed also.

Thanks,
Yazen