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=1796515654; b=yRq/7E+L8vQQjuBENDdYZiF4Tp640hpa4Kfllz3inbNYhduVUaOKfpojQ1D/YHQtw0Wc 1vpxsMkfx0hqM2e3jGCL+XXEqFyDN2QSiO+fekWNq/tfYOAq3krWQuzs9t4Ury0auERi1 zIinI1nmgz5XS98Dg/hNuUoipxJr3RElfILew07pxClR2j3BmoGlj/erbdlsQD5kxcGbz jTpoY1Rn4xWb9zDi6eyZb/eIvrt1Hgo2sYYgOXsjV0W1gmB+rld2mt18X09M6hVN3TSLg pT9AgX2IqyOGrWlAMlLLUGhdQGWfqt5nE4jUFa8HHKpbXZuJLToawU+5uOgRjJtTlRA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796515654; 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=bxXIBlu5NKMLn5C7Ys+GFKxmRbbRIpg8ByXOI1BtuGM=; b=VgWKfA1NXVbNSPC8CgBVTVwoLoLbHMt4ZNsLfARsiKC2OXo3gG8L6KFb1z08AvEpwzQt 2p1zWqDyZVSGrmNQRKHieTELWgmGsLdGlLVEdYiPK8XlwZFcO4Bt5ee8GLGMeGk9FAii7 NtRgyqVYtUqgrWIKX9mCIp6hZKERG7LG80LmH4lmr7jQwz1D17C+rgatJsoakFDKUIhTW tknkMr5vT1A7d7X3zJs91qC+x7NhT5VfKakys31QpSVT3oersxGYOkAjlCZJ3dJ21w+om Ucrw8Stj9CDmBRN9bDy/zc0sXUEXoUJGNtMUa/7ROg5I6615XIwQAY4GZlHn2CWGQLQ== 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="EN6JUT/G"; 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 39C47606A31F for ; Sun, 6 Dec 2026 00:07:34 +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=EN6JUT/G Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6E8251F0092B; Sun, 6 Dec 2026 00:07:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796515654; bh=bxXIBlu5NKMLn5C7Ys+GFKxmRbbRIpg8ByXOI1BtuGM=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=EN6JUT/G70RZ5zYvb3g+e48FDJzFz8yYlmCaSVznxhoqkFIgwks8CA0J9M3sAmkEH Law9FoPFmbOhJHTVgzmd0FYvnFc40NGHXUPtk14Mc3o0CwzWcCP/r/y0IW8Eu6OPYd 2jCvGqSafKfiXf49wkmnREb6rzxpg6SLVtrcqeVIthVIHyiXyA2duzkCqRkH/av5wf UcwuDyfMgTFjvHlZRb1aIRlnNMU4lfG/mwZYqEBfZoqHLSiQjfZkI/ngNHo4EXGOPf M62IRiZZcoFPUxzNFXFMGt0ZMiCAVaG88RFbT4zziahJX7OTc9/ybfN6maaFHNZgwc ps5963yGDk23g== Subject: Re: [PATCH net-next v2 1/4] net: phy: broadcom: Report failed ECD pairs as unspecified 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:32 +0000 Message-ID: <179651565297.3148.5448830779665771796@kernel.org> In-Reply-To: <20261204233633.3790143-2-florian.fainelli@broadcom.com> References: <20261204233633.3790143-2-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 2 potential issue(s) to consider. Critical: 0 · High: 0 · Medium: 1 · Low: 1 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] bcm_phy_cable_test_report_pair() only checks for the engine- failure marker BCM54XX_ECD_LENGTH_RESULTS_FAILED (0x47ae) on pairs… - [Low] The patch fixes behaviour in the shared Broadcom ECD result handler but has no Fixes: tag. -- net: phy: broadcom: Report failed ECD pairs as unspecified This adds a BCM54XX_ECD_LENGTH_RESULTS_FAILED (0x47ae) sentinel for the ECD length registers. It also merges the per-pair result and length reporting into a new helper, bcm_phy_cable_test_report_pair(). When a pair's length register reads 0x47ae, the pair is reported as UNSPEC and no fault length is emitted. > The ECD engine can return the saturated value 0x47ae in a pair's > length register when the measurement fails. The shared result > handler currently reports it as a fault distance of 18350 cm. [Severity: Low] Should this patch have a Fixes: tag? The code in bcm_phy_report_length() that passed 0x47ae straight to ethnl_cable_test_fault_length() came from this commit: Fixes: 11ecf8c55b91 ("net: phy: broadcom: add cable test support") At this point in the tree, BCM54140 is the only user of the shared handler, through bcm_phy_cable_test_get_status_rdb() in drivers/net/phy/bcm54140.c. BCM54210E only starts using it later in the series. If BCM54140 can return 0x47ae, this fixes hardware that is already supported. If the failure only shows up on BCM54210E, could the commit message say so? > diff --git a/drivers/net/phy/bcm-phy-lib.c b/drivers/net/phy/bcm-phy-lib.c > index b64beade8dd93..4911dc8210cdd 100644 > --- a/drivers/net/phy/bcm-phy-lib.c > +++ b/drivers/net/phy/bcm-phy-lib.c > @@ -722,21 +722,26 @@ static bool bcm_phy_distance_valid(int result) > return false; > } > > -static int bcm_phy_report_length(struct phy_device *phydev, int pair) > +static void bcm_phy_cable_test_report_pair(struct phy_device *phydev, > + u8 pair, int fault) > { > - int val; > + int code = bcm_phy_cable_test_report_trans(fault); > + int len = -ENODATA; > > - val = __bcm_phy_read_exp(phydev, > - BCM54XX_EXP_ECD_PAIR_A_LENGTH_RESULTS + pair); > - if (val < 0) > - return val; > + if (bcm_phy_distance_valid(fault)) > + len = __bcm_phy_read_exp(phydev, > + BCM54XX_EXP_ECD_PAIR_A_LENGTH_RESULTS + > + pair); > > - if (val == BCM54XX_ECD_LENGTH_RESULTS_INVALID) > - return 0; > + /* The fault type is not valid either when the engine failed */ > + if (len == BCM54XX_ECD_LENGTH_RESULTS_FAILED) > + code = ETHTOOL_A_CABLE_RESULT_CODE_UNSPEC; [Severity: Medium] Can a failed pair still be reported as OK here? The comment says the fault type is not valid when the engine fails. The length register is the only failure indicator used, and it is only read when bcm_phy_distance_valid(fault) is true. That means the nibble has to be OPEN, SAME_SHORT or CROSS_SHORT: static bool bcm_phy_distance_valid(int result) { switch (result) { case BCM54XX_ECD_FAULT_TYPE_OPEN: case BCM54XX_ECD_FAULT_TYPE_SAME_SHORT: case BCM54XX_ECD_FAULT_TYPE_CROSS_SHORT: return true; } return false; } Suppose a failed run leaves a pair's nibble as BCM54XX_ECD_FAULT_TYPE_OK: - len stays -ENODATA. - The 0x47ae check never fires. - bcm_phy_cable_test_report_trans() returns ETHTOOL_A_CABLE_RESULT_CODE_OK. User space then sees a healthy pair instead of UNSPEC. INVALID, BUSY and unknown nibbles already map to UNSPEC, so OK appears to be the only case affected. The new header definition also describes 0x47ae as an ECD failure without tying it to any fault type: #define BCM54XX_ECD_LENGTH_RESULTS_FAILED 0x47ae /* saturated, ECD failure */ Would it make sense to read the length register for OK pairs as well, and check for the sentinel before trusting the decoded nibble? If the hardware only reports 0x47ae together with an OPEN or SHORT code, could the commit message and the comment say that? [ ... ] -- Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261204233633.3790143-1-florian.fainelli%40broadcom.com