netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net: dsa: b53: use genphy_c45_eee_is_active directly, instead of phy_init_eee
@ 2025-03-11  6:39 Heiner Kallweit
  2025-03-11 12:41 ` Andrew Lunn
  0 siblings, 1 reply; 3+ messages in thread
From: Heiner Kallweit @ 2025-03-11  6:39 UTC (permalink / raw)
  To: Florian Fainelli, Andrew Lunn, Vladimir Oltean, David Miller,
	Eric Dumazet, Paolo Abeni, Jakub Kicinski
  Cc: netdev@vger.kernel.org

Use genphy_c45_eee_is_active directly instead of phy_init_eee,
this prepares for removing phy_init_eee. With the second
argument being Null, phy_init_eee doesn't initialize anything.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
 drivers/net/dsa/b53/b53_common.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_common.c
index 61d164ffb..17e3ead16 100644
--- a/drivers/net/dsa/b53/b53_common.c
+++ b/drivers/net/dsa/b53/b53_common.c
@@ -2212,10 +2212,7 @@ EXPORT_SYMBOL(b53_mirror_del);
  */
 int b53_eee_init(struct dsa_switch *ds, int port, struct phy_device *phy)
 {
-	int ret;
-
-	ret = phy_init_eee(phy, false);
-	if (ret)
+	if (!phy->drv || genphy_c45_eee_is_active(phy, NULL) <= 0)
 		return 0;
 
 	b53_eee_enable_set(ds, port, true);
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] net: dsa: b53: use genphy_c45_eee_is_active directly, instead of phy_init_eee
  2025-03-11  6:39 [PATCH net-next] net: dsa: b53: use genphy_c45_eee_is_active directly, instead of phy_init_eee Heiner Kallweit
@ 2025-03-11 12:41 ` Andrew Lunn
  2025-03-11 13:05   ` Heiner Kallweit
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Lunn @ 2025-03-11 12:41 UTC (permalink / raw)
  To: Heiner Kallweit
  Cc: Florian Fainelli, Vladimir Oltean, David Miller, Eric Dumazet,
	Paolo Abeni, Jakub Kicinski, netdev@vger.kernel.org

On Tue, Mar 11, 2025 at 07:39:33AM +0100, Heiner Kallweit wrote:
> Use genphy_c45_eee_is_active directly instead of phy_init_eee,
> this prepares for removing phy_init_eee. With the second
> argument being Null, phy_init_eee doesn't initialize anything.
> 
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
> ---
>  drivers/net/dsa/b53/b53_common.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_common.c
> index 61d164ffb..17e3ead16 100644
> --- a/drivers/net/dsa/b53/b53_common.c
> +++ b/drivers/net/dsa/b53/b53_common.c
> @@ -2212,10 +2212,7 @@ EXPORT_SYMBOL(b53_mirror_del);
>   */
>  int b53_eee_init(struct dsa_switch *ds, int port, struct phy_device *phy)
>  {
> -	int ret;
> -
> -	ret = phy_init_eee(phy, false);
> -	if (ret)
> +	if (!phy->drv || genphy_c45_eee_is_active(phy, NULL) <= 0)
>  		return 0;

genphy_c45_eee_is_active() is a function which could be considered
phylib internal. At least, it currently has no users outside of the
phylib core.

b53 uses phylink not phylib, so i actually think it would be better to
convert it to the phylink way to do EEE, rather than make use of a
phylib helper.

	Andrew

	

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] net: dsa: b53: use genphy_c45_eee_is_active directly, instead of phy_init_eee
  2025-03-11 12:41 ` Andrew Lunn
@ 2025-03-11 13:05   ` Heiner Kallweit
  0 siblings, 0 replies; 3+ messages in thread
From: Heiner Kallweit @ 2025-03-11 13:05 UTC (permalink / raw)
  To: Andrew Lunn
  Cc: Florian Fainelli, Vladimir Oltean, David Miller, Eric Dumazet,
	Paolo Abeni, Jakub Kicinski, netdev@vger.kernel.org

On 11.03.2025 13:41, Andrew Lunn wrote:
> On Tue, Mar 11, 2025 at 07:39:33AM +0100, Heiner Kallweit wrote:
>> Use genphy_c45_eee_is_active directly instead of phy_init_eee,
>> this prepares for removing phy_init_eee. With the second
>> argument being Null, phy_init_eee doesn't initialize anything.
>>
>> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
>> ---
>>  drivers/net/dsa/b53/b53_common.c | 5 +----
>>  1 file changed, 1 insertion(+), 4 deletions(-)
>>
>> diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_common.c
>> index 61d164ffb..17e3ead16 100644
>> --- a/drivers/net/dsa/b53/b53_common.c
>> +++ b/drivers/net/dsa/b53/b53_common.c
>> @@ -2212,10 +2212,7 @@ EXPORT_SYMBOL(b53_mirror_del);
>>   */
>>  int b53_eee_init(struct dsa_switch *ds, int port, struct phy_device *phy)
>>  {
>> -	int ret;
>> -
>> -	ret = phy_init_eee(phy, false);
>> -	if (ret)
>> +	if (!phy->drv || genphy_c45_eee_is_active(phy, NULL) <= 0)
>>  		return 0;
> 
> genphy_c45_eee_is_active() is a function which could be considered
> phylib internal. At least, it currently has no users outside of the
> phylib core.
> 
> b53 uses phylink not phylib, so i actually think it would be better to
> convert it to the phylink way to do EEE, rather than make use of a
> phylib helper.
> 
Right, this would be a more comprehensive approach.

> 	Andrew
> 
> 	

--
pw-bot: cr


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-03-11 13:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-11  6:39 [PATCH net-next] net: dsa: b53: use genphy_c45_eee_is_active directly, instead of phy_init_eee Heiner Kallweit
2025-03-11 12:41 ` Andrew Lunn
2025-03-11 13:05   ` Heiner Kallweit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).