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=1796515656; b=DYp3VhxfB95lV6ZcyUcKZjLf6/OOVMYlNJIVrY5SnfZFli2pLaByY4/GFYDGO2u5+alR 70QOV881yj91VuebK0mYH97XLxSiKO/p+Gtkq9OfgDzwGJ8ccLfksa8zKsiRw9eqA/aL8 uPrhqjAOh75995gUVN2JAwdxVPIg5jtm0xfDAi4JuxGVsgzMVpmAKn5+JD3DFbgxlPiiz 9goN0rLqgPskCStYKRivXvEeYK+jiwyyaYVt9OG24x8gCL4icYZlS/6aMTorNHs837q4F iH5fgFaCKipgmiRmUg2FUYdAOLpifdYbH6UjLSwmtoAYujn+CfFqI3ExiJlsEjhJCGA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796515656; 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=kb7W5Jp6d6BQCQqiRlZda95c3LZdDf2M3RFdUnNzVVw=; b=SzWN3SrMpQHcTplvPhczI7uuIaqgiwIN1W1K27TbA1z+fnPZaDUca4HK7a9SKyl/5Pfe GGHml/WKe5GxjTGToVEXq4kTWm9f9SuRl2wnv+QRoCI+QaBLzvzTmB3AzCuUglOxLfhpP asJAnlCStArf+FpjF2lZXVuxITJcYNnOxYxcet1umflCC82aXG/SUiLBNdotFjL7eAIIj 6SnID1ktE54mzEbrCNmhStNL61k8OhnR6c7jR6g3mhZFQhE7QOkY1zpV88s0tXNGil+3k gL345LqneNp6eakMl6n6lsvXwjLCy0InL34xQ7zd8DFvaQhhFC91XhWCPolDBveSr/w== 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=L8KrMRJm; 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 706DD606A334 for ; Sun, 6 Dec 2026 00:07:36 +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=L8KrMRJm Received: by smtp.kernel.org (Postfix) with ESMTPSA id BE4221F00A07; Sun, 6 Dec 2026 00:07:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796515656; bh=kb7W5Jp6d6BQCQqiRlZda95c3LZdDf2M3RFdUnNzVVw=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=L8KrMRJmr7BB3iBvsoC7tVLwWxYYl0r6BgdmyqIeq++d7RUm5zjAhYPLUe0XxYeYA 99K8e3hFSH5tgedn9gZyxejSrJPpp7QXNbxcGl3hGVhVraGyEWPw7i1FZX2wXxE4uZ XnVh4BWdsQ4JVUmrBgm2TODHCs46pQa/OMObCHVz2Q+bBtJR5B+u1mBC8EVDO/MTbW 4JolVl0ZEuAfPklqG9S+ojjYaSVQB8D7vIulsWxSd09Bka8hpK1KUSkFzjkIRTGnjC kxUcLsDTmAt9raUZCSVXF+/9wkAMD0lgTpfSRe7AqN6eJnOyEv/e0PaaoFr4QUkhxH 8pso0TSZZXPUA== Subject: Re: [PATCH net-next v2 3/4] net: phy: broadcom: Wire-up cable tests for BCM54210E From: netdev-bot+sashiko@kernel.org To: florian.fainelli@broadcom.com Cc: netdev@vger.kernel.org, nb@tipi-net.de, bcm-kernel-feedback-list@broadcom.com, andrew@lunn.ch, hkallweit1@gmail.com, linux@armlinux.org.uk, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com Date: Sun, 06 Dec 2026 00:07:35 +0000 Message-ID: <179651565536.3148.15517909109675965375@kernel.org> In-Reply-To: <20261204233633.3790143-4-florian.fainelli@broadcom.com> References: <20261204233633.3790143-4-florian.fainelli@broadcom.com> X-sashiko-severity: Medium 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: 0 · Medium: 1 · 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). - [Medium] On BCM53573 boards, one successful cable test on a BCM54210E silently drops the forced-master setting. -- net: phy: broadcom: Wire-up cable tests for BCM54210E This commit wires up cable diagnostics for the BCM54210E PHY. It turns off auto power-down while the ECD run is in progress. On completion or on a start failure it restores auto power-down through bcm54xx_adjust_rxrefclk(). > diff --git a/drivers/net/phy/broadcom.c b/drivers/net/phy/broadcom.c > index 9085b72e322f4..19b97beb8be8d 100644 > --- a/drivers/net/phy/broadcom.c > +++ b/drivers/net/phy/broadcom.c [ ... ] > +static int bcm54xx_cable_test_get_status(struct phy_device *phydev, > + bool *finished) > +{ > + int ret; > + > + ret = bcm_phy_cable_test_get_status(phydev, finished); > + if (ret < 0 || !*finished) > + return ret; > + > + /* Put auto power-down back the way config_init() left it */ > + bcm54xx_adjust_rxrefclk(phydev); [Severity: Medium] Does a successful cable test on BCM53573 boards drop the forced master mode that config_init() set up? bgmac_probe() in drivers/net/ethernet/broadcom/bgmac-bcma.c sets PHY_BRCM_EN_MASTER_MODE for a BCM54210E on BCM53573. bcm54210e_config_init() then sets the master bits: drivers/net/phy/broadcom.c:bcm54210e_config_init() { ... if (phydev->dev_flags & PHY_BRCM_EN_MASTER_MODE) { val = phy_read(phydev, MII_CTRL1000); val |= CTL1000_AS_MASTER | CTL1000_ENABLE_MASTER; phy_write(phydev, MII_CTRL1000, val); } ... } With this patch, bcm54xx_cable_test_start()->bcm_phy_cable_test_start()-> _bcm_phy_cable_test_start() becomes reachable for this PHY. That path clears the register unconditionally: drivers/net/phy/bcm-phy-lib.c:_bcm_phy_cable_test_start() { ... phy_write(phydev, MII_CTRL1000, 0); ... } When the test completes, bcm54xx_cable_test_get_status() only calls bcm54xx_adjust_rxrefclk(). That restores the SCR3 and APD shadow registers, not MII_CTRL1000. The BCM54210E entry has no .config_aneg, so the renegotiation after the test goes through genphy_config_aneg(). genphy_setup_master_slave() returns early for MASTER_SLAVE_CFG_UNKNOWN or MASTER_SLAVE_CFG_UNSUPPORTED, because the forced-master request comes from a driver-private dev_flag rather than ethtool or DT. genphy_config_advert() only modifies ADVERTISE_1000FULL and ADVERTISE_1000HALF. So the PHY renegotiates with automatic master/slave resolution until the next phy_init_hw(). Only the abort path re-runs config_init, through phy_abort_cable_test()->phy_init_hw(). The later commit in this series, "net: phy: broadcom: Recover BCM54210E from aborted cable tests", adds bcm54210e_soft_reset(). That only acts when phydev->state == PHY_CABLETEST on the abort path. The successful completion path is unchanged, so the problem is still there at the end of the series. Could the completion path re-apply the PHY_BRCM_EN_MASTER_MODE bits, or save and restore MII_CTRL1000 around the test? > + > + return 0; > +} [ ... ] -- Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261204233633.3790143-1-florian.fainelli%40broadcom.com