net: sparx5: fix error handling in sparx5_port_open()
authorLiu Jian <liujian56@huawei.com>
Thu, 17 Nov 2022 12:59:18 +0000 (20:59 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 2 Dec 2022 16:41:06 +0000 (17:41 +0100)
commita05c0f9511d09e150a13cd28cf830fe54097f38f
treeb59e40c9994b7e259935fc9f8884c0d74ed48d98
parent182ef20f0f1c4d18280cad240e9c4506c7da61dc
net: sparx5: fix error handling in sparx5_port_open()

[ Upstream commit 4305fe232b8aa59af3761adc9fe6b6aa40913960 ]

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@huawei.com>
Tested-by: Bjarni Jonasson <bjarni.jonasson@microchip.com>
Reviewed-by: Steen Hegelund <steen.hegelund@microchip.com>
Link: https://lore.kernel.org/r/20221117125918.203997-1-liujian56@huawei.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/microchip/sparx5/sparx5_netdev.c