[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y3Y0B4umLgFdcD4u@shell.armlinux.org.uk>
Date: Thu, 17 Nov 2022 13:15:51 +0000
From: "Russell King (Oracle)" <linux@...linux.org.uk>
To: Liu Jian <liujian56@...wei.com>
Cc: davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org,
pabeni@...hat.com, lars.povlsen@...rochip.com,
Steen.Hegelund@...rochip.com, daniel.machon@...rochip.com,
UNGLinuxDriver@...rochip.com, horatiu.vultur@...rochip.com,
bjarni.jonasson@...rochip.com, netdev@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH net] net: sparx5: fix error handling in sparx5_port_open()
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@...wei.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!
Powered by blists - more mailing lists