From: Yi Cong <cong.yi@linux.dev>
To: andrew@lunn.ch
Cc: Frank.Sae@motor-comm.com, andrew+netdev@lunn.ch,
cong.yi@linux.dev, davem@davemloft.net, hkallweit1@gmail.com,
kuba@kernel.org, linux@armlinux.org.uk, netdev@vger.kernel.org,
stable@vger.kernel.org, yicong@kylinos.cn
Subject: Re: [PATCH] net: phy: motorcomm: Fix the issue in the code regarding the incorrect use of time units
Date: Tue, 28 Oct 2025 14:21:10 +0800 [thread overview]
Message-ID: <20251028062110.296530-1-cong.yi@linux.dev> (raw)
In-Reply-To: <e1311746-9882-4063-84af-3939466096e9@lunn.ch>
On Tue, 28 Oct 2025 03:51:04 +0100, Andrew Lunn <andrew@lunn.ch> wrote:
>
> On Tue, Oct 28, 2025 at 09:59:23AM +0800, Yi Cong wrote:
> > From: Yi Cong <yicong@kylinos.cn>
> >
> > Currently, NS (nanoseconds) is being used, but according to the datasheet,
> > the correct unit should be PS (picoseconds).
> >
> > Fixes: 4869a146cd60 ("net: phy: Add BIT macro for Motorcomm yt8521/yt8531 gigabit ethernet phy")
> > Cc: stable@vger.kernel.org
> > Signed-off-by: Yi Cong <yicong@kylinos.cn>
> > ---
> > drivers/net/phy/motorcomm.c | 102 ++++++++++++++++++------------------
> > 1 file changed, 51 insertions(+), 51 deletions(-)
> >
> > diff --git a/drivers/net/phy/motorcomm.c b/drivers/net/phy/motorcomm.c
> > index a3593e663059..81491c71e75b 100644
> > --- a/drivers/net/phy/motorcomm.c
> > +++ b/drivers/net/phy/motorcomm.c
> > @@ -171,7 +171,7 @@
> > * 1b1 enable 1.9ns rxc clock delay
> > */
> > #define YT8521_CCR_RXC_DLY_EN BIT(8)
> > -#define YT8521_CCR_RXC_DLY_1_900_NS 1900
> > +#define YT8521_CCR_RXC_DLY_1_900_PS 1900
>
> This could be down to interpretation.
>
> #define YT8521_CCR_RXC_DLY_1.900_NS 1900
>
> would be technically correct, but not valid for cpp(1). So the . is
> replaced with a _ .
>
> #define YT8521_CCR_RXC_DLY_1900_PS 1900
>
> would also be correct, but that is not what you have in your patch,
> you leave the _ in place.
Alright, I didn't realize that 1_950 represents 1.950;
I thought the underscores were used for code neatness,
making numbers like 900 and 1050 the same length, for example:
#define YT8521_RC1R_RGMII_0_900_PS
#define YT8521_RC1R_RGMII_1_050_PS
In that case, is my patch still necessary?
Or should I instead follow your suggestion above and change them to something like:
#define YT8521_RC1R_RGMII_900_PS
#define YT8521_RC1R_RGMII_1050_PS
Regards,
Yi Cong
next prev parent reply other threads:[~2025-10-28 6:22 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-28 1:59 [PATCH] net: phy: motorcomm: Fix the issue in the code regarding the incorrect use of time units Yi Cong
2025-10-28 2:51 ` Andrew Lunn
2025-10-28 6:21 ` Yi Cong [this message]
2025-10-28 12:07 ` Andrew Lunn
2025-10-28 12:19 ` Russell King (Oracle)
2025-10-28 12:46 ` Yi Cong
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=20251028062110.296530-1-cong.yi@linux.dev \
--to=cong.yi@linux.dev \
--cc=Frank.Sae@motor-comm.com \
--cc=andrew+netdev@lunn.ch \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=hkallweit1@gmail.com \
--cc=kuba@kernel.org \
--cc=linux@armlinux.org.uk \
--cc=netdev@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=yicong@kylinos.cn \
/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;
as well as URLs for NNTP newsgroup(s).