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

Steen Hegelund steen.hegelund at microchip.com
Thu Nov 17 06:29:48 PST 2022


Hi Liu and Russell,

Yes, I think we should go over this and do some testing on the platform before taking it in.

On Thu, 2022-11-17 at 13:15 +0000, Russell King (Oracle) wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> 
> 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!

BR
Steen





More information about the linux-arm-kernel mailing list