amd-xgbe: fix the false linkup in xgbe_phy_status
authorRaju Rangoju <Raju.Rangoju@amd.com>
Thu, 25 May 2023 18:26:12 +0000 (23:56 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 9 Jun 2023 08:34:01 +0000 (10:34 +0200)
commit7164961a9ce054cc22a5cc68d89ff68b8cd342bc
treee09b8cea6f7f13c356ba796ede941d1775aff26c
parentd615070b0eb8cd84f416a066c4f2157ee7632864
amd-xgbe: fix the false linkup in xgbe_phy_status

[ Upstream commit dc362e20cd6ab7a93d1b09669730c406f0910c35 ]

In the event of a change in XGBE mode, the current auto-negotiation
needs to be reset and the AN cycle needs to be re-triggerred. However,
the current code ignores the return value of xgbe_set_mode(), leading to
false information as the link is declared without checking the status
register.

Fix this by propagating the mode switch status information to
xgbe_phy_status().

Fixes: e57f7a3feaef ("amd-xgbe: Prepare for working with more than one type of phy")
Co-developed-by: Sudheesh Mavila <sudheesh.mavila@amd.com>
Signed-off-by: Sudheesh Mavila <sudheesh.mavila@amd.com>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Acked-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
Signed-off-by: Raju Rangoju <Raju.Rangoju@amd.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/amd/xgbe/xgbe-mdio.c