All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC] net: dsa: slave: Advertise correct EEE capabilities at slave PHY setup
@ 2023-05-30 12:26 Lukasz Majewski
  2023-05-30 12:59 ` Russell King (Oracle)
  2023-05-30 13:17 ` Andrew Lunn
  0 siblings, 2 replies; 21+ messages in thread
From: Lukasz Majewski @ 2023-05-30 12:26 UTC (permalink / raw)
  To: Andrew Lunn, Russell King
  Cc: Vivien Didelot, Florian Fainelli, Vladimir Oltean,
	David S. Miller, Jakub Kicinski, netdev, linux-kernel,
	Lukasz Majewski

One can disable in device tree advertising of EEE capabilities of PHY
when 'eee-broken-100tx' property is present in DTS.

With DSA switch it also may happen that one would need to disable EEE due
to some network issues.

Corresponding switch DTS description:

 switch@0 {
	 ports {
		port@0 {
		reg = <0>;
		label = "lan1";
		phy-handle = <&switchphy0>;
		};
	}
	mdio {
		switchphy0: switchphy@0 {
		reg = <0>;
		eee-broken-100tx;
	};
	};

This patch adjusts the content of MDIO_AN_EEE_ADV in MDIO_MMD_AN "device"
so the phydev->eee_broken_modes are taken into account from the start of
the slave PHYs.

As a result the 'ethtool --show-eee lan1' shows that EEE is not supported
from the outset.

Questions:

- Is the genphy_config_eee_advert() appropriate to be used here?
  As I found this issue on 5.15 kernel, it looks like mainline now uses
  PHY features for handle EEE (but the aforementioned function is still
  present in newest mainline - v6.4-rc1).

- I've also observed strange behaviour for EEE capability register:
  Why the value in MDIO_MMD_PCS device; reg MDIO_PCS_EEE_ABLE is somewhat
  "volatile" - in a sense that when I use:
  ethtool --set-eee lan2 eee off

  It is cleared by PHY itself to 0x0 (from 0x2) and turning it on again is
  not working.

  Is this expected? Or am I missing something?



Signed-off-by: Lukasz Majewski <lukma@denx.de>
---
 net/dsa/slave.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/dsa/slave.c b/net/dsa/slave.c
index 353d8fff3166..712923c7d4e2 100644
--- a/net/dsa/slave.c
+++ b/net/dsa/slave.c
@@ -2247,6 +2247,7 @@ static int dsa_slave_phy_setup(struct net_device *slave_dev)
 		phylink_destroy(dp->pl);
 	}
 
+	genphy_config_eee_advert(slave_dev->phydev);
 	return ret;
 }
 
-- 
2.37.3


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

end of thread, other threads:[~2023-05-31 12:58 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-30 12:26 [RFC] net: dsa: slave: Advertise correct EEE capabilities at slave PHY setup Lukasz Majewski
2023-05-30 12:59 ` Russell King (Oracle)
2023-05-30 14:07   ` Lukasz Majewski
2023-05-30 14:22     ` Russell King (Oracle)
2023-05-30 14:26       ` Andrew Lunn
2023-05-30 14:41         ` Russell King (Oracle)
2023-05-31  8:16           ` Lukasz Majewski
2023-05-31  8:37             ` Russell King (Oracle)
2023-05-30 14:47         ` Lukasz Majewski
2023-05-30 15:08           ` Russell King (Oracle)
2023-05-31  8:43             ` Lukasz Majewski
2023-05-31 12:56               ` Andrew Lunn
2023-05-30 14:57       ` Lukasz Majewski
2023-05-30 14:23     ` Andrew Lunn
2023-05-30 14:40       ` Lukasz Majewski
2023-05-30 17:15         ` Andrew Lunn
2023-05-31  8:44           ` Lukasz Majewski
2023-05-30 13:17 ` Andrew Lunn
2023-05-30 13:40   ` Lukasz Majewski
2023-05-31  8:12     ` Oleksij Rempel
2023-05-31  9:31       ` Lukasz Majewski

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.