Re: [PATCH v5 5/5] EDAC: Versal NET: Add support for error notification
From: Borislav Petkov
Date: Wed Mar 19 2025 - 06:42:08 EST
On Wed, Mar 05, 2025 at 05:18:19AM +0000, Datta, Shubhrajyoti wrote:
> The loop iterates through all 8 controllers, checking their configuration
> registers. It looks for the first enabled controller by verifying if its
> device width (dt) is not DEV_UNKNOWN. Once it finds the first valid
> controller, it breaks out of the loop and registers that one
So the first enabled controller doesn't have an unknown device width. Ok, put
a comment above that loop pls.
Also, if no controller is enabled, that driver will continue probing with
num_chans of the last controller. Which is wrong. You need to handle that too.
I'd suggest you put that loop first (or as early as possible) in the probe
function to avoid all kinds of unnecessary unwinding when it doesn't detect
an enabled controller.
And so on...
Thx.
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette