๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #16900

Re: [PATCH net-next v21 02/13] phylib: Add support for PHYs with broken forced mode

#16900
From: netdev-bot+sashiko
Date: Mon, 16 Nov 2026 02:06
81 lines
10681 bytes
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.

Low priority / nit picks for your consideration:

- [Low] The concern: PHY_BROKEN_FORCED (include/linux/phy.h:67) has no
  user at this commit, so the checks in phy_ethtool_ksettings_set()โ€ฆ

--

phylib: Add support for PHYs with broken forced mode

This adds a PHY_BROKEN_FORCED driver flag. With it set,
phy_ethtool_ksettings_set() and phy_mii_ioctl() return -EOPNOTSUPP when
someone asks for a forced speed/duplex mode. The aim is to avoid the
warning in the PHY state machine when config_aneg() rejects forced mode.

> diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
> index fce9bc7be3304..079c53516f424 100644
> --- a/drivers/net/phy/phy.c
> +++ b/drivers/net/phy/phy.c

[ ... ]

> @@ -1190,6 +1193,10 @@ int phy_ethtool_ksettings_set(struct phy_device *phydev,
>  	      duplex != DUPLEX_FULL)))
>  		return -EINVAL;
>  
> +	if (autoneg == AUTONEG_DISABLE && phydev->drv &&
> +	    (phydev->drv->flags & PHY_BROKEN_FORCED))
> +		return -EOPNOTSUPP;
> +

[Severity: Low]
No driver sets PHY_BROKEN_FORCED at this commit. Doesn't that mean this
check, and the matching one in phy_mii_ioctl(), can't trigger yet?

The commit message says:

  This prevents a kernel warning and stack-trace within the
  phy_state_machine when PHYs return -EOPNOTSUPP from config_aneg()

Later in the series, "ax88796b: Add support for AX88772D, AX88179A and
AX88279" sets the flag on the AX88279 entry. That driver's
asix_ax88279_config_aneg() returns -EOPNOTSUPP when autoneg is disabled,
so the description is accurate once that patch is applied.

Would it help to say in the commit message that the first user comes
later in the series?

Separately, two existing drivers already reject forced mode in
config_aneg(), but they return -EINVAL:

drivers/net/phy/bcm84881.c:bcm84881_config_aneg() {
    ...
	/* disabled autoneg doesn't seem to work with this PHY */
	if (phydev->autoneg == AUTONEG_DISABLE)
		return -EINVAL;
    ...
}

drivers/net/phy/air_en8811h.c:en8811h_config_aneg() {
    ...
	if (phydev->autoneg == AUTONEG_DISABLE) {
		phydev_warn(phydev, "Disabling autoneg is not supported\n");
		return -EINVAL;
	}
    ...
}

These two still reach the warning through
_phy_state_machine()->_phy_start_aneg()->phy_error_precise(). This
patch didn't cause that, and converting them could be a separate
follow-up.

Would these two drivers be good candidates for the new flag?

-- 
Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261114-ax88179a-v21-0-c2d34410bcbe%40birger-koblitz.de
Technical Details
Message-ID: <179479481380.3136.17048496149036079912@kernel.org>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-363987-linux-kernel-netdev=dewy.ru
References: <20261114-ax88179a-v21-2-c2d34410bcbe@birger-koblitz.de>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-363987-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v21 02/13] phylib: Add support for PHYs with
 broken forced mode
Date: Mon, 16 Nov 2026 02:06:53 +0000
Organization: Usenet Network
Message-ID: <179479481380.3136.17048496149036079912@kernel.org>
References: <20261114-ax88179a-v21-2-c2d34410bcbe@birger-koblitz.de>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="1956338"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:uBE76ccCMS93mpeno4DtHHKXttQ= sha256:tHab+zD1DobDCI6xMZTD3Rmu18vF7tmEiJNODSEV3pg=
	sha1:BLaKtOd0I3/k2Yc+hfYFcNKRBN8= sha256:gTC+xapUe7vxu3UCMcZUkojD8i/ZJ0Ch+ovGcJuN/Zc=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id A4408114AF1; Mon, 16 Nov 2026 05:07:30 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.4
X-Spam-Status: No, score=-3.4 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1,
	DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=kernel.org
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id PrlWLgK2qAF3;
	Mon, 16 Nov 2026 05:07:27 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-363987-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id D86BC114AF2; Mon, 16 Nov 2026 05:07:17 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by tor.lore.kernel.org (Postfix) with ESMTP id F3AD72EA25; Mon, 16 Nov 2026 02:07:12 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=fail;
	t=1794794816;
	b=rFLkukz3A8glPsoNBH2/xFQXKZafQ+6hJgLC6t9FEmgH0DWd1fXEeDluCFKLdeMi4359
	 l25jqhbxcTKtYbVNaAlSfT5ntC/FFeGbaZyu0Ecn6RWtrv7wp/0NA0Ut+GXVwq8PM2YAv
	 AAw7i67UBt956dkZkY3T+Gl6oOGrHpEbO0xZ25BTb5qkK/JSm6Oc05c+EwdT9wK9GSRzV
	 abe/sl4JrebDGYMPEFlX0vTj9RkPEpebI6RXpwbLf6TkdArw/Xs53Z05/+2JRRg8jQgAa
	 3ERn3hsTdgoX7RUC/rPN1j3to5o+CICBpXafKW0a0IddXdGBfFMJAo8hAzjGqXX8xXQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794794816;
	h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc:
	 Date:Message-ID:In-Reply-To:References:X-sashiko-severity:
	 Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id:
	 List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
	 Precedence:MIME-Version;
	bh=p59Nqouvw/Y1Hsysnv6GrIlTxTq1/nSacS9ypF2MY2w=;
	b=EhpFwIKkhVgVuY9wx+RhFe2DtDAB4F3K8evjoiWVFylCcJPEJQVwkunX2BS1NPhREDq9
	 QMbZYI0w61ErN4kgM/04RDv7G3+T0Y4FHYWczm0TzO0mdTSN7P5WYcEskkHAKU1mlbAP6
	 weMVgh3Ljk39Jw+d1X5AY39xzMLcgD+Ec6ls15V7mOgYUO6I8qYmKXU/vwIt3AufXrijx
	 Dapqi+EzP6baDf85HI2q9ne/tA7d9kv4DpT4D2kITL9ZchngpLPgk1LNykYHzhTAkEQOm
	 IF3McS89gEgwxY+SR7da+czGZzRTdPAkZb33vYAzWmmQInHBG9Kj0EBx4703bwzqngg==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=GAXW23yN;
	arc=fail smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 468F8606A330;
	Mon, 16 Nov 2026 02:06:56 +0000 (UTC)
X-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=GAXW23yN
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1794794815;
	b=iTpZvVytkaIfI0LRH6F9LxqD5EeXPSHUQMJ0XXnr8h11zqn852/hA1EOcFRhTydRXQi/
	 keJ1dFSyREVxrz7hJ8PJ5xqBeDXK93S556zkmIBEWNicpxwDp+aQYQNKAm5s0taiEJ8D7
	 Q5yQOmpQrIYd3eqqqJJqXRt/sTI6U1X0qDYeOKNZ/kq23fKKTYXEop3TccpNC2Hnq4/yD
	 CBIBp2LBQoVG9AaJnfBQLiic5NGwMbCb1xSucdyhompfnjeVnzCqZ/Pkv9LLdb7ib0qza
	 PQeJtmf65l80Onuwr1lRDay0J9P+Dq3Wc6MmmO/mL6Nk1jnebZjGmC8dusVNf7JlMkg==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794794815;
	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=p59Nqouvw/Y1Hsysnv6GrIlTxTq1/nSacS9ypF2MY2w=;
	b=U4or1yBkt9KuK5cMjB+dlfStF5wyqu5eB/nO0xJE/R77olQA1PwBzlvDdV0wqYqa+OXF
	 dGIJVE3xXjd8hvmBrFQUO0uFdiYq4H+HCFkbxMsQCtcsWbCL6y7T85PDvVdnKjlfI4z1E
	 FrKyf98JX17vJNhhiWrKd1BWjYvVfz+EUddWPo4DaLNZPHYUtQTspBSv0W0/X1tTT04Fs
	 KpEWOq+ymBpsSgy8NvsBBgp5S/ACkyfsEeQpwroGISCgHd8vSLD7DPlPHc3JkRqCjrAEq
	 lzqo62d+6xXwud0/fxKx2Ce0RG51Q+DlUZqNSxaU20Kwb5XMBxE/7yZyNrssr6L1+ww==
X-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=GAXW23yN;
	arc=none smtp.remote-ip=100.103.45.18
X-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 664D6606A33D;
	Mon, 16 Nov 2026 02:06:55 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 467FB1F000C4;
	Mon, 16 Nov 2026 02:06:54 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1794794815;
	bh=p59Nqouvw/Y1Hsysnv6GrIlTxTq1/nSacS9ypF2MY2w=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=GAXW23yNnUCBjktD2KR5Vfg9h2mHf8YFP5EK+o7QAXMFSdaZRtWJ7dtoZZgkZefDV
	 0IYSpGoWXng+VicqzZo4QSS2gNQve/ghd0dOD68/nT9NtCont4gybmqSe3juLi6n+Z
	 vtIVStIVUTiEd2dvQUF3UibNJTzfpZ5EqA9ugEiH5+Xt2clsjWzALWW1Z0UdPJnzue
	 8WfK2iRnKLrwXRM2GeYa9114XQ2bs81N9OcDsK84fFqcd2L0ulanxfVhEDfICbnuf2
	 9nCazeRqj52t7zTkbCyOP8K3J5KDDqt6+a0kNA4wHdomb7qqTfgKlsuL2q/kDX+3Ue
	 J0SbUUBj25guA==
X-Cc: andrew+netdev@lunn.ch, davem@davemloft.net, kuba@kernel.org,
 pabeni@redhat.com, linux@armlinux.org.uk, andrew@lunn.ch,
 hkallweit1@gmail.com, chenhuacai@kernel.org, kernel@xen0n.name,
 edumazet@kernel.org, linux-usb@vger.kernel.org, netdev@vger.kernel.org,
 linux-kernel@vger.kernel.org, loongarch@lists.linux.dev,
 neuromoments@gmail.com, beganovic.emir@gmail.com
X-In-Reply-To: <20261114-ax88179a-v21-2-c2d34410bcbe@birger-koblitz.de>
X-sashiko-severity: Low
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list