at803x: Add quirk to disable SmartEEE
cover at803x: Add quirk to disable SmartEEE
SmartEEE, compatible with IEEE802.3az standard, is designed to include legacy MAC without EEE capability into the power saving system. SmartEEE is enabled by default configuration on AR8031 after power-on or hardware reset.
Unfortunately this is proved causing issues for certain hw configurations. We add a quirk to optionally disable SmartEEE.
PATCH 3/3 depends on https://patchwork.kernel.org/patch/10781297/
Carlo Caione (3):
net: phy: at803x: Introduce quirk to disable SmartEEE
dt-bindings: net: at803x: Document at803x,smarteee-disabled property
arm64: dts: imx8mq-evk: Disable SmartEEE
.../devicetree/bindings/net/at803x.txt | 18 +++++++++++++++ arch/arm64/boot/dts/freescale/imx8mq-evk.dts | 1 + drivers/net/phy/at803x.c | 22 +++++++++++++++++++ 3 files changed, 41 insertions(+) create mode 100644 Documentation/devicetree/bindings/net/at803x.txt
Signature · 1 line
2.19.1
PATCH 1/3 net: phy: at803x: Introduce quirk to disable SmartEEE
The proprietary SmartEEE mode makes the PHY entering a sleep mode after a configurable idle time. It does this without LPI signals coming from MAC.
Since this is a configurable behavior and it is known to cause issues add a way to disable it using a custom quirk.
--- drivers/net/phy/at803x.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+)
drivers/net/phy/at803x.c +22 -0
@@ -38,12 +38,14 @@#define AT803X_DEVICE_ADDR 0x03#define AT803X_LOC_MAC_ADDR_0_15_OFFSET 0x804C#define AT803X_LOC_MAC_ADDR_16_31_OFFSET 0x804B +#define AT803X_SMARTEEE_CTL3_OFFSET 0x805D#define AT803X_LOC_MAC_ADDR_32_47_OFFSET 0x804A#define AT803X_MMD_ACCESS_CONTROL 0x0D#define AT803X_MMD_ACCESS_CONTROL_DATA 0x0E#define AT803X_FUNC_DATA 0x4003#define AT803X_REG_CHIP_CONFIG 0x1f#define AT803X_BT_BX_REG_SEL 0x8000 +#define AT803X_SMARTEEE_DISABLED_VAL 0x1000#define AT803X_DEBUG_ADDR 0x1D#define AT803X_DEBUG_DATA 0x1E
@@ -65,12 +67,15 @@#define ATH8035_PHY_ID 0x004dd072#define AT803X_PHY_ID_MASK 0xffffffef +#define AT803X_SMARTEEE_FEATURE_DISABLE BIT(1) +MODULE_DESCRIPTION ("Atheros 803x PHY driver" );MODULE_AUTHOR ("Matus Ujhelyi" );MODULE_LICENSE ("GPL" );struct at803x_priv {bool phy_reset:1 ; +u32 quirks; };struct at803x_context {
@@ -210,6 +215,13 @@ static void at803x_get_wol(struct phy_device *phydev, wol->wolopts |=WAKE_MAGIC ; } +static int at803x_disable_smarteee (struct phy_device *phydev) +{ +return phy_write_mmd (phydev,AT803X_DEVICE_ADDR , +AT803X_SMARTEEE_CTL3_OFFSET , +AT803X_SMARTEEE_DISABLED_VAL ); +} +static int at803x_suspend (struct phy_device *phydev) {int value;
@@ -242,6 +254,9 @@ static int at803x_probe(struct phy_device *phydev)if (!priv)return -ENOMEM ; +if (of_property_read_bool (dev->of_node,"at803x,smarteee-disabled" )) + priv->quirks |=AT803X_SMARTEEE_FEATURE_DISABLE ; + phydev->priv = priv;return 0 ;
@@ -249,6 +264,7 @@ static int at803x_probe(struct phy_device *phydev)static int at803x_config_init (struct phy_device *phydev) { +struct at803x_priv *priv = phydev->priv;int ret; ret =genphy_config_init (phydev);
@@ -269,6 +285,12 @@ static int at803x_config_init(struct phy_device *phydev)return ret; } +if (priv->quirks &AT803X_SMARTEEE_FEATURE_DISABLE ) { + ret =at803x_disable_smarteee (phydev); +if (ret <0 ) +return ret; + } +return 0 ; }
Signature · 1 line
2.19.1
PATCH 2/3 dt-bindings: net: at803x: Document at803x, smarteee-disabled property
In reply to Carlo CaioneSmartEEE is a proprietary protocol that allows legacy MAC/SoC devices without 802.3az support to function as a complete 802.3az system.
This is know to cause issues so a new property is added to optionally disable this feature.
--- .../devicetree/bindings/net/at803x.txt | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 Documentation/devicetree/bindings/net/at803x.txt
Documentation/devicetree/bindings/net/at803x.txt new file +18 -0
@@ -0,0 +1,18 @@ +* Atheros AR803x Integrated 10/100/1000 Mbps Ethernet Transceiver + +Required properties: + - reg - The ID number for the phy, usually a small integer + +Optional property: + - at803x,smarteee-disabled: Disable SmartEEE feature + +Example: + + ethernet-phy@0 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <0>; + at803x,smarteee-disabled + }; + +Datasheet can be found: +https://media.digikey.com/pdf/Data%20Sheets/CSR%20PDFs/AR8031_DS_(Atheros)_Rev1.0_Aug2011.pdf
Signature · 1 line
2.19.1
Re: [PATCH 2/3] dt-bindings: net: at803x: Document at803x,smarteee-disabled property
Quoted 18 lines · Carlo Caione
SmartEEE is a proprietary protocol that allows legacy MAC/SoC devices without 802.3az support to function as a complete 802.3az system.
This is know to cause issues so a new property is added to optionally disable this feature.
Signed-off-by Carlo Caione <[email protected]>--- .../devicetree/bindings/net/at803x.txt | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 Documentation/devicetree/bindings/net/at803x.txtDocumentation/devicetree/bindings/net/at803x.txt new file +0
-0
Documentation/devicetree/bindings/net/at803x.txt line 7
Quoted 7 lines
Documentation/devicetree/bindings/net/at803x.txt new file +7
-0@@ -0,0 +1,18 @@ +* Atheros AR803x Integrated 10/100/1000 Mbps Ethernet Transceiver + +Required properties: + - reg - The ID number for the phy, usually a small integer + +Optional property: + - at803x,smarteee-disabled: Disable SmartEEE feature
Should this be named at803x,smarteee-broken instead of "disabled"? Because disabled is effectively what will happen after the driver looks up that property and acts on it, but this does not really describe the HW state unless there is appropriate software running.
Similar question to Heiner, how do SmartEEE and standard EEE relate to each other? Can we use the existing broken-eee properties?
Quoted 12 lines
Documentation/devicetree/bindings/net/at803x.txt new file +11
-0+ +Example: + + ethernet-phy@0 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <0>; + at803x,smarteee-disabled + }; + +Datasheet can be found: +https://media.digikey.com/pdf/Data%20Sheets/CSR%20PDFs/AR8031_DS_(Atheros)_Rev1.0_Aug2011.pdf
Signature · 1 line
Florian
PATCH 3/3 arm64: dts: imx8mq-evk: Disable SmartEEE
In reply to Carlo CaioneDisable SmartEEE mode (active by default) because this is known to cause issues on certain PHYs.
---
This patch depends on https://patchwork.kernel.org/patch/10781297/
--- arch/arm64/boot/dts/freescale/imx8mq-evk.dts | 1 + 1 file changed, 1 insertion(+)
arch/arm64/boot/dts/freescale/imx8mq-evk.dts +1 -0
@@ -48,6 +48,7 @@ ethphy0: ethernet-phy@0 { compatible = "ethernet-phy-ieee802.3-c22"; reg = <0>; + at803x,smarteee-disabled; }; }; };
Signature · 1 line
2.19.1
Russell King - ARM Linux admin
reviewerQuoted 7 lines · Carlo Caione
SmartEEE, compatible with IEEE802.3az standard, is designed to include legacy MAC without EEE capability into the power saving system. SmartEEE is enabled by default configuration on AR8031 after power-on or hardware reset.
Unfortunately this is proved causing issues for certain hw configurations. We add a quirk to optionally disable SmartEEE.
It may be a good idea to detail what "certain hw configurations" are and/or what the "issues" are, so it's easier to find this if/when others encounter the same issue.
Quoted 24 lines
PATCH 3/3 depends on https://patchwork.kernel.org/patch/10781297/
Carlo Caione (3):
net: phy: at803x: Introduce quirk to disable SmartEEE
dt-bindings: net: at803x: Document at803x,smarteee-disabled property
arm64: dts: imx8mq-evk: Disable SmartEEE.../devicetree/bindings/net/at803x.txt | 18 +++++++++++++++ arch/arm64/boot/dts/freescale/imx8mq-evk.dts | 1 + drivers/net/phy/at803x.c | 22 +++++++++++++++++++ 3 files changed, 41 insertions(+) create mode 100644 Documentation/devicetree/bindings/net/at803x.txtSignature · 7 lines
2.19.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Signature · 3 lines
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbps up According to speedtest.net: 11.9Mbps down 500kbps up
Heiner Kallweit
maintainerQuoted 6 lines · Russell King - ARM Linux admin
Quoted 5 lines · Carlo Caione
SmartEEE, compatible with IEEE802.3az standard, is designed to include legacy MAC without EEE capability into the power saving system. SmartEEE is enabled by default configuration on AR8031 after power-on or hardware reset.
Quoted 7 lines
Quoted 2 lines
Unfortunately this is proved causing issues for certain hw configurations. We add a quirk to optionally disable SmartEEE.
It may be a good idea to detail what "certain hw configurations" are and/or what the "issues" are, so it's easier to find this if/when others encounter the same issue.
Question would also be whether the issue with SmartEEE occurs also if EEE isn't advertized and therefore not active.
Then we could use the existing DT properties to flag broken EEE modes, see of_set_phy_eee_broken().
Quoted 25 lines
Quoted 24 lines
PATCH 3/3 depends on https://patchwork.kernel.org/patch/10781297/
Carlo Caione (3):
net: phy: at803x: Introduce quirk to disable SmartEEE
dt-bindings: net: at803x: Document at803x,smarteee-disabled property
arm64: dts: imx8mq-evk: Disable SmartEEE.../devicetree/bindings/net/at803x.txt | 18 +++++++++++++++ arch/arm64/boot/dts/freescale/imx8mq-evk.dts | 1 + drivers/net/phy/at803x.c | 22 +++++++++++++++++++ 3 files changed, 41 insertions(+) create mode 100644 Documentation/devicetree/bindings/net/at803x.txtSignature · 7 lines
2.19.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Quoted 6 lines · Russell King - ARM Linux admin
Quoted 5 lines · Carlo Caione
SmartEEE, compatible with IEEE802.3az standard, is designed to include legacy MAC without EEE capability into the power saving system. SmartEEE is enabled by default configuration on AR8031 after power-on or hardware reset.
Quoted 6 lines
Quoted 2 lines
Unfortunately this is proved causing issues for certain hw configurations. We add a quirk to optionally disable SmartEEE.
It may be a good idea to detail what "certain hw configurations" are and/or what the "issues" are, so it's easier to find this if/when others encounter the same issue.
This fix was upstreamed from the imx downstream kernel so I do not have much informations on that but something is reported in the U-Boot fix for the same problem at [0] so I'll add more info in the next revision.
Cheers,
[0] https://patchwork.ozlabs.org/patch/1015783/
Signature · 1 line
Carlo Caione
Heiner Kallweit
maintainerQuoted 14 lines · Carlo Caione
Quoted 6 lines · Russell King - ARM Linux admin
Quoted 5 lines · Carlo Caione
SmartEEE, compatible with IEEE802.3az standard, is designed to include legacy MAC without EEE capability into the power saving system. SmartEEE is enabled by default configuration on AR8031 after power-on or hardware reset.
Quoted 6 lines
Quoted 2 lines
Unfortunately this is proved causing issues for certain hw configurations. We add a quirk to optionally disable SmartEEE.
It may be a good idea to detail what "certain hw configurations" are and/or what the "issues" are, so it's easier to find this if/when others encounter the same issue.
Quoted 6 lines
This fix was upstreamed from the imx downstream kernel so I do not have much informations on that but something is reported in the U-Boot fix for the same problem at [0] so I'll add more info in the next revision.
Cheers,
Thanks for the link. According to the description SmartEEE works only if both link partners support it (hence are Atheros PHY's). I would assume that this usually isn't the case, shouldn't the feature be an opt-in therefore?
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Russell King - ARM Linux admin
reviewerQuoted 17 lines · Heiner Kallweit
Quoted 16 lines · Carlo Caione
Quoted 6 lines · Russell King - ARM Linux admin
Quoted 5 lines · Carlo Caione
SmartEEE, compatible with IEEE802.3az standard, is designed to include legacy MAC without EEE capability into the power saving system. SmartEEE is enabled by default configuration on AR8031 after power-on or hardware reset.
Quoted 6 lines
Quoted 2 lines
Unfortunately this is proved causing issues for certain hw configurations. We add a quirk to optionally disable SmartEEE.
It may be a good idea to detail what "certain hw configurations" are and/or what the "issues" are, so it's easier to find this if/when others encounter the same issue.
This fix was upstreamed from the imx downstream kernel so I do not have much informations on that but something is reported in the U-Boot fix for the same problem at [0] so I'll add more info in the next revision.
Quoted 8 lines
Quoted 4 lines
Cheers,
Thanks for the link. According to the description SmartEEE works only if both link partners support it (hence are Atheros PHY's). I would assume that this usually isn't the case, shouldn't the feature be an opt-in therefore?
I'm not convinced about that - I've been using AtherOS SmartEEE with i.MX6 for quite some time (I have patches which allow me to read out the stats via ethtool, and configure it - they're specific to the FEC driver though.) SmartEEE works just like EEE for me, and I notice no problems.
I have i.MX6 boards connected to Netgear GS116 and similar switches, and also Marvell DSA switches on other platforms.
This is why I said above about "more detail". Then maybe folk would know what to look for to see whether there is a problem.
Signature · 3 lines
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbps up According to speedtest.net: 11.9Mbps down 500kbps up
Heiner Kallweit
maintainerQuoted 33 lines · Russell King - ARM Linux admin
Quoted 17 lines · Heiner Kallweit
Quoted 16 lines · Carlo Caione
Quoted 6 lines · Russell King - ARM Linux admin
Quoted 5 lines · Carlo Caione
SmartEEE, compatible with IEEE802.3az standard, is designed to include legacy MAC without EEE capability into the power saving system. SmartEEE is enabled by default configuration on AR8031 after power-on or hardware reset.
Quoted 6 lines
Quoted 2 lines
Unfortunately this is proved causing issues for certain hw configurations. We add a quirk to optionally disable SmartEEE.
It may be a good idea to detail what "certain hw configurations" are and/or what the "issues" are, so it's easier to find this if/when others encounter the same issue.
This fix was upstreamed from the imx downstream kernel so I do not have much informations on that but something is reported in the U-Boot fix for the same problem at [0] so I'll add more info in the next revision.
Quoted 8 lines
Quoted 4 lines
Cheers,
Thanks for the link. According to the description SmartEEE works only if both link partners support it (hence are Atheros PHY's). I would assume that this usually isn't the case, shouldn't the feature be an opt-in therefore?
I'm not convinced about that - I've been using AtherOS SmartEEE with i.MX6 for quite some time (I have patches which allow me to read out the stats via ethtool, and configure it - they're specific to the FEC driver though.) SmartEEE works just like EEE for me, and I notice no problems.
Quoted 6 lines
I have i.MX6 boards connected to Netgear GS116 and similar switches, and also Marvell DSA switches on other platforms.
This is why I said above about "more detail". Then maybe folk would know what to look for to see whether there is a problem.
OK, then the description of the referenced patch isn't fully correct and SmartEEE and EEE are partially compatible, and the problem is just that we don't know exactly to which extent.
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
On 25/01/19 20:27, Heiner Kallweit wrote:
/cut
Quoted 14 lines
Quoted 14 lines
Quoted 4 lines
Thanks for the link. According to the description SmartEEE works only if both link partners support it (hence are Atheros PHY's). I would assume that this usually isn't the case, shouldn't the feature be an opt-in therefore?
I'm not convinced about that - I've been using AtherOS SmartEEE with i.MX6 for quite some time (I have patches which allow me to read out the stats via ethtool, and configure it - they're specific to the FEC driver though.) SmartEEE works just like EEE for me, and I notice no problems.
I have i.MX6 boards connected to Netgear GS116 and similar switches, and also Marvell DSA switches on other platforms.
Quoted 6 lines
Quoted 3 lines
This is why I said above about "more detail". Then maybe folk would know what to look for to see whether there is a problem.
OK, then the description of the referenced patch isn't fully correct and SmartEEE and EEE are partially compatible, and the problem is just that we don't know exactly to which extent.
Reading from the datasheet at [0] it seems that SmartEEE is compatible with EEE but it's something different.
With SmartEEE the PHY can actually enter LPI state even if this is not supported by the link partner since the LPI pattern is generated inside the PHY itself, so auto-implementing a sort of EEE.
So AFAICT EEE and SmartEEE are two different things requiring two different properties in the DTS if we want to have the possibility to disable it.
Cheers,
[0] https://media.digikey.com/pdf/Data%20Sheets/CSR%20PDFs/AR8031_DS_(Atheros)_Rev1.0_Aug2011.pdf
Signature · 1 line
Carlo Caione
Russell King - ARM Linux admin
reviewerQuoted 7 lines · Carlo Caione
Quoted 3 lines · Heiner Kallweit
OK, then the description of the referenced patch isn't fully correct and SmartEEE and EEE are partially compatible, and the problem is just that we don't know exactly to which extent.
Reading from the datasheet at [0] it seems that SmartEEE is compatible with EEE but it's something different.
As I understand it, SmartEEE is just like normal EEE as far as the link partner is concerned. The difference is between the PHY and MAC. What follows is a simplified understanding of the differences.
In conventional EEE, the MAC takes part in EEE - the local MAC requests that its attached PHY enters LPI mode, which signals to the link partner PHY that the data stream on the link is going to pause. When the local MAC wants to transmit, it first has to signal to the attached PHY that the link should be woken up, and the MAC has to wait for the link to exit LPI before transmitting.
With SmartEEE, the decision to enter LPI mode is taken not by the local MAC but by the PHY instead, since SmartEEE is designed to produce power savings for MACs that do not support LPI. Of course, they won't achieve the same power saving as real EEE, but they do help to reduce the power dissipation in the PHY.
PHYs that support this buffer some data from the MAC, and that buffering has to be sufficient for the delay in the link coming out of LPI mode without losing data.
As far as the link partner is concerned, EEE and SmartEEE appear the same.
Quoted 3 lines
With SmartEEE the PHY can actually enter LPI state even if this is not supported by the link partner since the LPI pattern is generated inside the PHY itself, so auto-implementing a sort of EEE.
It sounds to me like you have this the wrong way round. SmartEEE isn't about the link partner not supporting LPI, it's about the local MAC not supporting EEE, but still getting some power savings.
EEE (of either kind) can only be entered on the link when both the local PHY and remote PHY indicate support for EEE, and have negotiated that they support EEE.
Most of the power dissipation is from driving the signals into the network cable (which is a lossy environment) to ensure that the far end has sufficient signal to keep the link established. SmartEEE is about giving a way to enter 802.3az EEE mode on the _cable_ with a MAC that does not support EEE.
I've monitored the signals on a link with an Atheros AR8035 with SmartEEE mode enabled, and a Marvell 88e1514 PHY in a Marvell switch on the other end, and seen the signals on the cable quiesce as a result of SmartEEE, but only when _both_ partners are set to allow EEE in the negotiated link mode.
Signature · 3 lines
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbps up According to speedtest.net: 11.9Mbps down 500kbps up
Heiner Kallweit
maintainerQuoted 51 lines · Russell King - ARM Linux admin
Quoted 7 lines · Carlo Caione
Quoted 3 lines · Heiner Kallweit
OK, then the description of the referenced patch isn't fully correct and SmartEEE and EEE are partially compatible, and the problem is just that we don't know exactly to which extent.
Reading from the datasheet at [0] it seems that SmartEEE is compatible with EEE but it's something different.
As I understand it, SmartEEE is just like normal EEE as far as the link partner is concerned. The difference is between the PHY and MAC. What follows is a simplified understanding of the differences.
In conventional EEE, the MAC takes part in EEE - the local MAC requests that its attached PHY enters LPI mode, which signals to the link partner PHY that the data stream on the link is going to pause. When the local MAC wants to transmit, it first has to signal to the attached PHY that the link should be woken up, and the MAC has to wait for the link to exit LPI before transmitting.
With SmartEEE, the decision to enter LPI mode is taken not by the local MAC but by the PHY instead, since SmartEEE is designed to produce power savings for MACs that do not support LPI. Of course, they won't achieve the same power saving as real EEE, but they do help to reduce the power dissipation in the PHY.
PHYs that support this buffer some data from the MAC, and that buffering has to be sufficient for the delay in the link coming out of LPI mode without losing data.
As far as the link partner is concerned, EEE and SmartEEE appear the same.
Quoted 3 lines
With SmartEEE the PHY can actually enter LPI state even if this is not supported by the link partner since the LPI pattern is generated inside the PHY itself, so auto-implementing a sort of EEE.
It sounds to me like you have this the wrong way round. SmartEEE isn't about the link partner not supporting LPI, it's about the local MAC not supporting EEE, but still getting some power savings.
EEE (of either kind) can only be entered on the link when both the local PHY and remote PHY indicate support for EEE, and have negotiated that they support EEE.
Most of the power dissipation is from driving the signals into the network cable (which is a lossy environment) to ensure that the far end has sufficient signal to keep the link established. SmartEEE is about giving a way to enter 802.3az EEE mode on the _cable_ with a MAC that does not support EEE.
Quoted 6 lines
I've monitored the signals on a link with an Atheros AR8035 with SmartEEE mode enabled, and a Marvell 88e1514 PHY in a Marvell switch on the other end, and seen the signals on the cable quiesce as a result of SmartEEE, but only when _both_ partners are set to allow EEE in the negotiated link mode.
If SmartEEE is compatible with EEE on a PHY level, then I'd expect that advertisement of SmartEEE at different speeds can be controlled via the standard EEE MMD regs. Is this the case?
Russell King - ARM Linux admin
reviewerQuoted 59 lines · Heiner Kallweit
Quoted 51 lines · Russell King - ARM Linux admin
Quoted 7 lines · Carlo Caione
Quoted 3 lines · Heiner Kallweit
OK, then the description of the referenced patch isn't fully correct and SmartEEE and EEE are partially compatible, and the problem is just that we don't know exactly to which extent.
Reading from the datasheet at [0] it seems that SmartEEE is compatible with EEE but it's something different.
As I understand it, SmartEEE is just like normal EEE as far as the link partner is concerned. The difference is between the PHY and MAC. What follows is a simplified understanding of the differences.
In conventional EEE, the MAC takes part in EEE - the local MAC requests that its attached PHY enters LPI mode, which signals to the link partner PHY that the data stream on the link is going to pause. When the local MAC wants to transmit, it first has to signal to the attached PHY that the link should be woken up, and the MAC has to wait for the link to exit LPI before transmitting.
With SmartEEE, the decision to enter LPI mode is taken not by the local MAC but by the PHY instead, since SmartEEE is designed to produce power savings for MACs that do not support LPI. Of course, they won't achieve the same power saving as real EEE, but they do help to reduce the power dissipation in the PHY.
PHYs that support this buffer some data from the MAC, and that buffering has to be sufficient for the delay in the link coming out of LPI mode without losing data.
As far as the link partner is concerned, EEE and SmartEEE appear the same.
Quoted 3 lines
With SmartEEE the PHY can actually enter LPI state even if this is not supported by the link partner since the LPI pattern is generated inside the PHY itself, so auto-implementing a sort of EEE.
It sounds to me like you have this the wrong way round. SmartEEE isn't about the link partner not supporting LPI, it's about the local MAC not supporting EEE, but still getting some power savings.
EEE (of either kind) can only be entered on the link when both the local PHY and remote PHY indicate support for EEE, and have negotiated that they support EEE.
Most of the power dissipation is from driving the signals into the network cable (which is a lossy environment) to ensure that the far end has sufficient signal to keep the link established. SmartEEE is about giving a way to enter 802.3az EEE mode on the _cable_ with a MAC that does not support EEE.
Quoted 6 lines
I've monitored the signals on a link with an Atheros AR8035 with SmartEEE mode enabled, and a Marvell 88e1514 PHY in a Marvell switch on the other end, and seen the signals on the cable quiesce as a result of SmartEEE, but only when _both_ partners are set to allow EEE in the negotiated link mode.
Quoted 3 lines
If SmartEEE is compatible with EEE on a PHY level, then I'd expect that advertisement of SmartEEE at different speeds can be controlled via the standard EEE MMD regs. Is this the case?
There is no "advertisement of SmartEEE" - it's just EEE. That is because as far as the link partner is concerned, SmartEEE is just EEE.
Carlio posted a link to one of the datasheets for the family. In there, it describes the EEE capability register, which describes what is supported, and the EEE wake error counter register.
It also describes the EEE advertisement and link parter advertisement registers.
All these registers correspond to the 802.3 section 45 defined MMD and address offsets found in Clause 45 compliant PHYs, and these registers control not only EEE but also SmartEEE.
Please stop thinking that SmartEEE is different on the link partner side from EEE - as far as the link partner is concerned, there is no difference. The difference is all to do with the MAC side of the local PHY.
Signature · 3 lines
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbps up According to speedtest.net: 11.9Mbps down 500kbps up
On 28/01/2019 19:04, Russell King - ARM Linux admin wrote:
Hi Russell,
Quoted 11 lines
There is no "advertisement of SmartEEE" - it's just EEE. That is because as far as the link partner is concerned, SmartEEE is just EEE.
Carlio posted a link to one of the datasheets for the family. In there, it describes the EEE capability register, which describes what is supported, and the EEE wake error counter register.
It also describes the EEE advertisement and link parter advertisement registers.
Quoted 8 lines
All these registers correspond to the 802.3 section 45 defined MMD and address offsets found in Clause 45 compliant PHYs, and these registers control not only EEE but also SmartEEE.
Please stop thinking that SmartEEE is different on the link partner side from EEE - as far as the link partner is concerned, there is no difference. The difference is all to do with the MAC side of the local PHY.
Thank you for clarifying how the SmartEEE is really working.
Now, the problem is that the MMD registers controlling the EEE (7.3c and 7.3d, touched by the "eee-broken-*" property) are not the same as the ones for the SmartEEE (3.805b, 3.805c, 3.805d). So, is it worth to add a new DT property to deal also with the cases where we want to selectively disable the SmartEEE?
Thanks,
--
Carlo Caione
Russell King - ARM Linux admin
reviewerQuoted 24 lines · Carlo Caione
On 28/01/2019 19:04, Russell King - ARM Linux admin wrote:
Hi Russell,
Quoted 11 lines
There is no "advertisement of SmartEEE" - it's just EEE. That is because as far as the link partner is concerned, SmartEEE is just EEE.
Carlio posted a link to one of the datasheets for the family. In there, it describes the EEE capability register, which describes what is supported, and the EEE wake error counter register.
It also describes the EEE advertisement and link parter advertisement registers.
Quoted 8 lines
All these registers correspond to the 802.3 section 45 defined MMD and address offsets found in Clause 45 compliant PHYs, and these registers control not only EEE but also SmartEEE.
Please stop thinking that SmartEEE is different on the link partner side from EEE - as far as the link partner is concerned, there is no difference. The difference is all to do with the MAC side of the local PHY.
Quoted 7 lines
Thank you for clarifying how the SmartEEE is really working.
Now, the problem is that the MMD registers controlling the EEE (7.3c and 7.3d, touched by the "eee-broken-*" property) are not the same as the ones for the SmartEEE (3.805b, 3.805c, 3.805d). So, is it worth to add a new DT property to deal also with the cases where we want to selectively disable the SmartEEE?
That's because you're confusing what the registers are. Please take the time to read the data sheet for the AR803x devices, and the 802.3 specifications, and you will save yourself from asking a lot of questions by email.
7.3c (or 7.60 in decimal) is the EEE advertisement register. This is
what gets sent _to_ the link partner.
7.3d (or 7.61 in decimal) is the EEE link partner ability register.
This is what the link partner sent to us _from_ its own EEE advertisement register.
The eee-broken-* properties allow the EEE advertisement to be altered, thereby preventing EEE being negotiated for the various link modes. Disabling EEE for a particular link mode means that EEE (in any form) will not operate while the link is operating at that speed.
3.805b, 3.805c, 3.805d in the AR803x family are specifically to do with the SmartEEE implementation.
3.805b controls how much time between the link waking up and buffered
data already received from the MAC being sent.
3.805c controls the time from the last activity to entering low power
mode, additional bits in 3.805d.
3.805d contains the SmartEEE enable bit, as well as the additional bits
from 3.805c.
Most of these registers are only useful when you have a MAC that has no EEE functionality - that is where SmartEEE can be enabled to provide the power savings, and in order to implement EEE, there are various timeouts required by the protocol. SmartEEE allows these timeouts to be programmed via the above register.
When using a MAC that has EEE functionality, SmartEEE should be disabled via 3.805d to allow _full_ 802.3az EEE (from local MAC to link partner) to operate, rather than SmartEEE (from local PHY to link partner.)
Otherwise, using the existing "eee-broken-*" properties to disable the link modes where EEE fails would be the correct way forward, and should be used in preference to disabling SmartEEE.
However, no one has mentioned what the problem that is trying to be addressed. Is it data corruption? Is it that the link fails? Is it lost packets? Is it that the MAC supports EEE? I think there needs to be some better understanding of the problem at hand before trying to address it.
Signature · 3 lines
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbps up According to speedtest.net: 11.9Mbps down 500kbps up
Quoted 74 lines · Russell King - ARM Linux admin
Quoted 24 lines · Carlo Caione
On 28/01/2019 19:04, Russell King - ARM Linux admin wrote:
Hi Russell,
Quoted 11 lines
There is no "advertisement of SmartEEE" - it's just EEE. That is because as far as the link partner is concerned, SmartEEE is just EEE.
Carlio posted a link to one of the datasheets for the family. In there, it describes the EEE capability register, which describes what is supported, and the EEE wake error counter register.
It also describes the EEE advertisement and link parter advertisement registers.
Quoted 8 lines
All these registers correspond to the 802.3 section 45 defined MMD and address offsets found in Clause 45 compliant PHYs, and these registers control not only EEE but also SmartEEE.
Please stop thinking that SmartEEE is different on the link partner side from EEE - as far as the link partner is concerned, there is no difference. The difference is all to do with the MAC side of the local PHY.
Quoted 7 lines
Thank you for clarifying how the SmartEEE is really working.
Now, the problem is that the MMD registers controlling the EEE (7.3c and 7.3d, touched by the "eee-broken-*" property) are not the same as the ones for the SmartEEE (3.805b, 3.805c, 3.805d). So, is it worth to add a new DT property to deal also with the cases where we want to selectively disable the SmartEEE?
That's because you're confusing what the registers are. Please take the time to read the data sheet for the AR803x devices, and the 802.3 specifications, and you will save yourself from asking a lot of questions by email.
7.3c (or 7.60 in decimal) is the EEE advertisement register. This is
what gets sent _to_ the link partner.7.3d (or 7.61 in decimal) is the EEE link partner ability register.
This is what the link partner sent to us _from_ its own EEE advertisement register.The eee-broken-* properties allow the EEE advertisement to be altered, thereby preventing EEE being negotiated for the various link modes. Disabling EEE for a particular link mode means that EEE (in any form) will not operate while the link is operating at that speed.
3.805b, 3.805c, 3.805d in the AR803x family are specifically to do with the SmartEEE implementation.
3.805b controls how much time between the link waking up and buffered
data already received from the MAC being sent.
3.805c controls the time from the last activity to entering low power
mode, additional bits in 3.805d.
3.805d contains the SmartEEE enable bit, as well as the additional bits
from 3.805c.Most of these registers are only useful when you have a MAC that has no EEE functionality - that is where SmartEEE can be enabled to provide the power savings, and in order to implement EEE, there are various timeouts required by the protocol. SmartEEE allows these timeouts to be programmed via the above register.
When using a MAC that has EEE functionality, SmartEEE should be disabled via 3.805d to allow _full_ 802.3az EEE (from local MAC to link partner) to operate, rather than SmartEEE (from local PHY to link partner.)
Otherwise, using the existing "eee-broken-*" properties to disable the link modes where EEE fails would be the correct way forward, and should be used in preference to disabling SmartEEE.
Quoted 5 lines
However, no one has mentioned what the problem that is trying to be addressed. Is it data corruption? Is it that the link fails? Is it lost packets? Is it that the MAC supports EEE? I think there needs to be some better understanding of the problem at hand before trying to address it.
Hi Russell, Heiner, Carlo, Florian,
You could have copied me when referencing the U-boot patch.
It is indeed correct that disabling regular EEE advertisement does also disable SmartEEE. Somehow I hadn't taken this thought one step further to realize that the regular eee-broken-1000t DT binding is enough to take care of this.
In my case it was indeed a situation of packet loss when the PHY should have buffered it, and nobody debugged it to find the root cause. While true that the Layerscape MACs in general need to disable EEE advertisement, in this particular case I can't rule out an electrical issue on the PHY's voltage rails. This is especially plausible since the MDIO interface of this PHY needed some rework anyway, whereas the RGMII side presented no more packet loss after disabling the PHY's low power mode.
Thank you,
-Vladimir