Re: [PATCH net v3 1/2] net: phy: aquantia: AQR115c fix up PMA capabilities
From: Abhishek Chauhan (ABC)
Date: Thu Sep 26 2024 - 20:18:30 EST
On 9/25/2024 11:42 PM, Maxime Chevallier wrote:
> Hello,
>
> On Wed, 25 Sep 2024 16:01:28 -0700
> Abhishek Chauhan <quic_abchauha@xxxxxxxxxxx> wrote:
>
>> 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.
>>
>> Fixes: 0ebc581f8a4b ("net: phy: aquantia: add support for aqr115c")
>> Link: https://lore.kernel.org/all/20240913011635.1286027-1-quic_abchauha@xxxxxxxxxxx/T/
>> Signed-off-by: Abhishek Chauhan <quic_abchauha@xxxxxxxxxxx>
>> ---
>
> [...]
>
>>
>> +static int aqr115c_get_features(struct phy_device *phydev)
>> +{
>> + int ret;
>> + __ETHTOOL_DECLARE_LINK_MODE_MASK(supported) = { 0, };
>> +
>> + /* Normal feature discovery */
>> + ret = genphy_c45_pma_read_abilities(phydev);
>> + if (ret)
>> + return ret;
>> +
>> + /* PHY FIXUP */
>> + /* Although the PHY sets bit 12.18.19.48, it does not support 5G/10G modes */
>> + linkmode_clear_bit(ETHTOOL_LINK_MODE_10000baseT_Full_BIT, phydev->supported);
>> + linkmode_clear_bit(ETHTOOL_LINK_MODE_10000baseKX4_Full_BIT, phydev->supported);
>> + linkmode_clear_bit(ETHTOOL_LINK_MODE_10000baseKR_Full_BIT, phydev->supported);
>> + linkmode_clear_bit(ETHTOOL_LINK_MODE_5000baseT_Full_BIT, phydev->supported);
>> +
>> + /* Phy supports Speeds up to 2.5G with Autoneg though the phy PMA says otherwise */
>> + linkmode_copy(supported, phy_gbit_features);
>> + linkmode_set_bit(ETHTOOL_LINK_MODE_2500baseX_Full_BIT, supported);
>
> I still think you shouldn't report 2500BaseX, as you mentionned
> it's a BaseT PHY. This is independent of the modes that the PHY uses to
> connect to the MAC. Although the PHY can talk to the MAC using
> 2500BaseX on its MII interface, it looks like it can't use
> 2500BaseX on its MDI (the LP side of the PHY). There's the same issue in
> patch 2.
>
I Agree with you. I did some experiments today without setting the 2500BaseX bit and i see
the link still comes up with 2.5Gbps with autoneg on.
I will rectify this as part of the next patch
Thanks Maxime
> Thanks,
>
> Maxime