Re: [PATCH net-next v22 3/3] net: phy: Add driver for Motorcomm Quad 2.5GbE phy
From: Kyle Switch
Date: Tue Sep 29 2026 - 20:40:11 EST
On 9/29/26 20:18, Andrew Lunn wrote:
okay, meaningless comments will be removed.+static int yt8824_restore_working_status(struct phy_device *phydev, int ret)The opening ( should be on the line before. The phydev as well.
+{
+ struct yt8824_shared_priv *priv = phy_package_get_priv(phydev);
+ int r;
+
+ /* configure normal test mode */
+ r = yt8824_utp_set_template_test_mode
+ (phydev, MDIO_PMA_10GBT_TESTMODE_NORMAL);
+ * yt8824_soft_reset() - called to do PHY software resetPlease look through the code and fix all these problems.
+ * @phydev: a pointer to a &struct phy_device
+ *
+ * Returns: 0 or negative errno code
+ */
+static int yt8824_soft_reset(struct phy_device *phydev)
+{
+ struct yt8824_shared_priv *priv = phy_package_get_priv(phydev);
+ int ret;
+
+ mutex_lock(&priv->shared_lock);
+ if (priv->package_mode == PHY_INTERFACE_MODE_INTERNAL) {
+ /* test mode 1 */
+ ret = yt8824_utp_set_template_test_mode
+ (phydev, MDIO_PMA_10GBT_TESTMODE_1);
Also, what value does the comment have?
okay, magic numbers will be replaced with meaningful definitions.+ if (ret < 0)And this comment? You only need comments if the code is not
+ goto retry;
+ ret = yt8824_utp_softreset_paged(phydev);
+ if (ret < 0)
+ goto retry;
+ /* normal mode */
+ ret = yt8824_utp_set_template_test_mode
+ (phydev, MDIO_PMA_10GBT_TESTMODE_NORMAL);
obvious. The name of the function is often sufficient to explain what
is happening.
+ /* pll calibration */This comment is useful, it is not possible to know what 0x0001,
+ ret = ytphy_write_ext_with_lock(phydev, 0x0001, 0x0003);
+ if (ret < 0)
+ goto err_restore;
0x0003 means.
+ ret = ytphy_write_ext_with_lock(phydev, 0xa20e, 0x0cba);and this is just magic. Which is why we recommend #define, not magic
numbers.
+ /* power down */You comment about the obvious power down, but nothing about what this
+ ret = phy_modify(phydev, MII_BMCR, BMCR_PDOWN, BMCR_PDOWN);
+ if (ret < 0)
+ goto err_restore;
+ ret = ytphy_write_ext_with_lock(phydev, 0xa20e, 0xcba);
magic does :-(
Andrew