Re: [PATCH net-next v1 2/4] net: phy: micrel: add EEE configuration support for KSZ9477 variants of PHYs

From: Florian Fainelli
Date: Fri Jan 20 2023 - 12:58:55 EST




On 1/19/2023 9:55 PM, Oleksij Rempel wrote:
On Thu, Jan 19, 2023 at 11:25:42AM -0800, Florian Fainelli wrote:
On 1/19/23 05:18, Oleksij Rempel wrote:
KSZ9477 variants of PHYs are not completely compatible with generic
phy_ethtool_get/set_eee() handlers. For example MDIO_PCS_EEE_ABLE acts
like a mirror of MDIO_AN_EEE_ADV register. If MDIO_AN_EEE_ADV set to 0,
MDIO_PCS_EEE_ABLE will be 0 too. It means, if we do
"ethtool --set-eee lan2 eee off", we won't be able to enable it again.

With this patch, instead of reading MDIO_PCS_EEE_ABLE register, the
driver will provide proper abilities.

We have hooks in place already for PHY drivers with the form of the read_mmd
and write_mmd callbacks, did this somehow not work for you?

Below is an example:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=d88fd1b546ff19c8040cfaea76bf16aed1c5a0bb

(here the register location is non-standard but the bit definitions within
that register are following the standard).

It will work for this PHY, but not allow to complete support for AR8035.
AR8035 provides support for "SmartEEE" where tx_lpi_enabled and
tx_lpi_timer are optionally handled by the PHY, not by MAC.

Not sure I understand your reply here, this would appear to be a limitation that exists regardless of the current API defined, does that mean that you can make use of the phy_driver::{read,write}_mmd function calls and you will make a v2 that uses them, or something else entirely?
--
Florian