From: netdev-bot+sashiko@kernel.org
To: mjkchengke@163.com
Cc: Frank.Sae@motor-comm.com, netdev@vger.kernel.org, andrew@lunn.ch,
hkallweit1@gmail.com, linux@armlinux.org.uk, davem@davemloft.net,
edumazet@google.com, kuba@kernel.org, pabeni@redhat.com
Subject: Re: [PATCH v2 2/2] net: phy: motorcomm: add downshift tunable support for YT8531S
Date: Sun, 29 Nov 2026 09:37:30 +0000 [thread overview]
Message-ID: <179594505001.3146.1116683394141107973@kernel.org> (raw)
In-Reply-To: <20261125091638.1847020-2-mjkchengke@163.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.
Critical: 0 · High: 1 · Medium: 0 · Low: 0
If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).
- [High] This patch quietly reverts the fix made by the previous commit
in the series, "net: phy: motorcomm: return -ETIMEDOUT on BMCR reset…
--
net: phy: motorcomm: add downshift tunable support for YT8531S
This patch adds ETHTOOL_PHY_DOWNSHIFT tunable support for the YT8531S.
The tunable is backed by the Speed Auto Downgrade Control Register (0x14).
The new value is committed with a UTP-space soft reset through
yt8521_modify_bmcr_paged().
> diff --git a/drivers/net/phy/motorcomm.c b/drivers/net/phy/motorcomm.c
> index ba3421ca4d733..8de87897bcde1 100644
> --- a/drivers/net/phy/motorcomm.c
> +++ b/drivers/net/phy/motorcomm.c
[ ... ]
> @@ -1595,13 +1598,102 @@ static int yt8521_modify_bmcr_paged(struct phy_device *phydev, int page,
> if (!(ret & BMCR_RESET))
> return phy_restore_page(phydev, old_page, 0);
> }
> - ret = -ETIMEDOUT;
> }
>
> err_restore_page:
> return phy_restore_page(phydev, old_page, ret);
> }
[Severity: High]
Was the removal of ret = -ETIMEDOUT here intended? It undoes the previous
patch in the series ("net: phy: motorcomm: return -ETIMEDOUT on BMCR reset
timeout"). After both patches, yt8521_modify_bmcr_paged() is the same as
it was before the series.
The commit message says the opposite:
This also relies on the previous fix, which makes the
helper report a timeout instead of a stale positive BMCR value.
The v2 changelog doesn't mention this change either. Could it be left over
from moving the new functions below the helper?
Without the assignment, if BMCR_RESET is still set after the 500 polls,
ret still holds the last __phy_read() value. That value is positive and
has BMCR_RESET set. It falls through to phy_restore_page(), which returns
it unchanged. The kernel-doc for the helper says it returns 0 or a
negative errno.
The existing callers only check for negative values:
yt8521_modify_utp_fiber_bmcr() {
...
ret = yt8521_modify_bmcr_paged(phydev, YT8521_RSSR_UTP_SPACE,
mask, set);
if (ret < 0)
return ret;
...
}
So yt8521_soft_reset(), config_aneg, suspend and resume again treat a PHY
stuck in reset as success. That is the bug the previous patch was meant
to fix.
> +static int yt8531s_set_downshift(struct phy_device *phydev, u8 cnt)
> +{
[ ... ]
> + err = phy_modify_paged(phydev, YT8521_RSSR_UTP_SPACE,
> + YTPHY_SPEED_AUTO_DOWNGRADE_CONTROL_REG,
> + mask, set);
> + if (err < 0)
> + return err;
> +
> + return yt8521_modify_bmcr_paged(phydev, YT8521_RSSR_UTP_SPACE,
> + 0, BMCR_RESET);
> +}
This new caller also hits the problem. It returns the helper's result
directly, so a reset timeout gives a positive value:
ethtool_set_tunable()
set_phy_tunable()
yt8531s_set_tunable()
yt8531s_set_downshift()
yt8521_modify_bmcr_paged(phydev, YT8521_RSSR_UTP_SPACE, 0, BMCR_RESET)
set_phy_tunable() in net/ethtool/ioctl.c passes that value back from the
ETHTOOL_STUNABLE ioctl, and userspace checks for < 0.
Because the SADCR change only takes effect after the UTP reset, wouldn't
userspace be told the downshift setting was applied when it was not?
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261125091638.1847020-1-mjkchengke%40163.com
next prev parent reply other threads:[~2026-11-29 9:37 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-25 8:55 [PATCH] net: phy: motorcomm: add downshift tunable support for YT8531/YT8531S ck
2026-11-25 9:16 ` [PATCH v2 1/2] net: phy: motorcomm: return -ETIMEDOUT on BMCR reset timeout ck
2026-11-25 9:16 ` [PATCH v2 2/2] net: phy: motorcomm: add downshift tunable support for YT8531S ck
2026-11-29 9:37 ` netdev-bot+sashiko [this message]
2026-11-25 9:23 ` [PATCH v2 1/2] net: phy: motorcomm: return -ETIMEDOUT on BMCR reset timeout netdev-bot+sinfo
2026-11-25 9:56 ` chengke
2026-11-29 9:37 ` netdev-bot+sashiko
2026-11-29 9:10 ` [PATCH] net: phy: motorcomm: add downshift tunable support for YT8531/YT8531S netdev-bot+sashiko
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=179594505001.3146.1116683394141107973@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=Frank.Sae@motor-comm.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hkallweit1@gmail.com \
--cc=kuba@kernel.org \
--cc=linux@armlinux.org.uk \
--cc=mjkchengke@163.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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