Re: [PATCH 1/9] EDAC/versalnet: Add NULL check for mci in handle_error()

From: Borislav Petkov

Date: Tue Jul 28 2026 - 17:49:12 EST


On Tue, Jul 28, 2026 at 11:57:28PM +0530, Pandey, Radhey Shyam wrote:
> One clarification on DEV_UNKNOWN: on Versal NET, the driver exposes 8
> MC5 controller slots, but a given platform may not have all of them
> configured.

Are you basically saying that you can have non-contiguous controller slots
present on a system?

If so, the whole unwinding path needs to be reworked so that it doesn't remove
the properly configured ones but simply probes each one, if it finds one, it
initializes it and if it doesn't, simply continues.

Which then begs the question should that driver even load if one of the
instances fail probing?

We don't allow that in amd64_edac, see:

for (i = 0; i < amd_nb_num(); i++) {
err = probe_one_instance(i);
if (err) {
/* unwind properly */
while (--i >= 0)
remove_one_instance(i);

goto err_pci;
}
}

But I'm willing to be persuaded that it can make sense for your driver.

Whatever it is, the code needs to be made to handle that configuration
properly and that needs to be stated somewhere prominently why is it done so.

Thx.

--
Regards/Gruss,
Boris.

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