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=1796089853; b=xEPQaY/WYkmrGf5nFQCL79Da9bElJKxXkegyH+PmJ4YwIl3F5iTIMJbAKgR+jLCVU3Bf bZ7wpaptFBzJ/fGf6ymTWshtTFSM/Rl9lhV4HYShE+tG5AmTdrQyPfEGbJ2P1YeVs42C5 ag0fOvWo1U6vVBaxlxebXFxQGHghLO5qh0iXXKC0gvPycI1d9GehTuo/VrEfyYHj6d+Ff D2dMSmvKaN8sstQFr9gsLyfkFV03/jzGbi3Ekft7Y+8+WjTHKLRadCh5o/8+OozIeLPdc rNjmc0VkLwbtAjySkPBrhLMmzebaJTWANfTQibau0W/81RCMRlcGcwX4EnSKgFCJPIQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796089853; 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=Kp9qv61D0oY3OF1pU7C3fUM7flDYCR5uJcMnrfsnBB4=; b=yn4tWfoARw/vPopI45epyFAKL8Gy0lJOfjhYknQRgF4bFmFvM7otyNyIr2ukhyJrpwDp YhaBtqSh358JJ0UCEyVZZKnmdRP4kjUhXdaF+U8dszkpHQtb9EmMPFVJkbm8wOwDkNgUT x+8Ve1Rb5V2lJhsy3IVVchHzCPEISskmQMSjfbmuDPOuqBk38jlixacrW0l/RX6gCBgHU IJXPL3PS5Ye7OH5/0iiJPscpZ+92kCCKPtQ10YFPuqfL6GWtVoN6LFoNbc2CLOp4de7tS 4nqhZ541AOs47by8LfkKJciiembZvaMGK7sSx+RgGwtEMihfe48MyH2PORbyzhl/5FQ== 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=lrYffNxI; 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 6C336606A31A for ; Tue, 1 Dec 2026 01:50:53 +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=lrYffNxI Received: by smtp.kernel.org (Postfix) with ESMTPSA id 673A31F000C1; Tue, 1 Dec 2026 01:50:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796089853; bh=Kp9qv61D0oY3OF1pU7C3fUM7flDYCR5uJcMnrfsnBB4=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=lrYffNxItX7yipYXk/OYpvBH2YbjaU0CpRQCdbJC6j30FhdV22wnGR+INkZEk2jn3 enT5AIJVn9kReX5lrM7B9sZZW0Jkhn0lzfjtsvT0N8rhtB7BqlEYATrkdIUBcTfBEz 2BFT8mR2+k7JcASl0hip/lhORQsCkIKZckwJWhMakSRGVvc24CdYQAlB7JVDehTgon lCRv8jlrjWhaQinSjmCG4MPRELIC1nB3tndpzWRcz553KRhYWZPhb8o3qxwwptD+se Z5YJqeMWDywZS3G8HVofCbM+EtvOMkmN6sDbq4NKKh7oUKTbux4fJLLJsRZZUD7Lg3 50KngCEsEY21Q== Subject: Re: [PATCH net 05/14] net: phy: as21xxx: Correct the 10M speed status value From: netdev-bot+sashiko@kernel.org To: cristian.ciocaltea@collabora.com Cc: ansuelsmth@gmail.com, andrew@lunn.ch, hkallweit1@gmail.com, linux@armlinux.org.uk, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, kernel@collabora.com, netdev@vger.kernel.org Date: Tue, 01 Dec 2026 01:50:51 +0000 Message-ID: <179608985188.3146.1203400149585184164@kernel.org> In-Reply-To: <20261130-as21xxx-fixes-v1-5-1bd2eae6ccbc@collabora.com> References: <20261130-as21xxx-fixes-v1-5-1bd2eae6ccbc@collabora.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 3 potential issue(s) to consider. Critical: 0 · High: 0 · Medium: 2 · 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] This patch only works together with the commit before it, "net: phy: as21xxx: Use the correct mask for the speed status". - [Medium] (Baseline decision: discard, because it is resolved later in the series; kept here only because requires_validation=true.) The… - [Low] The commit message says the failing switch is in `aeon_read_status()`. -- net: phy: as21xxx: Correct the 10M speed status value This commit changes VEND1_SPEED_10 from 0x0 to 0x40, the value the PHY reports for a 10M link. The commit message says the wrong value was hidden because the speed status was masked with VEND1_SPEED_STATUS instead of VEND1_SPEED_MASK. > Attempting to force a 10M link would therefore match no case of the > switch in aeon_read_status() and make it fail with -EINVAL, generating > the following splat: [Severity: Low] This isn't a bug, but there is no aeon_read_status() in drivers/net/phy/. Should this say as21xxx_read_status()? That is the name the companion patch "net: phy: as21xxx: Use the correct mask for the speed status" uses. > diff --git a/drivers/net/phy/as21xxx.c b/drivers/net/phy/as21xxx.c > index ff6c2005c442a..8d46fdfc279a7 100644 > --- a/drivers/net/phy/as21xxx.c > +++ b/drivers/net/phy/as21xxx.c > @@ -47,7 +47,7 @@ > #define VEND1_SPEED_2500 FIELD_PREP_CONST(VEND1_SPEED_MASK, 0x9) > #define VEND1_SPEED_1000 FIELD_PREP_CONST(VEND1_SPEED_MASK, 0x10) > #define VEND1_SPEED_100 FIELD_PREP_CONST(VEND1_SPEED_MASK, 0x20) > -#define VEND1_SPEED_10 FIELD_PREP_CONST(VEND1_SPEED_MASK, 0x0) > +#define VEND1_SPEED_10 FIELD_PREP_CONST(VEND1_SPEED_MASK, 0x40) [Severity: Medium] Does this patch only work when the previous one, "net: phy: as21xxx: Use the correct mask for the speed status", is also applied? Both patches carry only: Fixes: 830877d89edc ("net: phy: Add support for Aeonsemi AS21xxx PHYs") At 830877d89edc, as21xxx_read_status() does: switch (speed & VEND1_SPEED_STATUS) { VEND1_SPEED_STATUS is 0x4002, so 0x40 & 0x4002 is 0x0, which matched the old VEND1_SPEED_10. The commit message says forced 10M was reported correctly there. If so, the splat quoted above can't happen at 830877d89edc. The splat seems to come from the mask patch instead. Once the switch uses VEND1_SPEED_MASK, 0x40 no longer matches VEND1_SPEED_10 (still 0x0), and as21xxx_read_status() falls into: default: return -EINVAL; That leaves a bisect hole for forced 10M between the two patches, for example with "ethtool -s speed 10 duplex full autoneg off". The opposite case looks worse. Stable could pick up only this patch on top of 830877d89edc based on the Fixes: tag. The switch would then still mask with 0x4002, so the masked value could only be 0x0, 0x2, 0x4000 or 0x4002. None of these match 0x3, 0x5, 0x9, 0x10, 0x20 or 0x40. Wouldn't every forced speed then hit the default case, return -EINVAL and put the PHY into PHY_ERROR? The mask and the 10M value were both wrong in 830877d89edc, and the fix only works when both change. Could the two patches be squashed, or could the dependency at least be stated explicitly? [Severity: Medium] Can an all-zero speed field now make as21xxx_read_status() fail while a forced-mode link is down? At this commit, the forced branch decodes the speed status without checking phydev->link: } else { ... speed = phy_read_mmd(phydev, MDIO_MMD_VEND1, VEND1_SPEED_STATUS); ... switch (speed & VEND1_SPEED_MASK) { ... default: return -EINVAL; } That includes an unplugged cable, and the case where as21xxx_read_link() returns early on BMCR_ANRESTART: if (*bmcr & BMCR_ANRESTART) { phydev->link = 0; return 0; } Before this patch, VEND1_SPEED_10 was the only case that matched 0x0. The firmware might report 0x0, or another unlisted value, while the link is down or the speed is not yet resolved. Every poll would then return -EINVAL, and phylib would move the PHY to PHY_ERROR. Without a datasheet, it isn't clear what the firmware reports in that state. A later patch in the series, "net: phy: as21xxx: Fix speed and duplex reporting", appears to fix this. There, the forced branch only calls as21xxx_read_speed() when phydev->link is set. Its default case sets SPEED_UNKNOWN with dev_warn_once() instead of returning -EINVAL. -- Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261130-as21xxx-fixes-v1-0-1bd2eae6ccbc%40collabora.com