diff mbox series

[net-next,3/6] net: fec: remove eee_enabled/eee_active in fec_enet_get_eee()

Message ID E1rVpvm-002Pe0-TV@rmk-PC.armlinux.org.uk (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series net: eee network driver cleanups | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
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: 1048 this patch: 1048
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 0 of 0 maintainers
netdev/build_clang success Errors and warnings before: 1065 this patch: 1065
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: 1065 this patch: 1065
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 15 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Russell King (Oracle) Feb. 2, 2024, 9:33 a.m. UTC
fec_enet_get_eee() sets edata->eee_active and edata->eee_enabled from
its own copy, and then calls phy_ethtool_get_eee() which in turn will
call genphy_c45_ethtool_get_eee().

genphy_c45_ethtool_get_eee() will overwrite eee_enabled and eee_active
with its own interpretation from the PHYs settings and negotiation
result.

Therefore, setting these members in fec_enet_get_eee() is redundant.
Remove this, and remove the setting of fep->eee.eee_active member which
becomes a write-only variable.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
---
 drivers/net/ethernet/freescale/fec_main.c | 3 ---
 1 file changed, 3 deletions(-)

Comments

Andrew Lunn Feb. 2, 2024, 1:22 p.m. UTC | #1
On Fri, Feb 02, 2024 at 09:33:54AM +0000, Russell King (Oracle) wrote:
> fec_enet_get_eee() sets edata->eee_active and edata->eee_enabled from
> its own copy, and then calls phy_ethtool_get_eee() which in turn will
> call genphy_c45_ethtool_get_eee().
> 
> genphy_c45_ethtool_get_eee() will overwrite eee_enabled and eee_active
> with its own interpretation from the PHYs settings and negotiation
> result.
> 
> Therefore, setting these members in fec_enet_get_eee() is redundant.
> Remove this, and remove the setting of fep->eee.eee_active member which
> becomes a write-only variable.

I _think_ p->eee_enabled becomes write only as well?

	Andrew
Russell King (Oracle) Feb. 2, 2024, 1:45 p.m. UTC | #2
On Fri, Feb 02, 2024 at 02:22:02PM +0100, Andrew Lunn wrote:
> On Fri, Feb 02, 2024 at 09:33:54AM +0000, Russell King (Oracle) wrote:
> > fec_enet_get_eee() sets edata->eee_active and edata->eee_enabled from
> > its own copy, and then calls phy_ethtool_get_eee() which in turn will
> > call genphy_c45_ethtool_get_eee().
> > 
> > genphy_c45_ethtool_get_eee() will overwrite eee_enabled and eee_active
> > with its own interpretation from the PHYs settings and negotiation
> > result.
> > 
> > Therefore, setting these members in fec_enet_get_eee() is redundant.
> > Remove this, and remove the setting of fep->eee.eee_active member which
> > becomes a write-only variable.
> 
> I _think_ p->eee_enabled becomes write only as well?

Thanks for spotting, I'll remove it in v2!
diff mbox series

Patch

diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index 63707e065141..38dcf0989e3f 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -3140,7 +3140,6 @@  static int fec_enet_eee_mode_set(struct net_device *ndev, bool enable)
 
 	p->tx_lpi_enabled = enable;
 	p->eee_enabled = enable;
-	p->eee_active = enable;
 
 	writel(sleep_cycle, fep->hwp + FEC_LPI_SLEEP);
 	writel(wake_cycle, fep->hwp + FEC_LPI_WAKE);
@@ -3160,8 +3159,6 @@  fec_enet_get_eee(struct net_device *ndev, struct ethtool_keee *edata)
 	if (!netif_running(ndev))
 		return -ENETDOWN;
 
-	edata->eee_enabled = p->eee_enabled;
-	edata->eee_active = p->eee_active;
 	edata->tx_lpi_timer = p->tx_lpi_timer;
 	edata->tx_lpi_enabled = p->tx_lpi_enabled;