netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Birger Koblitz <mail@birger-koblitz.de>
To: Andrew Lunn <andrew+netdev@lunn.ch>,
	 "David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	 Jakub Kicinski <kuba@kernel.org>,
	Paolo Abeni <pabeni@redhat.com>,
	 Russell King <linux@armlinux.org.uk>,
	Andrew Lunn <andrew@lunn.ch>,
	 Heiner Kallweit <hkallweit1@gmail.com>
Cc: linux-usb@vger.kernel.org, netdev@vger.kernel.org,
	 linux-kernel@vger.kernel.org,
	Birger Koblitz <mail@birger-koblitz.de>,
	 Jianhui Xu <neuromoments@gmail.com>
Subject: [PATCH net-next v8 02/15] phylib: Add support for PHYs with broken forced mode
Date: Mon, 31 Aug 2026 11:58:51 +0200	[thread overview]
Message-ID: <20260831-ax88179a-v8-2-de905f2ee426@birger-koblitz.de> (raw)
In-Reply-To: <20260831-ax88179a-v8-0-de905f2ee426@birger-koblitz.de>

Add support for PHYs which only supported auto-negotiated
speed modes. This prevents a kernel warning and stack-trace within the
phy_state_machine when PHYs return -EOPNOTSUPP from config_aneg()
because they do not support forced modes.

Signed-off-by: Birger Koblitz <mail@birger-koblitz.de>
---
 drivers/net/phy/phy.c | 4 ++++
 include/linux/phy.h   | 1 +
 2 files changed, 5 insertions(+)

diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index fce9bc7be3304b408c9f3ec9b5b95c76d3680a88..b83f938fe7c3bd619ae453434fd9582c0a055a57 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -1190,6 +1190,10 @@ int phy_ethtool_ksettings_set(struct phy_device *phydev,
 	      duplex != DUPLEX_FULL)))
 		return -EINVAL;
 
+	if (autoneg == AUTONEG_DISABLE &&
+	    (phydev->drv->flags & PHY_BROKEN_FORCED))
+		return -EOPNOTSUPP;
+
 	mutex_lock(&phydev->lock);
 	phydev->autoneg = autoneg;
 
diff --git a/include/linux/phy.h b/include/linux/phy.h
index 199a7aaa341bfd9b13731e996a8de7e1aea586ff..8169c0b0fd28f3a52d2905611820ec8954383587 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -64,6 +64,7 @@ extern const int phy_basic_ports_array[3];
 #define PHY_RST_AFTER_CLK_EN	0x00000002
 #define PHY_POLL_CABLE_TEST	0x00000004
 #define PHY_ALWAYS_CALL_SUSPEND	0x00000008
+#define PHY_BROKEN_FORCED	0x00000010
 #define MDIO_DEVICE_IS_PHY	0x80000000
 
 /**

-- 
2.47.3


  parent reply	other threads:[~2026-08-31 10:08 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-31  9:58 [PATCH net-next v8 00/15] ax88179_178a: Add support for AX88179A-based chips Birger Koblitz
2026-08-31  9:58 ` [PATCH net-next v8 01/15] phylink: Add phylink_mac_interrupt Birger Koblitz
2026-08-31 14:15   ` Andrew Lunn
2026-08-31  9:58 ` Birger Koblitz [this message]
2026-08-31 14:21   ` [PATCH net-next v8 02/15] phylib: Add support for PHYs with broken forced mode Andrew Lunn
2026-08-31  9:58 ` [PATCH net-next v8 03/15] ax88179_178a: Fix endianness of pause watermark register Birger Koblitz
2026-08-31  9:58 ` [PATCH net-next v8 04/15] ax88179_178a: Split driver into library and device specific code Birger Koblitz
2026-08-31 14:22   ` Andrew Lunn
2026-08-31  9:58 ` [PATCH net-next v8 05/15] ax88179_178a: Add netdev2data() convenience function Birger Koblitz
2026-08-31  9:58 ` [PATCH net-next v8 06/15] ax88179_178a: Add HW support for AX179A-based chips Birger Koblitz
2026-08-31 14:30   ` Andrew Lunn
2026-08-31 16:03     ` Birger Koblitz
2026-08-31  9:58 ` [PATCH net-next v8 07/15] ax88179_178a: Add EEE configuration support for AX88179A MACs Birger Koblitz
2026-08-31  9:58 ` [PATCH net-next v8 08/15] ax88179_178a: Add EEE configuration support for AX88179A PHYs Birger Koblitz
2026-08-31  9:58 ` [PATCH net-next v8 09/15] ax88179_178a: Add VLAN offload support for AX88179A Birger Koblitz
2026-08-31  9:58 ` [PATCH net-next v8 10/15] ax88179_178a: Add AX179A/AX279 multicast configuration Birger Koblitz
2026-08-31  9:59 ` [PATCH net-next v8 11/15] ax88179_178a: Add Suspend/resume support for AX88179A/772D/279 Birger Koblitz
2026-08-31 14:32   ` Andrew Lunn
2026-08-31  9:59 ` [PATCH net-next v8 12/15] ax88179_178a: Add ethtool get_drvinfo Birger Koblitz
2026-08-31  9:59 ` [PATCH net-next v8 13/15] ax88179_178a: Update driver name and information Birger Koblitz
2026-08-31  9:59 ` [PATCH net-next v8 14/15] ax88179_178a: Add support for AX88179A/772D/279 EEPROM access Birger Koblitz
2026-08-31  9:59 ` [PATCH net-next v8 15/15] ax88796b: Add support for AX88772D, AX88179A and AX88279 Birger Koblitz
2026-08-31 14:38   ` Andrew Lunn
2026-08-31 17:28     ` Birger Koblitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260831-ax88179a-v8-2-de905f2ee426@birger-koblitz.de \
    --to=mail@birger-koblitz.de \
    --cc=andrew+netdev@lunn.ch \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=neuromoments@gmail.com \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).