Re: [PATCH v2 08/31] EDAC/amd64: Define function to read DRAM address map registers

From: Borislav Petkov
Date: Wed Jun 30 2021 - 13:29:38 EST


On Wed, Jun 23, 2021 at 07:19:39PM +0000, Yazen Ghannam wrote:
> @@ -1170,22 +1194,13 @@ static int umc_normaddr_to_sysaddr(u64 norm_addr, u16 nid, u8 umc, u64 *sys_addr
> if (remove_dram_offset(&ctx))
> goto out_err;
>
> - reg = df_regs[DRAM_BASE_ADDR];
> - reg.offset += ctx.map_num * 8;
> - if (amd_df_indirect_read(nid, reg, umc, &tmp))
> - goto out_err;
> -
> - /* Check if address range is valid. */
> - if (!(tmp & BIT(0))) {
> - pr_err("%s: Invalid DramBaseAddress range: 0x%x.\n",
> - __func__, tmp);
> + if (get_dram_addr_map(&ctx))
> goto out_err;
> - }

Aha, I see where you're going with the context struct. Yap, ok.

--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette