diff mbox series

[net-next] net: phy: respect cached advertising when re-enabling EEE

Message ID c75f7f8b-5571-429f-abd3-ce682d178a4b@gmail.com (mailing list archive)
State Accepted
Commit 516a5f11eb97c68b4a5e8b3dc20ced1763b9e941
Delegated to: Netdev Maintainers
Headers show
Series [net-next] net: phy: respect cached advertising when re-enabling EEE | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 3 this patch: 3
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers warning 1 maintainers not CCed: andrew@lunn.ch
netdev/build_clang success Errors and warnings before: 3 this patch: 3
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 4 this patch: 4
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 14 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 35 this patch: 35
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-11-06--12-00 (tests: 782)

Commit Message

Heiner Kallweit Nov. 1, 2024, 7:35 p.m. UTC
If we remove modes from EEE advertisement and disable / re-enable EEE,
then advertisement is set to all supported modes. I don't think this is
what the user expects. So respect the cached advertisement and just fall
back to all supported modes if cached advertisement is empty.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
 drivers/net/phy/phy-c45.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

Comments

patchwork-bot+netdevbpf@kernel.org Nov. 7, 2024, 2 a.m. UTC | #1
Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Fri, 1 Nov 2024 20:35:41 +0100 you wrote:
> If we remove modes from EEE advertisement and disable / re-enable EEE,
> then advertisement is set to all supported modes. I don't think this is
> what the user expects. So respect the cached advertisement and just fall
> back to all supported modes if cached advertisement is empty.
> 
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
> 
> [...]

Here is the summary with links:
  - [net-next] net: phy: respect cached advertising when re-enabling EEE
    https://git.kernel.org/netdev/net-next/c/516a5f11eb97

You are awesome, thank you!
diff mbox series

Patch

diff --git a/drivers/net/phy/phy-c45.c b/drivers/net/phy/phy-c45.c
index 5695935fd..8c4dd94c7 100644
--- a/drivers/net/phy/phy-c45.c
+++ b/drivers/net/phy/phy-c45.c
@@ -1568,11 +1568,10 @@  int genphy_c45_ethtool_set_eee(struct phy_device *phydev,
 				phydev_warn(phydev, "At least some EEE link modes are not supported.\n");
 				return -EINVAL;
 			}
-		} else {
-			adv = phydev->supported_eee;
+			linkmode_copy(phydev->advertising_eee, adv);
+		} else if (linkmode_empty(phydev->advertising_eee)) {
+			phy_advertise_eee_all(phydev);
 		}
-
-		linkmode_copy(phydev->advertising_eee, adv);
 	}
 
 	phydev->eee_enabled = data->eee_enabled;