mbox series

[net,v2,0/2] Fix 'ethtool --show-eee' during initial stage

Message ID 20241115111151.183108-1-yong.liang.choong@linux.intel.com (mailing list archive)
Headers show
Series Fix 'ethtool --show-eee' during initial stage | expand

Message

Choong Yong Liang Nov. 15, 2024, 11:11 a.m. UTC
From: Choong Yong Liang <yong.liang.choong@intel.com>

When the MAC boots up with a Marvell PHY and phy_support_eee() is implemented,
the 'ethtool --show-eee' command shows that EEE is enabled, but in actuality,
the driver side is disabled. If we try to enable EEE through
'ethtool --set-eee' for a Marvell PHY, nothing happens because the eee_cfg
matches the setting required to enable EEE in ethnl_set_eee().

This patch series will remove phydev->eee_enabled and replace it with
eee_cfg.eee_enabled. When performing genphy_c45_an_config_eee_aneg(), it
will follow the master configuration to have software and hardware in sync,
allowing 'ethtool --show-eee' to display the correct value during the
initial stage.

v2 changes:
 - Implement the prototype suggested by Russell
 - Check EEE before calling phy_support_eee()

Thanks to Russell for the proposed prototype in [1].

Reference:
[1] https://patchwork.kernel.org/comment/26121323/

Choong Yong Liang (2):
  net: phy: replace phydev->eee_enabled with eee_cfg.eee_enabled
  net: stmmac: set initial EEE policy configuration

 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c |  3 +++
 drivers/net/phy/phy-c45.c                         | 11 +++++------
 drivers/net/phy/phy_device.c                      |  6 +++---
 include/linux/phy.h                               |  5 ++---
 4 files changed, 13 insertions(+), 12 deletions(-)

Comments

Heiner Kallweit Nov. 15, 2024, 1:41 p.m. UTC | #1
On 15.11.2024 12:11, Choong Yong Liang wrote:
> From: Choong Yong Liang <yong.liang.choong@intel.com>
> 
> When the MAC boots up with a Marvell PHY and phy_support_eee() is implemented,
> the 'ethtool --show-eee' command shows that EEE is enabled, but in actuality,
> the driver side is disabled. If we try to enable EEE through
> 'ethtool --set-eee' for a Marvell PHY, nothing happens because the eee_cfg
> matches the setting required to enable EEE in ethnl_set_eee().
> 
> This patch series will remove phydev->eee_enabled and replace it with
> eee_cfg.eee_enabled. When performing genphy_c45_an_config_eee_aneg(), it
> will follow the master configuration to have software and hardware in sync,
> allowing 'ethtool --show-eee' to display the correct value during the
> initial stage.
> 
> v2 changes:
>  - Implement the prototype suggested by Russell
>  - Check EEE before calling phy_support_eee()
> 
> Thanks to Russell for the proposed prototype in [1].
> 
> Reference:
> [1] https://patchwork.kernel.org/comment/26121323/
> 
> Choong Yong Liang (2):
>   net: phy: replace phydev->eee_enabled with eee_cfg.eee_enabled
>   net: stmmac: set initial EEE policy configuration
> 
>  drivers/net/ethernet/stmicro/stmmac/stmmac_main.c |  3 +++
>  drivers/net/phy/phy-c45.c                         | 11 +++++------
>  drivers/net/phy/phy_device.c                      |  6 +++---
>  include/linux/phy.h                               |  5 ++---
>  4 files changed, 13 insertions(+), 12 deletions(-)
> 

Russell submitted the proposed patch already:
https://patchwork.kernel.org/project/netdevbpf/patch/E1tBXAF-00341F-EQ@rmk-PC.armlinux.org.uk/
So there's no need for your patch 1.
Russell King (Oracle) Nov. 15, 2024, 2:12 p.m. UTC | #2
On Fri, Nov 15, 2024 at 02:41:54PM +0100, Heiner Kallweit wrote:
> On 15.11.2024 12:11, Choong Yong Liang wrote:
> > From: Choong Yong Liang <yong.liang.choong@intel.com>
> > 
> > When the MAC boots up with a Marvell PHY and phy_support_eee() is implemented,
> > the 'ethtool --show-eee' command shows that EEE is enabled, but in actuality,
> > the driver side is disabled. If we try to enable EEE through
> > 'ethtool --set-eee' for a Marvell PHY, nothing happens because the eee_cfg
> > matches the setting required to enable EEE in ethnl_set_eee().
> > 
> > This patch series will remove phydev->eee_enabled and replace it with
> > eee_cfg.eee_enabled. When performing genphy_c45_an_config_eee_aneg(), it
> > will follow the master configuration to have software and hardware in sync,
> > allowing 'ethtool --show-eee' to display the correct value during the
> > initial stage.
> > 
> > v2 changes:
> >  - Implement the prototype suggested by Russell
> >  - Check EEE before calling phy_support_eee()
> > 
> > Thanks to Russell for the proposed prototype in [1].
> > 
> > Reference:
> > [1] https://patchwork.kernel.org/comment/26121323/
> > 
> > Choong Yong Liang (2):
> >   net: phy: replace phydev->eee_enabled with eee_cfg.eee_enabled
> >   net: stmmac: set initial EEE policy configuration
> > 
> >  drivers/net/ethernet/stmicro/stmmac/stmmac_main.c |  3 +++
> >  drivers/net/phy/phy-c45.c                         | 11 +++++------
> >  drivers/net/phy/phy_device.c                      |  6 +++---
> >  include/linux/phy.h                               |  5 ++---
> >  4 files changed, 13 insertions(+), 12 deletions(-)
> > 
> 
> Russell submitted the proposed patch already:
> https://patchwork.kernel.org/project/netdevbpf/patch/E1tBXAF-00341F-EQ@rmk-PC.armlinux.org.uk/
> So there's no need for your patch 1.

Patch 1 is an updated version of that patch, minus my authorship and of
course no sign-off. I've already marked this series as requiring changes
in patchwork (hopefully, if I did it correctly.)