Commit 837d9e49 authored by Kurt Cancemi's avatar Kurt Cancemi Committed by Jakub Kicinski
Browse files

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: 3758be3d ("Marvell phy: add functions to suspend and resume both interfaces: fiber and copper links.")
Signed-off-by: default avatarKurt Cancemi <kurt@x64architecture.com>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Link: https://lore.kernel.org/r/20220312201512.326047-1-kurt@x64architecture.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent e981bc74
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -1687,7 +1687,7 @@ static int marvell_suspend(struct phy_device *phydev)
	int err;

	/* Suspend the fiber mode first */
	if (!linkmode_test_bit(ETHTOOL_LINK_MODE_FIBRE_BIT,
	if (linkmode_test_bit(ETHTOOL_LINK_MODE_FIBRE_BIT,
			      phydev->supported)) {
		err = marvell_set_page(phydev, MII_MARVELL_FIBER_PAGE);
		if (err < 0)
@@ -1722,7 +1722,7 @@ static int marvell_resume(struct phy_device *phydev)
	int err;

	/* Resume the fiber mode first */
	if (!linkmode_test_bit(ETHTOOL_LINK_MODE_FIBRE_BIT,
	if (linkmode_test_bit(ETHTOOL_LINK_MODE_FIBRE_BIT,
			      phydev->supported)) {
		err = marvell_set_page(phydev, MII_MARVELL_FIBER_PAGE);
		if (err < 0)