[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7b6d0d32-c1c5-4c57-a34c-81c9699c0d49@amd.com>
Date: Mon, 27 Nov 2023 10:00:00 -0500
From: Yazen Ghannam <yazen.ghannam@....com>
To: Borislav Petkov <bp@...en8.de>
Cc: yazen.ghannam@....com, 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 11/27/2023 6:43 AM, Borislav Petkov wrote:
> 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.
The helper is also used in the following patch. But in any case, it may
be overkill. So I'll drop it.
>
> 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.
>
Yep, agreed. Thanks for the suggestion.
Thanks,
Yazen
Powered by blists - more mailing lists