[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231127114349.GMZWSA9QADGqCXnTYe@fat_crate.local>
Date: Mon, 27 Nov 2023 12:43:49 +0100
From: Borislav Petkov <bp@...en8.de>
To: Yazen Ghannam <yazen.ghannam@....com>
Cc: linux-edac@...r.kernel.org, linux-kernel@...r.kernel.org,
tony.luck@...el.com, x86@...nel.org, Avadhut.Naik@....com,
Smita.KoralahalliChannabasappa@....com,
amd-gfx@...ts.freedesktop.org, linux-trace-kernel@...r.kernel.org
Subject: Re: [PATCH 05/20] x86/mce/amd: Use helper for UMC bank type check
On Sat, Nov 18, 2023 at 01:32:33PM -0600, Yazen Ghannam wrote:
> @@ -714,14 +721,10 @@ static bool legacy_mce_is_memory_error(struct mce *m)
> */
> static bool smca_mce_is_memory_error(struct mce *m)
> {
> - enum smca_bank_types bank_type;
> -
> if (XEC(m->status, 0x3f))
> return false;
>
> - bank_type = smca_get_bank_type(m->extcpu, m->bank);
> -
> - return bank_type == SMCA_UMC || bank_type == SMCA_UMC_V2;
> + return smca_umc_bank_type(m->ipid);
return FIELD_GET(MCI_IPID_HWID, ipid) == IPID_TYPE_UMC;
after having done:
#define IPID_TYPE_UMC 0x96;
and you don't need that silly helper.
And then you can do more cleanups ontop by doing
/* Unified Memory Controller MCA type */
{ SMCA_UMC, HWID_MCATYPE(IPID_TYPE_UMC, 0x0) },
{ SMCA_UMC_V2, HWID_MCATYPE(IPID_TYPE_UMC, 0x1) },
and have all the numbering properly defined and abstracted away.
Thx.
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
Powered by blists - more mailing lists