Skip to content

Commit 169add8

Browse files
x64architecturegregkh
authored andcommitted
net: phy: marvell: Fix invalid comparison in the resume and suspend functions
[ Upstream commit 837d9e4 ] This bug resulted in only the current mode being resumed and suspended when the PHY supported both fiber and copper modes and when the PHY only supported copper mode the fiber mode would incorrectly be attempted to be resumed and suspended. Fixes: 3758be3 ("Marvell phy: add functions to suspend and resume both interfaces: fiber and copper links.") Signed-off-by: Kurt Cancemi <kurt@x64architecture.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Link: https://lore.kernel.org/r/20220312201512.326047-1-kurt@x64architecture.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 01fac1c commit 169add8

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

drivers/net/phy/marvell.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1536,8 +1536,8 @@ static int marvell_suspend(struct phy_device *phydev)
15361536
int err;
15371537

15381538
/* Suspend the fiber mode first */
1539-
if (!linkmode_test_bit(ETHTOOL_LINK_MODE_FIBRE_BIT,
1540-
phydev->supported)) {
1539+
if (linkmode_test_bit(ETHTOOL_LINK_MODE_FIBRE_BIT,
1540+
phydev->supported)) {
15411541
err = marvell_set_page(phydev, MII_MARVELL_FIBER_PAGE);
15421542
if (err < 0)
15431543
goto error;
@@ -1571,8 +1571,8 @@ static int marvell_resume(struct phy_device *phydev)
15711571
int err;
15721572

15731573
/* Resume the fiber mode first */
1574-
if (!linkmode_test_bit(ETHTOOL_LINK_MODE_FIBRE_BIT,
1575-
phydev->supported)) {
1574+
if (linkmode_test_bit(ETHTOOL_LINK_MODE_FIBRE_BIT,
1575+
phydev->supported)) {
15761576
err = marvell_set_page(phydev, MII_MARVELL_FIBER_PAGE);
15771577
if (err < 0)
15781578
goto error;

0 commit comments

Comments
 (0)