[PATCH net] net: sparx5: fix error handling in sparx5_port_open()

Russell King (Oracle) linux at armlinux.org.uk
Thu Nov 17 05:15:51 PST 2022


On Thu, Nov 17, 2022 at 08:59:18PM +0800, Liu Jian wrote:
> If phylink_of_phy_connect() fails, the port should be disabled.
> If sparx5_serdes_set()/phy_power_on() fails, the port should be
> disabled and the phylink should be stopped and disconnected.
> 
> Fixes: 946e7fd5053a ("net: sparx5: add port module support")
> Fixes: f3cad2611a77 ("net: sparx5: add hostmode with phylink support")
> Signed-off-by: Liu Jian <liujian56 at huawei.com>

The patch looks sane for the code structure that's there, but I question
whether this is the best code structure.

phylink_start() will call the pcs_config() method, which then goes on
to call sparx5_port_pcs_set() and sparx5_port_pcs_low_set() - which
then calls sparx5_serdes_set(). Is that safe with the serdes PHY
powered down? I think sparx5 maintainers need to think about that,
and possibly include a comment in the code if it is indeed safe.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!



More information about the linux-arm-kernel mailing list