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

Borislav Petkov
2025-10-29T17:11:15Z

On Mon, Oct 13, 2025 at 05:30:42PM +0000, Avadhut Naik wrote:
> The zn_regs_v2 flag should be set for all AMD Family 1Ah-based SOCs.
>
> Set the flag once for all 1Ah-based SOCs and avoid repetetive assignment.

Unknown word [repetetive] in commit message.
Suggestions: ['repetitive', 'repetitively', 'recitative', 'putative']

Please introduce a spellchecker into your patch creation workflow.

> Signed-off-by: Avadhut Naik <avadhut.naik@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 2391f3469961..832f9675e7b0 100644
> --- 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...?

--
Regards/Gruss,
Boris.