diff mbox series

[net-next] net: phy: Read EEE abilities when using .features

Message ID 20230217031520.1249198-1-andrew@lunn.ch (mailing list archive)
State Accepted
Commit c2a978c171a6d44d4d9710e7e4455f75d34aecee
Delegated to: Netdev Maintainers
Headers show
Series [net-next] net: phy: Read EEE abilities when using .features | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix success Link
netdev/cover_letter success Single patches do not need cover letters
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers fail 1 blamed authors not CCed: davem@davemloft.net; 4 maintainers not CCed: pabeni@redhat.com kuba@kernel.org edumazet@google.com davem@davemloft.net
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch warning CHECK: braces {} should be used on all arms of this statement
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Andrew Lunn Feb. 17, 2023, 3:15 a.m. UTC
A PHY driver can use a static integer value to indicate what link mode
features it supports, i.e, its abilities.. This is the old way, but
useful when dynamically determining the devices features does not
work, e.g. support of fibre.

EEE support has been moved into phydev->supported_eee. This needs to
be set otherwise the code assumes EEE is not supported. It is normally
set as part of reading the devices abilities. However if a static
integer value was used, the dynamic reading of the abilities is not
performed. Add a call to genphy_c45_read_eee_abilities() to read the
EEE abilities.

Fixes: 8b68710a3121 ("net: phy: start using genphy_c45_ethtool_get/set_eee()")
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
---
 drivers/net/phy/phy_device.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Oleksij Rempel Feb. 17, 2023, 6:03 a.m. UTC | #1
On Fri, Feb 17, 2023 at 04:15:20AM +0100, Andrew Lunn wrote:
> A PHY driver can use a static integer value to indicate what link mode
> features it supports, i.e, its abilities.. This is the old way, but
> useful when dynamically determining the devices features does not
> work, e.g. support of fibre.
> 
> EEE support has been moved into phydev->supported_eee. This needs to
> be set otherwise the code assumes EEE is not supported. It is normally
> set as part of reading the devices abilities. However if a static
> integer value was used, the dynamic reading of the abilities is not
> performed. Add a call to genphy_c45_read_eee_abilities() to read the
> EEE abilities.
> 
> Fixes: 8b68710a3121 ("net: phy: start using genphy_c45_ethtool_get/set_eee()")
> Signed-off-by: Andrew Lunn <andrew@lunn.ch>

Reviewed-by: Oleksij Rempel <o.rempel@pengutronix.de>

> ---
>  drivers/net/phy/phy_device.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
> index 8d927c5e3bf8..71becceb8764 100644
> --- a/drivers/net/phy/phy_device.c
> +++ b/drivers/net/phy/phy_device.c
> @@ -3113,8 +3113,10 @@ static int phy_probe(struct device *dev)
>  	 * a controller will attach, and may modify one
>  	 * or both of these values
>  	 */
> -	if (phydrv->features)
> +	if (phydrv->features) {
>  		linkmode_copy(phydev->supported, phydrv->features);
> +		genphy_c45_read_eee_abilities(phydev);
> +	}
>  	else if (phydrv->get_features)
>  		err = phydrv->get_features(phydev);
>  	else if (phydev->is_c45)
> -- 
> 2.39.1
> 
>
patchwork-bot+netdevbpf@kernel.org Feb. 20, 2023, 10:10 a.m. UTC | #2
Hello:

This patch was applied to netdev/net-next.git (master)
by David S. Miller <davem@davemloft.net>:

On Fri, 17 Feb 2023 04:15:20 +0100 you wrote:
> A PHY driver can use a static integer value to indicate what link mode
> features it supports, i.e, its abilities.. This is the old way, but
> useful when dynamically determining the devices features does not
> work, e.g. support of fibre.
> 
> EEE support has been moved into phydev->supported_eee. This needs to
> be set otherwise the code assumes EEE is not supported. It is normally
> set as part of reading the devices abilities. However if a static
> integer value was used, the dynamic reading of the abilities is not
> performed. Add a call to genphy_c45_read_eee_abilities() to read the
> EEE abilities.
> 
> [...]

Here is the summary with links:
  - [net-next] net: phy: Read EEE abilities when using .features
    https://git.kernel.org/netdev/net-next/c/c2a978c171a6

You are awesome, thank you!
diff mbox series

Patch

diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index 8d927c5e3bf8..71becceb8764 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -3113,8 +3113,10 @@  static int phy_probe(struct device *dev)
 	 * a controller will attach, and may modify one
 	 * or both of these values
 	 */
-	if (phydrv->features)
+	if (phydrv->features) {
 		linkmode_copy(phydev->supported, phydrv->features);
+		genphy_c45_read_eee_abilities(phydev);
+	}
 	else if (phydrv->get_features)
 		err = phydrv->get_features(phydev);
 	else if (phydev->is_c45)