Re: [PATCH net-next v3 2/3] net: phy: dp83td510: add cable testing support

From: Andrew Lunn
Date: Sat Jun 11 2022 - 11:12:20 EST


> + } else {
> + /* Most probably we have active link partner */
> + stat = ETHTOOL_A_CABLE_RESULT_CODE_UNSPEC;
> + }

So drivers will make a few attempts to get a valid result. Have you
tried that?

> +
> + *finished = true;
> +
> + ethnl_cable_test_result(phydev, ETHTOOL_A_CABLE_PAIR_A, stat);
> +
> + /* Reset state machine, otherwise at least other TDR attempts may
> + * provide not reliable results.
> + */
> + return phy_set_bits(phydev, MII_BMCR, BMCR_RESET);

I thought i made the comment that you should use the helper? The
helper will wait around for the bit to clear indicating the PHY is
ready for further configuration.

Andrew