From nobody Mon May 25 08:11:54 2026 Received: from mail-ej1-f43.google.com (mail-ej1-f43.google.com [209.85.218.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8569D2E8B83 for ; Sat, 16 May 2026 14:52:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778943162; cv=none; b=Pzy+xAFWhYFHqIV7ExfsbyxCQL4n5qlIyIBeID2H+eAno/U6qwV3n5JifLAeeoRkbCp47/pMGXTgaJ19E7j24/rpEWKL+U+rPAHTybSdnhPApvCNCa5j88KZ/ZykiMVZm9eNblAbJLhiNw+0BuNYu1SslcuPaWFjo2XFdde6C8M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778943162; c=relaxed/simple; bh=QmkJpHUldte/egmuA7DGybI2tVG7cghkcZq8VmZIces=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=aUb9EQqnlZTMgK+DPFla+JGUAXAESpAhoFgGvCeFWK8EJZ6TeuakvIDt1otztuRs9JhX92G7Sv66LAoc3i2V+w7kcVMH2NZo+B/i60cS9q5NHWCOFM1RIcNjit8D6uokApmagGml4+ij2dVr59/qvriZhc6+ezVWhGqBy8HMgYU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=itW1GJ/M; arc=none smtp.client-ip=209.85.218.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="itW1GJ/M" Received: by mail-ej1-f43.google.com with SMTP id a640c23a62f3a-bd394f4a931so199999766b.2 for ; Sat, 16 May 2026 07:52:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1778943159; x=1779547959; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=zxxDjL5gnnI2uwzrc+KACxtlyJsnDYW3Yb57xozjSks=; b=itW1GJ/MmP/rraX61+guXfi0qf/rTu7VGrKEiMpgMuWhYH+6iwOnBvLQVo4gBZu7PD 5NJ54DUJD5UIBHNWL2uG2xLM/VuZlRo/uj6EyqGs2v5kSJG3t/kBvDJjMKhvKUvwTBNR 3/GwZVsPizfKfTCSqm5mn4aBYDdCWtfihdrzwaZvzV8+omlkAUPeGXpjZ8ZAnSFwYIAg QZfityw9VUwVyqzQExSA2CgEmthKrf9HP7abcO+Zy9jQQtd5LGuq8qjOPiVmfWcKcnXd VigeG+mr8/bQyiUNjUa/ag+w6guAlaKNz9xiTKOUubB/Mtn6qP/n45Z4KRq/51ktiqYg 3nwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778943159; x=1779547959; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=zxxDjL5gnnI2uwzrc+KACxtlyJsnDYW3Yb57xozjSks=; b=rjmuqcxxIqeEuWNFb1nx6BoOmDtNkCZNZ7bA1+miGNKTHIs5uHjroqheGHbqqGekjY mriixPZvmEntpBA4equBaeYh9XbXMeNVUVxdW/+s4AjQJ/888BKgOTRbJ8X0j/CWNJE5 I50TPo2RSq5mZFqBbdsiWNbha2GOOVl7tNB8xmDVoBP864VtkDSe8ucIOCafJxwJ1Qic WGchSqxo9CL70nFgl2wD+ai6ircYKJNycnVU8RlW2/IHd8auDvS1/Q7rBeN8oioiZsok oPxDSpw5KOhvFmaknpYApw5mIOA/ctb+Zkx7K9cbycFpQ2GelnnXmjSihVUuXzUKa+O7 zBMA== X-Forwarded-Encrypted: i=1; AFNElJ+qpjp9MbKPmlhMT3ad0UPKJTZqDC1B992DswWH4OXWS3rnib9XvofIZtc73HvSDSgAR/BHnz2D+tDaAIE=@vger.kernel.org X-Gm-Message-State: AOJu0Yz08Ol2ZpbGqlas/3EG8IGVikQLlJcImkMa7Gntd5pRDo49C1qG kjKSMRET42gWptkA78xDw+3al59jFLIOlTgXvMKYnaDOhZRpAfaB3NM= X-Gm-Gg: Acq92OHCHZ9UGzTJ/ofje/e4C39kgrGRwYsCHFhFB7ryEVjdisA8WCDNLokF5ZqAd1B j9yKYTt6hvfS32FOadey7GBQzHTbj6MSQwp1TkAo35TgRlvCXzsoGg9AlHcDC8KmzdX2+liujXr n+dup0tNdCO2BnqCpKJxq6/3rR/KompOD8ASJtV9hgmFDVStfzIaOPxE1ELox7zimhxOJTlRjnq AAM4FeZqeomK65w+ZnPwvizBaK2fvCq4fEy0+ZhBwHKz7jYxchpsMVLxJRcM1pgC80J+AdawvX7 GE7iTTNPODyKfv+sn2v53IOCqXgSFeDX7Su6aK5AX9BptN+qHwmb139yNRNGInJSlcclqjtLYQZ Dav6nq6x5kSsKt//R2D8iRtobgLdsSibzL1IEz4hyDXDlK5RaiOAOYytTYISCOWKExGbQE5gJpN yr8q6wNcBmNJou98hWbYJRSIXpg0Sv/Ku8vfhzIn4w7JnjSoc7p73tMYXFdxZjsYxGGBpO3mH/j 58b22/9JDbfjQz6RNTHSOPOMGvVPyWt3Fxae6SwjxkAGbJy6q/8fw== X-Received: by 2002:a17:906:8e0e:b0:bd1:d244:ca24 with SMTP id a640c23a62f3a-bd517861053mr429002166b.14.1778943158629; Sat, 16 May 2026 07:52:38 -0700 (PDT) Received: from nn ([2001:1ab8:1003:0:5454:f357:ba89:4e22]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-bd4f4bd0a40sm352858966b.12.2026.05.16.07.52.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 May 2026 07:52:38 -0700 (PDT) Sender: N B From: =?UTF-8?q?Nerijus=20Bend=C5=BEi=C5=ABnas?= To: Andrew Lunn , Heiner Kallweit Cc: Russell King , "Russell King (Oracle)" , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, regressions@lists.linux.dev, stable@vger.kernel.org Subject: [PATCH net v2] net: phy: skip EEE advertisement write when autoneg is disabled Date: Sat, 16 May 2026 17:52:20 +0300 Message-ID: <20260516145220.875871-1-nerijus.bendziunas@gmail.com> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260516114334.812828-1-nerijus.bendziunas@gmail.com> References: <20260516114334.812828-1-nerijus.bendziunas@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable genphy_c45_an_config_eee_aneg() writes the EEE advertisement to the auto-negotiation device's MMD register space (MDIO_MMD_AN, register MDIO_AN_EEE_ADV). These registers are read by the link partner only during auto-negotiation, so writing them while autoneg is disabled cannot influence the link. On some PHYs (e.g. Broadcom BCM54213PE) the write nevertheless reaches the chip and disturbs the receive datapath. Concretely, running ethtool -s eth0 speed 100 duplex full autoneg off ethtool --set-eee eth0 eee off leaves eth0 with TX working and RX completely silent on a Raspberry Pi 4 / CM4 board (bcmgenet + BCM54213PE in rgmii-rxid). Switching back to autoneg recovers the link. Prior to commit f26a29a038ee ("net: phy: ensure that genphy_c45_an_config_e= ee_aneg() sees new value of phydev->eee_cfg.eee_enabled"), the disable path was effectively a no-op because the helper read the stale eee_cfg.eee_enabled, so the underlying PHY behavior never surfaced. Bisected on rpi-6.12.y between commits 83943264 (good) and effcbc88 (bad) to f26a29a038ee. Fixes: f26a29a038ee ("net: phy: ensure that genphy_c45_an_config_eee_aneg()= sees new value of phydev->eee_cfg.eee_enabled") Cc: stable@vger.kernel.org Signed-off-by: Nerijus Bend=C5=BEi=C5=ABnas --- Changes since v1: - Reworded the inline comment and commit message: the MMD AN write is read by the chip with side-effects, not silently ignored. Suggested by Andrew Lunn. - Tightened the reproducer paragraph (was repeating paragraph 1). v1: https://lore.kernel.org/netdev/20260516114334.812828-1-nerijus.bendziun= as@gmail.com/ drivers/net/phy/phy-c45.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/net/phy/phy-c45.c b/drivers/net/phy/phy-c45.c index d48aa7231b37..126951741428 100644 --- a/drivers/net/phy/phy-c45.c +++ b/drivers/net/phy/phy-c45.c @@ -940,6 +940,14 @@ EXPORT_SYMBOL_GPL(genphy_c45_read_eee_abilities); */ int genphy_c45_an_config_eee_aneg(struct phy_device *phydev) { + /* Writing MMD AN advertisements while autoneg is disabled has no + * effect on link-partner negotiation, but on some PHYs (e.g. the + * Broadcom BCM54213PE) the write itself disturbs the receive + * datapath. Skip it. + */ + if (phydev->autoneg =3D=3D AUTONEG_DISABLE) + return 0; + if (!phydev->eee_cfg.eee_enabled) { __ETHTOOL_DECLARE_LINK_MODE_MASK(adv) =3D {}; =20 --=20 2.54.0