Skip to contentSkip to conversation

net: phy: marvell: Fix invalid comparison in the resume and suspend functions.

PATCH Superseded Kurt Cancemi 6 participants 8 messages Mar 12, 2022 – Mar 14, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 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 3758be3dc162 ("Marvell phy: add functions to suspend and resume both interfaces: fiber and copper links.")
---
 drivers/net/phy/marvell.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/phy/marvell.c +2 -2
index 2429db614b59..80b888a88127 100644
@@ -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)
Signature · 1 line
2.35.1
maintainer Reviewed-by on v2 1/1
#1 lore raw
Quoted 7 lines · Kurt Cancemi

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 3758be3dc162 ("Marvell phy: add functions to suspend and resume both interfaces: fiber and copper links.")

Andrew

#2 lore raw
In reply to Kurt Cancemi
Quoted 7 lines · On Fri, 11 Mar 2022 19:20:19 -0500 Kurt Cancemi <[email protected]>…

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 3758be3dc162 ("Marvell phy: add functions to suspend and resume both interfaces: fiber and copper links.")

Nitpick: We don't use dots to end subject lines.

Marek

#3 lore raw
Quoted 8 lines · Marek Behún
Quoted 5 lines · On Fri, 11 Mar 2022 19:20:19 -0500 Kurt Cancemi <[email protected]>…

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.

Quoted 4 lines
Quoted 2 lines
Fixes 3758be3dc162 ("Marvell phy: add functions to suspend and resume both interfaces: fiber and copper links.")

Nitpick: We don't use dots to end subject lines.

However, the commit in question has, and the Fixes: quoted summary line needs to exactly match the summary line from the commit in question. So, the fixes line is unfortunately correct in this instance.

Signature · 2 lines
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!
#4 lore raw

PATCH v3 1/1 net: phy: marvell: Fix invalid comparison in the resume and suspend functions

In reply to Kurt Cancemi

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 3758be3dc162 ("Marvell phy: add functions to suspend and resume both interfaces: fiber and copper links.")

---

I removed the dot from the summary line.

 drivers/net/phy/marvell.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/phy/marvell.c +2 -2
index 2429db614b59..80b888a88127 100644
@@ -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)
Signature · 1 line
2.35.1
maintainer Reviewed-by on v3 1/1
#5 lore raw

Re: [PATCH net v3] net: phy: marvell: Fix invalid comparison in the resume and suspend functions

Quoted 7 lines · Kurt Cancemi

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 3758be3dc162 ("Marvell phy: add functions to suspend and resume both interfaces: fiber and copper links.")

Hi Kurt

Best practice is to add any Reviewed-by or Tested-by to the patch whenever you repost it, except when you make major changes. Otherwise they can get lost.

Andrew

maintainer
#6 lore raw

Re: [PATCH net v3] net: phy: marvell: Fix invalid comparison in the resume and suspend functions

In reply to Kurt Cancemi

drivers/net/phy/marvell.c static int marvell_suspend(struct phy_device *phydev) · line 1691

Quoted 3 lines · On Sat, 12 Mar 2022 15:15:13 -0500 Kurt Cancemi wrote:
drivers/net/phy/marvell.c +1 -1
-	if (!linkmode_test_bit(ETHTOOL_LINK_MODE_FIBRE_BIT,
+	if (linkmode_test_bit(ETHTOOL_LINK_MODE_FIBRE_BIT,
 			       phydev->supported)) {

You should align the continuation lines so that the start matches the opening parenthesis. I'll fix it up when applying for you this time but please make sure to run checkpatch.pl --strict on patches before submission. Thanks!

#7 lore raw

Re: [PATCH net v3] net: phy: marvell: Fix invalid comparison in the resume and suspend functions

In reply to Kurt Cancemi
This patch was applied to netdev/net.git (master) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net.git (master)
by Jakub Kicinski <[email protected]>:

Quoted 9 lines · On Sat, 12 Mar 2022 15:15:13 -0500 you wrote:

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 3758be3dc162 ("Marvell phy: add functions to suspend and resume both interfaces: fiber and copper links.")

[...]

Here is the summary with links:
- [net,v3] net: phy: marvell: Fix invalid comparison in the resume and suspend functions

    https://git.kernel.org/netdev/net/c/837d9e49402e

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html