Skip to content

Commit ec63670

Browse files
committed
Merge branch 'fix-aqr-pma-capabilities'
Abhishek Chauhan says: ==================== Fix AQR PMA capabilities Patch 1:- AQR115c reports incorrect PMA capabilities which includes 10G/5G and also incorrectly disables capabilities like autoneg and 10Mbps support. AQR115c as per the Marvell databook supports speeds up to 2.5Gbps with autonegotiation. Patch 2:- Remove the use of phy_set_max_speed in phy driver as the function is mainly used in MAC driver to set the max speed. Instead use get_features to fix up Phy PMA capabilities for AQR111, AQR111B0, AQR114C and AQCS109 ==================== Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents 55e8024 + 8f61d73 commit ec63670

File tree

1 file changed

+33
-18
lines changed

1 file changed

+33
-18
lines changed

drivers/net/phy/aquantia/aquantia_main.c

Lines changed: 33 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -537,12 +537,6 @@ static int aqcs109_config_init(struct phy_device *phydev)
537537
if (!ret)
538538
aqr107_chip_info(phydev);
539539

540-
/* AQCS109 belongs to a chip family partially supporting 10G and 5G.
541-
* PMA speed ability bits are the same for all members of the family,
542-
* AQCS109 however supports speeds up to 2.5G only.
543-
*/
544-
phy_set_max_speed(phydev, SPEED_2500);
545-
546540
return aqr107_set_downshift(phydev, MDIO_AN_VEND_PROV_DOWNSHIFT_DFLT);
547541
}
548542

@@ -731,6 +725,31 @@ static int aqr113c_fill_interface_modes(struct phy_device *phydev)
731725
return aqr107_fill_interface_modes(phydev);
732726
}
733727

728+
static int aqr115c_get_features(struct phy_device *phydev)
729+
{
730+
unsigned long *supported = phydev->supported;
731+
732+
/* PHY supports speeds up to 2.5G with autoneg. PMA capabilities
733+
* are not useful.
734+
*/
735+
linkmode_or(supported, supported, phy_gbit_features);
736+
linkmode_set_bit(ETHTOOL_LINK_MODE_2500baseT_Full_BIT, supported);
737+
738+
return 0;
739+
}
740+
741+
static int aqr111_get_features(struct phy_device *phydev)
742+
{
743+
/* PHY supports speeds up to 5G with autoneg. PMA capabilities
744+
* are not useful.
745+
*/
746+
aqr115c_get_features(phydev);
747+
linkmode_set_bit(ETHTOOL_LINK_MODE_5000baseT_Full_BIT,
748+
phydev->supported);
749+
750+
return 0;
751+
}
752+
734753
static int aqr113c_config_init(struct phy_device *phydev)
735754
{
736755
int ret;
@@ -767,15 +786,6 @@ static int aqr107_probe(struct phy_device *phydev)
767786
return aqr_hwmon_probe(phydev);
768787
}
769788

770-
static int aqr111_config_init(struct phy_device *phydev)
771-
{
772-
/* AQR111 reports supporting speed up to 10G,
773-
* however only speeds up to 5G are supported.
774-
*/
775-
phy_set_max_speed(phydev, SPEED_5000);
776-
777-
return aqr107_config_init(phydev);
778-
}
779789

780790
static struct phy_driver aqr_driver[] = {
781791
{
@@ -853,6 +863,7 @@ static struct phy_driver aqr_driver[] = {
853863
.get_sset_count = aqr107_get_sset_count,
854864
.get_strings = aqr107_get_strings,
855865
.get_stats = aqr107_get_stats,
866+
.get_features = aqr115c_get_features,
856867
.link_change_notify = aqr107_link_change_notify,
857868
.led_brightness_set = aqr_phy_led_brightness_set,
858869
.led_hw_is_supported = aqr_phy_led_hw_is_supported,
@@ -865,7 +876,7 @@ static struct phy_driver aqr_driver[] = {
865876
.name = "Aquantia AQR111",
866877
.probe = aqr107_probe,
867878
.get_rate_matching = aqr107_get_rate_matching,
868-
.config_init = aqr111_config_init,
879+
.config_init = aqr107_config_init,
869880
.config_aneg = aqr_config_aneg,
870881
.config_intr = aqr_config_intr,
871882
.handle_interrupt = aqr_handle_interrupt,
@@ -877,6 +888,7 @@ static struct phy_driver aqr_driver[] = {
877888
.get_sset_count = aqr107_get_sset_count,
878889
.get_strings = aqr107_get_strings,
879890
.get_stats = aqr107_get_stats,
891+
.get_features = aqr111_get_features,
880892
.link_change_notify = aqr107_link_change_notify,
881893
.led_brightness_set = aqr_phy_led_brightness_set,
882894
.led_hw_is_supported = aqr_phy_led_hw_is_supported,
@@ -889,7 +901,7 @@ static struct phy_driver aqr_driver[] = {
889901
.name = "Aquantia AQR111B0",
890902
.probe = aqr107_probe,
891903
.get_rate_matching = aqr107_get_rate_matching,
892-
.config_init = aqr111_config_init,
904+
.config_init = aqr107_config_init,
893905
.config_aneg = aqr_config_aneg,
894906
.config_intr = aqr_config_intr,
895907
.handle_interrupt = aqr_handle_interrupt,
@@ -901,6 +913,7 @@ static struct phy_driver aqr_driver[] = {
901913
.get_sset_count = aqr107_get_sset_count,
902914
.get_strings = aqr107_get_strings,
903915
.get_stats = aqr107_get_stats,
916+
.get_features = aqr111_get_features,
904917
.link_change_notify = aqr107_link_change_notify,
905918
.led_brightness_set = aqr_phy_led_brightness_set,
906919
.led_hw_is_supported = aqr_phy_led_hw_is_supported,
@@ -1010,7 +1023,7 @@ static struct phy_driver aqr_driver[] = {
10101023
.name = "Aquantia AQR114C",
10111024
.probe = aqr107_probe,
10121025
.get_rate_matching = aqr107_get_rate_matching,
1013-
.config_init = aqr111_config_init,
1026+
.config_init = aqr107_config_init,
10141027
.config_aneg = aqr_config_aneg,
10151028
.config_intr = aqr_config_intr,
10161029
.handle_interrupt = aqr_handle_interrupt,
@@ -1022,6 +1035,7 @@ static struct phy_driver aqr_driver[] = {
10221035
.get_sset_count = aqr107_get_sset_count,
10231036
.get_strings = aqr107_get_strings,
10241037
.get_stats = aqr107_get_stats,
1038+
.get_features = aqr111_get_features,
10251039
.link_change_notify = aqr107_link_change_notify,
10261040
.led_brightness_set = aqr_phy_led_brightness_set,
10271041
.led_hw_is_supported = aqr_phy_led_hw_is_supported,
@@ -1046,6 +1060,7 @@ static struct phy_driver aqr_driver[] = {
10461060
.get_sset_count = aqr107_get_sset_count,
10471061
.get_strings = aqr107_get_strings,
10481062
.get_stats = aqr107_get_stats,
1063+
.get_features = aqr115c_get_features,
10491064
.link_change_notify = aqr107_link_change_notify,
10501065
.led_brightness_set = aqr_phy_led_brightness_set,
10511066
.led_hw_is_supported = aqr_phy_led_hw_is_supported,

0 commit comments

Comments
 (0)