From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795945051; b=wj2Iurxy0KRT/rVPa7QasrapEcCcjYdF5zqIY4XFCVLF4GopVnfk6t31BYtqpXplMCYY KOZ1ud3qEj+5byRV8kc4kC4U7G+6YeMqRzGRFbxXoiECbmonsjPPCOK2R2ABvPLuDLHlU njXeeeV4oQiP3bhaqQzZy97PNwqYxjllczi4n6v+5QVH4gbHX3E9msnGoYf/HYOawwAiU EoNpHGsAon8ToSp6M2Q4zvkbemlW1fhMCCWONS7xpNqR2MnByvFX5hxnMejkPSEKdm5yg srVyZqvd+63ONtsdyUdVJFIkyhaheoXpg8EULuTtVUH1Zf/HsQOt95PiN74MED7AxIw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795945051; h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID: In-Reply-To:References:X-sashiko-severity:Content-Type: Content-Transfer-Encoding:MIME-Version; bh=lgx43oReKrKNa+FZbvSuM5tKwrJNFH7pOtP/AwIY+vc=; b=OVI5cKyV5cN+mC7zqM/95gpd4L0WqC0glkEBTmJJZtZBViLtc/cG7qnrXoL9j98Xh9HD ugJTym/gaQ3WKl5xgx0q88jYjusVoiQ6te2oXToZSDtl2K41mTrEpxBm4vBtDehQs7cN/ ffofXeGxWhPs2X438qBCwK6d7GaUVvDiUZj8xv9ahsoV342ilOqOHCaBPsnDtwOy197za ys3Tu3FnQqc8NdNpLjTnLkkPp6K6Y5Fp/J5wYQgDZCdYYvVPNR7tovT4/MrVHXe7wa+lm WJuK0YlkT1f1rJOhhu7gsWITcC5qmeNddeNF7MBHPiMM5p4riERZ7KHGQCSo1KVxGlw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=h4OVhz92; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A8B4A606A335 for ; Sun, 29 Nov 2026 09:37:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=h4OVhz92 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 75ECE1F00898; Sun, 29 Nov 2026 09:37:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795945051; bh=lgx43oReKrKNa+FZbvSuM5tKwrJNFH7pOtP/AwIY+vc=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=h4OVhz92UTsYVaH6NUcyo2L5q+jK5mmLxMfo3Dy6WcmvI1o3Njk8zXvPiStr5thBE BIH6sFfKl0jwB8BUcf5M9cozZ5XeLV6uPDgedaoFH4SozAtzHbFixKzlFXSkJvpZYY w3+6QyqDI1p616s12UmhRoNl/bU36CAsbaySiptaavjKzCniSaoeDYbIYT2GnxkeWm Bbl922wyNnZ9YWiyjkiQWAtPDTtiZgQqVj8u4qJDgBMOAsXaR5e9Lldd8YkKsqJwNS +4afj3xddGrSA3AdxJXp6wnKrIJ19F+wPz/UjiQnl4fmcTO6ixmPKnV1TGOj3orbDs 7mzugGMKgGpXw== Subject: Re: [PATCH v2 2/2] net: phy: motorcomm: add downshift tunable support for YT8531S 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 Date: Sun, 29 Nov 2026 09:37:30 +0000 Message-ID: <179594505001.3146.1116683394141107973@kernel.org> In-Reply-To: <20261125091638.1847020-2-mjkchengke@163.com> References: <20261125091638.1847020-2-mjkchengke@163.com> X-sashiko-severity: High Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 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