[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <4dd62a56-517a-4011-8a13-95f6c9ad2198@lunn.ch>
Date: Mon, 21 Jul 2025 16:22:37 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Horatiu Vultur <horatiu.vultur@...rochip.com>
Cc: hkallweit1@...il.com, linux@...linux.org.uk, davem@...emloft.net,
edumazet@...gle.com, kuba@...nel.org, pabeni@...hat.com,
o.rempel@...gutronix.de, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH net-next] net: phy: micrel: Add support for lan8842
> +static struct lan8842_hw_stat lan8842_hw_stats[] = {
> + { "phy_rx_correct_count", 2, 3, {88, 61, 60}},
> + { "phy_rx_crc_count", 2, 2, {63, 62}},
> + { "phy_tx_correct_count", 2, 3, {89, 85, 84}},
> + { "phy_tx_crc_count", 2, 2, {87, 86}},
> +};
Hi Horatiu
Please could you look at using ethtool_phy_stats via the
.get_phy_stats() phy driver op.
> +static int lan8842_config_init(struct phy_device *phydev)
> +{
> + int val;
> + int ret;
> +
> + /* Reset the PHY */
> + val = lanphy_read_page_reg(phydev, 4, LAN8814_QSGMII_SOFT_RESET);
> + if (val < 0)
> + return val;
> + val |= LAN8814_QSGMII_SOFT_RESET_BIT;
> + lanphy_write_page_reg(phydev, 4, LAN8814_QSGMII_SOFT_RESET, val);
It looks like there are sufficient pairs of
lanphy_read_page_reg()/lanphy_write_page_reg() you would be justified
adding a lanphy_modify_page_reg().
> +}, {
> + .phy_id = PHY_ID_LAN8842,
> + .phy_id_mask = MICREL_PHY_ID_MASK,
I think you could use PHY_ID_MATCH_MODEL() here. It would make it
different to every other PHY, but maybe you could start with some
cleanup patches, adding the _modify_ call etc?
Andrew
Powered by blists - more mailing lists