Messages in this thread Patch in this message | | | Date | Wed, 11 May 2022 12:34:58 +0200 | From | Borislav Petkov <> | Subject | Re: [PATCH 04/18] EDAC/amd64: Remove PCI Function 0 |
| |
On Mon, May 09, 2022 at 02:55:20PM +0000, Yazen Ghannam wrote: > @@ -3287,26 +3276,12 @@ static void decode_umc_error(int node_id, struct mce *m) > /* > * Use pvt->F3 which contains the F3 CPU PCI device to get the related > * F1 (AddrMap) and F2 (Dct) devices. Return negative value on error. > - * Reserve F0 on systems with a UMC. > */ > static int > reserve_mc_sibling_devs(struct amd64_pvt *pvt, u16 pci_id1, u16 pci_id2) > { > - if (pvt->umc) { > - pvt->F0 = pci_get_related_function(pvt->F3->vendor, pci_id1, pvt->F3); > - if (!pvt->F0) { > - edac_dbg(1, "F0 not found, device 0x%x\n", pci_id1); > - return -ENODEV; > - } > - > - if (!pci_ctl_dev) > - pci_ctl_dev = &pvt->F0->dev; > - > - edac_dbg(1, "F0: %s\n", pci_name(pvt->F0)); > - edac_dbg(1, "F3: %s\n", pci_name(pvt->F3)); > - > + if (pvt->umc)
I don't like the sprinkling of those checks everywhere. And hw_info_get() has those checks too. I think it would be cleaner if hw_info_get() would call a df-specific function for fam 0x17 and later and do the setup there cleanly:
hw_info_get:
if (pvt->fam >= 0x17) return hw_info_get_df(pvt);
and so on.
Btw, I completely agree with leaving the old code as it is.
And I obviously like the code removal, ofc.
:-)
-- Regards/Gruss, Boris.
https://people.kernel.org/tglx/notes-about-netiquette
| |