[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YhfMBbsex8+cTnSE@yaz-ubuntu>
Date: Thu, 24 Feb 2022 18:18:45 +0000
From: Yazen Ghannam <yazen.ghannam@....com>
To: Borislav Petkov <bp@...en8.de>
Cc: linux-edac@...r.kernel.org, linux-kernel@...r.kernel.org,
mchehab@...nel.org, tony.luck@...el.com, james.morse@....com,
rric@...nel.org, Smita.KoralahalliChannabasappa@....com,
william.roche@...cle.com
Subject: Re: [PATCH v4 1/2] EDAC/amd64: Set memory type per DIMM
On Wed, Feb 23, 2022 at 09:55:08PM +0100, Borislav Petkov wrote:
> On Wed, Feb 02, 2022 at 02:43:06PM +0000, Yazen Ghannam wrote:
> > +static void _determine_memory_type_df(struct amd64_umc *umc)
>
> You don't need this function, right?
>
> IOW, here's what I've applied:
>
...
>
> -static void determine_memory_type(struct amd64_pvt *pvt)
> +static void determine_memory_type_df(struct amd64_pvt *pvt)
> {
> - u32 dram_ctrl, dcsm;
> + struct amd64_umc *umc;
> + u32 i;
>
> - if (pvt->umc) {
> - if ((pvt->umc[0].dimm_cfg | pvt->umc[1].dimm_cfg) & BIT(5))
> - pvt->dram_type = MEM_LRDDR4;
> - else if ((pvt->umc[0].dimm_cfg | pvt->umc[1].dimm_cfg) & BIT(4))
> - pvt->dram_type = MEM_RDDR4;
> + for_each_umc(i) {
> + umc = &pvt->umc[i];
> +
> + if (!(umc->sdp_ctrl & UMC_SDP_INIT)) {
> + umc->dram_type = MEM_EMPTY;
> + continue;
> + }
> +
> + if (umc->dimm_cfg & BIT(5))
> + umc->dram_type = MEM_LRDDR4;
> + else if (umc->dimm_cfg & BIT(4))
> + umc->dram_type = MEM_RDDR4;
> else
> - pvt->dram_type = MEM_DDR4;
> - return;
> + umc->dram_type = MEM_DDR4;
> +
> + edac_dbg(1, " UMC%d DIMM type: %s\n", i, edac_mem_types[umc->dram_type]);
> }
> +}
Ah, I see. You got rid of the extra helper function. Makes sense and looks
okay to me.
Thanks,
Yazen
Powered by blists - more mailing lists