[PATCH net-next v7 4/8] net: stmmac: Introduce stmmac_fpe_supported()
Vladimir Oltean
olteanv at gmail.com
Thu Oct 31 10:39:46 PDT 2024
On Thu, Oct 31, 2024 at 08:37:58PM +0800, Furong Xu wrote:
> Call stmmac_fpe_supported() to check both HW capability and
> driver capability to keep FPE as an optional implementation
> for current and new MAC cores.
>
> Signed-off-by: Furong Xu <0x1207 at gmail.com>
> ---
Doesn't this commit actually fix a bug which patch 3/8 introduced?
If priv->fpe_cfg.reg is NULL, we will dereference that after just
patch 3/8 has been applied. During e.g. a git bisect landing in between,
that crash might be seen by users.
Thus, please reorder these 2 patches to prevent the bug from existing in
the first place, and say in the commit message that the reason for the
introduction of stmmac_fpe_supported() - initially simply implemented as
a single "priv->dma_cap.fpesel" check - is to prevent unexpected
behavior on unsupported FPE MACs during further refactoring.
Then, the patch "net: stmmac: Refactor FPE functions to generic version"
should be the one which also reimplements stmmac_fpe_supported() to
check for the presence of the newly added primitives.
More information about the linux-arm-kernel
mailing list