net: phy: disable EEE on TI PHYs
Subsystems (3)
Russell King (Oracle)
reviewercover net: phy: disable EEE on TI PHYs
Hi,
Towards the end of October, we discussed EEE on TI PHYs which seems to cause problems with the stmmac hardware. This problem was never fully diagnosed, but it was identified that TI PHYs do not support LPI signalling, but report that EEE is supported, and they implement the advertisement registers and that functionality.
This series allows PHY drivers to disable EEE support.
drivers/net/phy/dp83822.c | 3 +++ drivers/net/phy/dp83867.c | 1 + drivers/net/phy/dp83869.c | 1 + drivers/net/phy/dp83tc811.c | 1 + drivers/net/phy/phy-core.c | 2 -- drivers/net/phy/phy_device.c | 34 ++++++++++++++++++++++++++++++---- include/linux/phy.h | 1 + 7 files changed, 37 insertions(+), 6 deletions(-)
Signature · 2 lines
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
PATCH 1/2 net: phy: allow drivers to disable EEE support via .get_features()
Allow PHY drivers to hook the .get_features() method to disable EEE support. This is useful for TI PHYs, where we have a statement that none of their gigabit products support EEE, yet at least DP83867 reports EEE capabilties and implements EEE negotiation.
--- drivers/net/phy/phy-core.c | 2 -- drivers/net/phy/phy_device.c | 34 ++++++++++++++++++++++++++++++---- include/linux/phy.h | 1 + 3 files changed, 31 insertions(+), 6 deletions(-)
drivers/net/phy/phy-core.c +0 -2
@@ -207,8 +207,6 @@ void of_set_phy_eee_broken(struct phy_device *phydev)if (!IS_ENABLED (CONFIG_OF_MDIO ) || !node)return ; -linkmode_zero (modes); -if (of_property_read_bool (node,"eee-broken-100tx" ))linkmode_set_bit (ETHTOOL_LINK_MODE_100baseT_Full_BIT, modes);if (of_property_read_bool (node,"eee-broken-1000t" ))
drivers/net/phy/phy_device.c +30 -4
@@ -3397,6 +3397,34 @@ struct fwnode_handle *fwnode_get_phy_node(const struct fwnode_handle *fwnode) }EXPORT_SYMBOL_GPL (fwnode_get_phy_node); +static int phy_get_features (struct phy_device *phydev) +{ +int err; + +if (phydev->is_c45) + err =genphy_c45_pma_read_abilities (phydev); +else + err =genphy_read_abilities (phydev); + +return err; +} + +/** +* phy_get_Features_no_eee - read the PHY features, disabling all EEE +* @phydev: phy_device structure to be added to the MDIO bus +* +* Read the PHY features, and fill the @phydev->eee_disabled_modes to +* prevent EEE being used. This is intended to be used for PHY .get_feature +* methods where a PHY reports incorrect capabilities. +*/ +int phy_get_features_no_eee (struct phy_device *phydev) +{ +linkmode_fill (phydev->eee_disabled_modes); + +return phy_get_features (phydev); +} +EXPORT_SYMBOL_GPL (phy_get_features_no_eee); +/** * phy_probe - probe and init a PHY device * @dev: device to probe and init
@@ -3442,10 +3470,8 @@ static int phy_probe(struct device *dev) }else if (phydrv->get_features) err = phydrv->get_features (phydev); -else if (phydev->is_c45) - err =genphy_c45_pma_read_abilities (phydev); -else - err =genphy_read_abilities (phydev); +else + err =phy_get_features (phydev);if (err) goto out;
include/linux/phy.h +1 -0
@@ -2299,6 +2299,7 @@ void phy_support_sym_pause(struct phy_device *phydev);void phy_support_asym_pause (struct phy_device *phydev);void phy_support_eee (struct phy_device *phydev);void phy_disable_eee (struct phy_device *phydev); +int phy_get_features_no_eee (struct phy_device *phydev);void phy_set_sym_pause (struct phy_device *phydev,bool rx,bool tx,bool autoneg);void phy_set_asym_pause (struct phy_device *phydev,bool rx,bool tx);
Signature · 1 line
2.47.3
PATCH 2/2 net: phy: TI PHYs use phy_get_features_no_eee()
In reply to Russell King (Oracle)As TI Gigabit PHYs do not support EEE, use the newly introduced phy_get_features_no_eee() to read the features but mark EEE as disabled.
--- drivers/net/phy/dp83822.c | 3 +++ drivers/net/phy/dp83867.c | 1 + drivers/net/phy/dp83869.c | 1 + drivers/net/phy/dp83tc811.c | 1 + 4 files changed, 6 insertions(+)
drivers/net/phy/dp83822.c +3 -0
@@ -1160,6 +1160,7 @@ static int dp83822_led_hw_control_get(struct phy_device *phydev, u8 index, .name = (_name), \/* PHY_BASIC_FEATURES */ \ .probe = dp83822_probe, \ + .get_features = phy_get_features_no_eee, \ .soft_reset = dp83822_phy_reset, \ .config_init = dp83822_config_init, \ .read_status = dp83822_read_status, \
@@ -1180,6 +1181,7 @@ static int dp83822_led_hw_control_get(struct phy_device *phydev, u8 index, .name = (_name), \/* PHY_BASIC_FEATURES */ \ .probe = dp8382x_probe, \ + .get_features = phy_get_features_no_eee, \ .soft_reset = dp83822_phy_reset, \ .config_init = dp83825_config_init, \ .get_wol = dp83822_get_wol, \
@@ -1196,6 +1198,7 @@ static int dp83822_led_hw_control_get(struct phy_device *phydev, u8 index, .name = (_name), \/* PHY_BASIC_FEATURES */ \ .probe = dp83826_probe, \ + .get_features = phy_get_features_no_eee, \ .soft_reset = dp83822_phy_reset, \ .config_init = dp83826_config_init, \ .get_wol = dp83822_get_wol, \
drivers/net/phy/dp83867.c +1 -0
@@ -1124,6 +1124,7 @@ static struct phy_driver dp83867_driver[] = {/* PHY_GBIT_FEATURES */ .probe = dp83867_probe, + .get_features = phy_get_features_no_eee, .config_init = dp83867_config_init, .soft_reset = dp83867_phy_reset,
drivers/net/phy/dp83869.c +1 -0
@@ -906,6 +906,7 @@ static int dp83869_phy_reset(struct phy_device *phydev)PHY_ID_MATCH_MODEL (_id), \ .name = (_name), \ .probe = dp83869_probe, \ + .get_features = phy_get_features_no_eee, \ .config_init = dp83869_config_init, \ .soft_reset = dp83869_phy_reset, \ .config_intr = dp83869_config_intr, \
drivers/net/phy/dp83tc811.c +1 -0
@@ -390,6 +390,7 @@ static struct phy_driver dp83811_driver[] = { .phy_id_mask = 0xfffffff0, .name = "TI DP83TC811",/* PHY_BASIC_FEATURES */ + .get_features = phy_get_features_no_eee, .config_init = dp83811_config_init, .config_aneg = dp83811_config_aneg, .soft_reset = dp83811_phy_reset,
Signature · 1 line
2.47.3
Re: [PATCH net-next 1/2] net: phy: allow drivers to disable EEE support via .get_features()
In reply to Russell King (Oracle)Quoted 8 lines · Russell King (Oracle)
Allow PHY drivers to hook the .get_features() method to disable EEE support. This is useful for TI PHYs, where we have a statement that none of their gigabit products support EEE, yet at least DP83867 reports EEE capabilties and implements EEE negotiation.
Signed-off-by Russell King (Oracle) <[email protected]>+/**
+ *phy_get_Features_no_eee- read the PHY features, disabling all EEE
s/phy_get_Features_no_eee/phy_get_features_no_eee
Otherwise looks good.
Thank you.
Signature · 4 lines
Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
Re: [PATCH net-next 2/2] net: phy: TI PHYs use phy_get_features_no_eee()
In reply to Russell King (Oracle)Quoted 33 lines · Russell King (Oracle)
As TI Gigabit PHYs do not support EEE, use the newly introduced
phy_get_features_no_eee()to read the features but mark EEE as disabled.Signed-off-by Russell King (Oracle) <[email protected]>--- drivers/net/phy/dp83822.c | 3 +++ drivers/net/phy/dp83867.c | 1 + drivers/net/phy/dp83869.c | 1 + drivers/net/phy/dp83tc811.c | 1 + 4 files changed, 6 insertions(+)drivers/net/phy/dp83822.c +2
-0@@ -1160,6 +1160,7 @@ static int dp83822_led_hw_control_get(struct phy_device *phydev, u8 index, .name = (_name), \/* PHY_BASIC_FEATURES */ \ .probe = dp83822_probe, \ + .get_features = phy_get_features_no_eee, \ .soft_reset = dp83822_phy_reset, \ .config_init = dp83822_config_init, \ .read_status = dp83822_read_status, \@@ -1180,6 +1181,7 @@ static int dp83822_led_hw_control_get(struct phy_device *phydev, u8 index, .name = (_name), \/* PHY_BASIC_FEATURES */ \ .probe = dp8382x_probe, \ + .get_features = phy_get_features_no_eee, \ .soft_reset = dp83822_phy_reset, \ .config_init = dp83825_config_init, \ .get_wol = dp83822_get_wol, \
drivers/net/phy/dp83822.c static int dp83822_led_hw_control_get(struct phy_device *phydev, u8 index, · line 1204
Quoted 7 lines
drivers/net/phy/dp83822.c +1
-0@@ -1196,6 +1198,7 @@ static int dp83822_led_hw_control_get(struct phy_device *phydev, u8 index, .name = (_name), \/* PHY_BASIC_FEATURES */ \ .probe = dp83826_probe, \ + .get_features = phy_get_features_no_eee, \ .soft_reset = dp83822_phy_reset, \ .config_init = dp83826_config_init, \ .get_wol = dp83822_get_wol, \
The DP83822/25/26 are all 100 Mbit variants. They all officially claim EEE support. Maybe it is too early to give up here?
drivers/net/phy/dp83867.c static struct phy_driver dp83867_driver[] = { · line 1129
Quoted 11 lines
drivers/net/phy/dp83867.c +1
-0@@ -1124,6 +1124,7 @@ static struct phy_driver dp83867_driver[] = {/* PHY_GBIT_FEATURES */ .probe = dp83867_probe, + .get_features = phy_get_features_no_eee, .config_init = dp83867_config_init, .soft_reset = dp83867_phy_reset,
ACK
drivers/net/phy/dp83869.c static int dp83869_phy_reset(struct phy_device *phydev) · line 912
Quoted 12 lines
drivers/net/phy/dp83869.c +1
-0@@ -906,6 +906,7 @@ static int dp83869_phy_reset(struct phy_device *phydev)PHY_ID_MATCH_MODEL (_id), \ .name = (_name), \ .probe = dp83869_probe, \ + .get_features = phy_get_features_no_eee, \ .config_init = dp83869_config_init, \ .soft_reset = dp83869_phy_reset, \ .config_intr = dp83869_config_intr, \
ACK
drivers/net/phy/dp83tc811.c static struct phy_driver dp83811_driver[] = { · line 396
Quoted 12 lines
drivers/net/phy/dp83tc811.c +1
-0@@ -390,6 +390,7 @@ static struct phy_driver dp83811_driver[] = { .phy_id_mask = 0xfffffff0, .name = "TI DP83TC811",/* PHY_BASIC_FEATURES */ + .get_features = phy_get_features_no_eee, .config_init = dp83811_config_init, .config_aneg = dp83811_config_aneg, .soft_reset = dp83811_phy_reset,
Not sure about this one. It is 100BaseT1 without autoneg support.
Signature · 4 lines
Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
Russell King (Oracle)
reviewerRe: [PATCH net-next 2/2] net: phy: TI PHYs use phy_get_features_no_eee()
Quoted 6 lines · Oleksij Rempel
Quoted 5 lines · Russell King (Oracle)
As TI Gigabit PHYs do not support EEE, use the newly introduced
phy_get_features_no_eee()to read the features but mark EEE as disabled.Signed-off-by Russell King (Oracle) <[email protected]>
...
Quoted 11 lines
drivers/net/phy/dp83822.c static int dp83822_led_hw_control_get(struct phy_device *phydev, u8 index, · line 1204
Quoted 8 lines
drivers/net/phy/dp83822.c +1
-0@@ -1196,6 +1198,7 @@ static int dp83822_led_hw_control_get(struct phy_device *phydev, u8 index, .name = (_name), \/* PHY_BASIC_FEATURES */ \ .probe = dp83826_probe, \ + .get_features = phy_get_features_no_eee, \ .soft_reset = dp83822_phy_reset, \ .config_init = dp83826_config_init, \ .get_wol = dp83822_get_wol, \The DP83822/25/26 are all 100 Mbit variants. They all officially claim EEE support. Maybe it is too early to give up here?
This is going to be horrid to guarantee getting the correct entry in the patch - I *absolutely* hate this driver struct array. Please provide a diff to be squashed into the patch.
Thanks.
Signature · 2 lines
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
PATCH 1/1 net: dp83822/dp83tc811: do not blacklist EEE for now
dp83822 driver is supporting DP83822/25/26 PHYs, which are all 100Mbit variants. TI support forum says - only 1Gbit variants are broken.
dp83tc811 driver is supporting 1000BaseT1 SPE variant, which do not has autoneg support towards MDI.
Note: dp83tc811 wires phydev->autoneg to control SGMII autoneg, which can't be proper decision. But it is a different issue.
--- drivers/net/phy/dp83822.c | 3 --- drivers/net/phy/dp83tc811.c | 1 - 2 files changed, 4 deletions(-)
drivers/net/phy/dp83822.c +0 -3
@@ -1160,7 +1160,6 @@ static int dp83822_led_hw_control_get(struct phy_device *phydev, u8 index, .name = (_name), \/* PHY_BASIC_FEATURES */ \ .probe = dp83822_probe, \ - .get_features = phy_get_features_no_eee, \ .soft_reset = dp83822_phy_reset, \ .config_init = dp83822_config_init, \ .read_status = dp83822_read_status, \
@@ -1181,7 +1180,6 @@ static int dp83822_led_hw_control_get(struct phy_device *phydev, u8 index, .name = (_name), \/* PHY_BASIC_FEATURES */ \ .probe = dp8382x_probe, \ - .get_features = phy_get_features_no_eee, \ .soft_reset = dp83822_phy_reset, \ .config_init = dp83825_config_init, \ .get_wol = dp83822_get_wol, \
@@ -1198,7 +1196,6 @@ static int dp83822_led_hw_control_get(struct phy_device *phydev, u8 index, .name = (_name), \/* PHY_BASIC_FEATURES */ \ .probe = dp83826_probe, \ - .get_features = phy_get_features_no_eee, \ .soft_reset = dp83822_phy_reset, \ .config_init = dp83826_config_init, \ .get_wol = dp83822_get_wol, \
drivers/net/phy/dp83tc811.c +0 -1
@@ -390,7 +390,6 @@ static struct phy_driver dp83811_driver[] = { .phy_id_mask = 0xfffffff0, .name = "TI DP83TC811",/* PHY_BASIC_FEATURES */ - .get_features = phy_get_features_no_eee, .config_init = dp83811_config_init, .config_aneg = dp83811_config_aneg, .soft_reset = dp83811_phy_reset,
Signature · 1 line
2.47.3
Russell King (Oracle)
reviewerRe: [PATCH] net: dp83822/dp83tc811: do not blacklist EEE for now
Quoted 2 lines · Oleksij Rempel
Note: dp83tc811 wires
phydev->autonegto control SGMII autoneg, which can't be proper decision. But it is a different issue.
Yep, that is just wrong. You didn't state whether you are happy with my plan to squash this into my patch. What would you like to happen with authorship etc?
Signature · 2 lines
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
Oleksij Rempel
Reviewed-byRe: [PATCH] net: dp83822/dp83tc811: do not blacklist EEE for now
Quoted 7 lines · Russell King (Oracle)
Quoted 2 lines · Oleksij Rempel
Note: dp83tc811 wires
phydev->autonegto control SGMII autoneg, which can't be proper decision. But it is a different issue.Yep, that is just wrong. You didn't state whether you are happy with my plan to squash this into my patch. What would you like to happen with authorship etc?
Just squash it and add my:
Thank you!
Signature · 4 lines
Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |