From: Kyle Switch <kyle.switch@motor-comm.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com,
kuba@kernel.org, pabeni@redhat.com, robh@kernel.org,
krzk+dt@kernel.org, conor+dt@kernel.org, hkallweit1@gmail.com,
linux@armlinux.org.uk, Frank.Sae@motor-comm.com,
netdev@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, ming.xu@motor-comm.com,
xiaolin.xu@motor-comm.com, jianmin.wang@motor-comm.com
Subject: Re: [PATCH net-next v22 3/3] net: phy: Add driver for Motorcomm Quad 2.5GbE phy
Date: Wed, 30 Sep 2026 08:39:22 +0800 [thread overview]
Message-ID: <3f31de5e-2a62-46ee-b857-64f8a353d8e6@motor-comm.com> (raw)
In-Reply-To: <0eb0fe92-86c0-425d-8002-a7ce448ba751@lunn.ch>
On 9/29/26 20:18, Andrew Lunn wrote:
>> +static int yt8824_restore_working_status(struct phy_device *phydev, int ret)
>> +{
>> + 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);
> The opening ( should be on the line before. The phydev as well.
>
>> + * yt8824_soft_reset() - called to do PHY software reset
>> + * @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);
> Please look through the code and fix all these problems.
>
> Also, what value does the comment have?
>
okay, meaningless comments will be removed.
>> + if (ret < 0)
>> + 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);
> And this comment? You only need comments if the code is not
> obvious. The name of the function is often sufficient to explain what
> is happening.
>
>> + /* pll calibration */
>> + ret = ytphy_write_ext_with_lock(phydev, 0x0001, 0x0003);
>> + if (ret < 0)
>> + goto err_restore;
> This comment is useful, it is not possible to know what 0x0001,
> 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 */
>> + 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);
> You comment about the obvious power down, but nothing about what this
> magic does :-(
okay, magic numbers will be replaced with meaningful definitions.
>
> Andrew
prev parent reply other threads:[~2026-09-30 0:39 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-29 9:54 [PATCH net-next v22 0/3] " Kyle Switch
2026-09-29 9:54 ` [PATCH net-next v22 1/3] dt-bindings: net: Document Motorcomm YT8824 PHY package Kyle Switch
2026-09-29 9:54 ` [PATCH net-next v22 2/3] net: phy: Add support for Template Control register for PMA Kyle Switch
2026-09-29 12:00 ` Andrew Lunn
2026-09-29 9:54 ` [PATCH net-next v22 3/3] net: phy: Add driver for Motorcomm Quad 2.5GbE phy Kyle Switch
2026-09-29 12:18 ` Andrew Lunn
2026-09-30 0:39 ` Kyle Switch [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3f31de5e-2a62-46ee-b857-64f8a353d8e6@motor-comm.com \
--to=kyle.switch@motor-comm.com \
--cc=Frank.Sae@motor-comm.com \
--cc=andrew+netdev@lunn.ch \
--cc=andrew@lunn.ch \
--cc=conor+dt@kernel.org \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=edumazet@google.com \
--cc=hkallweit1@gmail.com \
--cc=jianmin.wang@motor-comm.com \
--cc=krzk+dt@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=ming.xu@motor-comm.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=robh@kernel.org \
--cc=xiaolin.xu@motor-comm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®