Re: [PATCH net] net: dsa: mv88e6xxx: Fix PCS link check on CMODE read error

From: Vladimir Oltean

Date: Thu Aug 13 2026 - 14:53:21 EST


On Thu, Aug 13, 2026 at 11:31:31PM +0800, Ruoyu Wang wrote:
> mv88e6352_pcs_link_check() ignores errors returned by
> port_get_cmode(). If the port status register read fails,
> mv88e6352_port_get_cmode() returns without setting cmode. The link check
> then compares an uninitialized value and may incorrectly treat the PCS
> as active.
>
> Save the return value and fail the link check after releasing the
> register lock. marvell_c22_pcs_get_state() initializes the reported link
> state to down before calling the check, so a read failure is handled
> safely until a later poll succeeds.
>
> This issue was found by a static analysis checker and confirmed by manual
> source review.
>
> Fixes: 85764555442f ("net: dsa: mv88e6xxx: convert 88e6352 to phylink_pcs")
> Signed-off-by: Ruoyu Wang <ruoyuw560@xxxxxxxxx>
> ---

Reviewed-by: Vladimir Oltean <olteanv@xxxxxxxxx>