Skip to content

Commit 837d9e4

Browse files
x64architecturekuba-moo
authored andcommitted
net: phy: marvell: Fix invalid comparison in the resume and suspend functions
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 <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent e981bc7 commit 837d9e4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/net/phy/marvell.c

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

16891689
/* Suspend the fiber mode first */
1690-
if (!linkmode_test_bit(ETHTOOL_LINK_MODE_FIBRE_BIT,
1691-
phydev->supported)) {
1690+
if (linkmode_test_bit(ETHTOOL_LINK_MODE_FIBRE_BIT,
1691+
phydev->supported)) {
16921692
err = marvell_set_page(phydev, MII_MARVELL_FIBER_PAGE);
16931693
if (err < 0)
16941694
goto error;
@@ -1722,8 +1722,8 @@ static int marvell_resume(struct phy_device *phydev)
17221722
int err;
17231723

17241724
/* Resume the fiber mode first */
1725-
if (!linkmode_test_bit(ETHTOOL_LINK_MODE_FIBRE_BIT,
1726-
phydev->supported)) {
1725+
if (linkmode_test_bit(ETHTOOL_LINK_MODE_FIBRE_BIT,
1726+
phydev->supported)) {
17271727
err = marvell_set_page(phydev, MII_MARVELL_FIBER_PAGE);
17281728
if (err < 0)
17291729
goto error;

0 commit comments

Comments
 (0)