Article View: linux.kernel.netdev
Article #8737[PATCH iwl-net] ixgbe: fix swapped addr and devad in ixgbe_mii_bus_read_c45()
From: Zac Parker via B4 Relay
Date: Fri, 30 Oct 2026 01:12
Date: Fri, 30 Oct 2026 01:12
69 lines
13699 bytes
13699 bytes
From: Zac Parker <zac.parker@parcosta.com>
The MDIO core calls the read_c45 op of a struct mii_bus as
(bus, addr, devnum, regnum), but ixgbe_mii_bus_read_c45() declares its
parameters as (bus, devad, addr, regnum). The PHY address and the MMD
are therefore swapped on every clause 45 read through the ixgbe MDIO
bus. For example, a clause 45 SIOCGMIIREG read of register 1E.C820 on
PHY 0 (Global Thermal Status 1, the X550 junction temperature) is
issued to PHY 30, MMD 0 and returns 0. ixgbe_mii_bus_write_c45() and
the X550EM_a variants already use the order the core expects.
The generic ops are registered for every ixgbe device except X550EM_a,
so clause 45 SIOCGMIIREG requests on 82599, X540 and X550 devices are
affected. The driver's own PHY accesses go through hw->phy.ops.read_reg
rather than the MDIO bus, which is likely why this went unnoticed.
Fix the parameter order to match the mii_bus read_c45 prototype.
The bug was found by an AI coding assistant (Claude Opus 5.5) while
reading the junction temperature of an Intel X550-T2 (8086:1563, NVM
19.5.12) from user space on a Proxmox 7.0.14-based kernel. A clause 45
SIOCGMIIREG read of register 1.2 on PHY 0 returns 0, while the same
request with the PHY address and the MMD deliberately exchanged returns
the expected PHY identifier 0x0154, and register 1E.C820 then returns a
plausible temperature (about 45 C). Reproducing it needs no kernel
changes, only that user-space read.
The fix was build-tested on top of net-queue with allmodconfig and
allyesconfig at W=1, with no new warnings. It was also run-time tested
on the X550-T2 above, applied to the ixgbe driver of the Proxmox 7.0.14
kernel. With the fix, a clause 45 read of 1.2 on PHY 0 returns 0x0154
and 1E.C820 returns the temperature on both ports, while the exchanged
request now returns 0. The host then carried its normal traffic on the
patched driver for two hours at 2.5 Gbps, with no link drops, no driver
messages and no change in the receive drop rate.
Fixes: 308c8ffd5a7d ("ixgbe: Separate C22 and C45 transactions")
Signed-off-by: Zac Parker <zac.parker@parcosta.com>
---
drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c
index 1e52f6221..516856b3a 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c
@@ -832,11 +832,11 @@ static int ixgbe_mii_bus_read_c22(struct mii_bus *bus, int addr, int regnum)
/**
* ixgbe_mii_bus_read_c45 - Read a clause 45 register
* @bus: pointer to mii_bus structure which points to our driver private
- * @devad: device address to read
* @addr: address
+ * @devad: device address to read
* @regnum: register number
**/
-static int ixgbe_mii_bus_read_c45(struct mii_bus *bus, int devad, int addr,
+static int ixgbe_mii_bus_read_c45(struct mii_bus *bus, int addr, int devad,
int regnum)
{
struct ixgbe_adapter *adapter = bus->priv;
---
base-commit: b7e46a73815485bc5deb94945e50594a8bf6b499
change-id: 20261026-ixgbe-c45-fix-691ebe84b534
Best regards,
--
Zac Parker <zac.parker@parcosta.com>
Technical Details
Message-ID:
<20261029-ixgbe-c45-fix-v1-1-7eb38075a3d1@parcosta.com>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-353529-linux-kernel-netdev=dewy.ruShow Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-353529-linux-kernel-netdev=dewy.ru From: devnull+zac.parker.parcosta.com@kernel.org (Zac Parker via B4 Relay) Newsgroups: linux.kernel.netdev Subject: [PATCH iwl-net] ixgbe: fix swapped addr and devad in ixgbe_mii_bus_read_c45() Date: Thu, 29 Oct 2026 20:12:21 -0500 Organization: Usenet Network Message-ID: <20261029-ixgbe-c45-fix-v1-1-7eb38075a3d1@parcosta.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Injection-Info: usenet.network; logging-data="2136885"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:Zl1adj/A2JhE0yjs3wc39EQ7MXc= sha256:1rT8lE7alNaaD5gVroYg8iY0tkJaosPv85xVYr7YIrM= sha1:NLsQKyqMz1O8GVN8j4sdOcoEVS8= sha256:BG9L6pRKw4Wm6JZIw0i7FUzuGPCVTj3Hu7Q1oFijkEE= 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 B6E03125C77; Fri, 30 Oct 2026 04:13:13 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.401 X-Spam-Status: No, score=-3.401 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] 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 xWcfYlRxNiRh; Fri, 30 Oct 2026 04:13:06 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-353529-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 sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id 71D5C125C7C; Fri, 30 Oct 2026 04:12:57 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id 699E8281FB; Fri, 30 Oct 2026 01:12:31 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=3; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1793322751; b=pLDwDmnRvnZL/JUOrJzHugKw2N0R1yfN16MG90uypV8KeNIbx9ml3raWQHFoyD++H3iH JXCL6ZgsLkXjJ3VYX1vdMR3xKGk9kOYrYMyuyRu/ocgWjhRchw35X35N120hr3tuwTbNw hdDTvgFgEVwiJ0sz+F1BXbN5kWd2BNt8ml3yDdf7/CcAN1+VwqnUS6AqV8yfriN+snsVX m9ZIjyRSWbHzQBfWGuBhoPDjsBtI4cjTfVd2VWChd7zm9FDUpdJ8SGyePkfgwzJ/vQMn8 QGSO73MrJ9o1FLqVrI29f2dcxz0N22bUCTmPQ+kaEwf8I5v6lB0mgZND8EjPHexFaIg== X-ARC-Message-Signature: i=3; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793322751; h=X-Original-To:Received:Received:DKIM-Signature:Received:From:Date: Subject:X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe: List-Unsubscribe:List-Owner:Precedence:MIME-Version:Content-Type: Message-Id:X-B4-Tracking:X-Change-ID:To:Cc:X-Mailer: X-Developer-Signature:X-Developer-Key:X-Endpoint-Received: X-Original-From:Reply-To:Content-Transfer-Encoding; bh=MYsYTLL+AWZzeX3KKoIyGEzcXBXZoB0zYc1WsDnRnnA=; b=v5UQtE5nErbh0bBA9mAHsp/nR7hG/aNgwe/XsIrWgFc+RIm9bj/KugCkmZoLYjklPNFf snpmfUBjs8oD4KpOXlDz0Oqr8eOyftxm3R6/I7oNpLUeiFXFXLVASguNoHtbfduWzo904 FTE2pCyRpIeD8fnaWsmj35j7kYT87Ww9WQImtpdo/7b6tFd/8oeyC2/BMYdKOmdxM1awE L+rgB7jNYkrSvJQHIhlyfGkRIn4QIXaYPu1hj2pX42zQM5Guwn/oaeeEAPWTM187Iszg/ 9nppvq+xtlBF6QZHHtIFa6rV7qYq6mSIlth5Hof1cx4ZJUU7/QICFVZ/K/m3sVy4tYw== X-ARC-Authentication-Results: i=3; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=KjFLX0fP; arc=pass header.oldest-pass=0 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 40354606A330; Fri, 30 Oct 2026 01:12:31 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=KjFLX0fP X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=100.103.45.18 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1793322745; b=Z0Gw6lmg0OJskHFnlvFDFhkUqWBlydzRLvkXE0nGIyi4R6csNgzR5OyARqKcpM2xWamG WmrmHm/Dx4xyRyalTV51X8EiXYv2QtRHpkkHCLYRE3d0XnWEmlnRnbZK9/SzVZcgZJ6dX xpOrvL8K/WqpIYwoCvTm7cCnw5Dcnut0zD92MWz+LcKwyyX9IsuKhGajYIlicYiBCzyYj vy6TomP5tC9wesIBrhhmRb6hJjWLgxqCjY+UvKygQuhumRIPj884CdjlNRNyGKjcXu6Y0 kb13Y0iplvcmG/YWE7KMsj9YZyV4GwtY5+Y2onVMYT83PdPBj7uxA00AQAgsiFXshuA== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793322745; h=Received:DKIM-Signature:Received:From:Date:Subject:MIME-Version: Content-Type:Message-Id:X-B4-Tracking:X-Change-ID:To:Cc:X-Mailer: X-Developer-Signature:X-Developer-Key:X-Endpoint-Received: X-Original-From:Reply-To:Content-Transfer-Encoding; bh=MYsYTLL+AWZzeX3KKoIyGEzcXBXZoB0zYc1WsDnRnnA=; b=Kfyon2mxlQMA9xL6DUNX1vDUeMzzrmIENDpKzl86v7F48Hg8XFoq3A/+HbcczJnRtpg7 2eUWqAy54VkQrMyNOzKZ+A71nryw9TkF7fkmQQmx6Rwf0TIugrFfqX3OWfyOfnQw2GNvF DdT0JPsn7K54CtKWDz6mX4xPGueBkEKAerZ6cxO1uVAKL4FzGbP858+VGOXi8BOQzSNjT ACEnnlis+Oas8la8unKQZrKlrec9b2B0f+hVBN7pHoGjfIMkKNPfbA8sZztB8a3LooO9o +QaHVopO5/zHhoyZ7uXufvESErKC5z4vHWrtjsOPLLyrN6UmVUIQrntpZxxCW1NK0Ew== 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=KjFLX0fP; arc=pass header.oldest-pass=0 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 17536606A31F; Fri, 30 Oct 2026 01:12:25 +0000 (UTC) X-Authentication-Results: smtp.kernel.org; arc=none smtp.remote-ip=100.80.115.77 X-ARC-Seal: i=1; d=kernel.org; s=arc20260519; a=rsa-sha256; cv=none; t=1793322744; b=fDVsTumCS5jpT9cl3X98D+mKCUdyyeE9+/IEI7P+DkOBwtlKGWyR1ZP+Hy2ZvbfyxMGD ygNB5SBYuGYG6q91OkQMNhe5toquIGyflV2xtabShFnt+lEm9sOHbVXfPQu22QCkFBIMy rwbRksisFvtNltlrnhN7b5nP0aSBaXnefwUS1vlgtLvT7img2jxkPfovY4fHbr+YW5pi/ xGqXK5wpeFV4QymiWMbwPsX34QTgxRPVuxWZpmEDgKzPbWZ6ROtjnsAsH1IbtanvaJjoU dteBPdaJBYXcrdWrQuIIYLbKNkNB2tBhpx5Z3/9d+xZyR/wimlzROQd4JoSHhVvNPAw== X-ARC-Message-Signature: i=1; d=kernel.org; s=arc20260519; a=rsa-sha256; c=relaxed/relaxed; t=1793322744; h=DKIM-Signature:Received:From:Date:Subject:MIME-Version:Content-Type: Message-Id:X-B4-Tracking:X-Change-ID:To:Cc:X-Mailer: X-Developer-Signature:X-Developer-Key:X-Endpoint-Received: X-Original-From:Reply-To:Content-Transfer-Encoding; bh=MYsYTLL+AWZzeX3KKoIyGEzcXBXZoB0zYc1WsDnRnnA=; b=f/9HjkbTGkfu0ex/ai+GMzXhwhx84fX3tf3fLfzMEG6vZgyE3QMA7ZVuOYAHtvZRMwXB i2kB8rW7fCNiXbelG1FUpGBRrUYrcMLsJsgBvAC4RQphaHWte2gHdildzCFbVaPWloQsj 4s9ol2M8KF4DUC4BhNk+FfEZABNJLhF9OaxLFcNbaEuBdlAF2fi0TWz2qFqw3fBmNjYiz jX2dFN0RTXcysLpxp1/Woz2wyngbAlMlv48ZyYyHYoxbLaigxy48JBg+JIKLmP9nKkc/P EsXy1FRXSdC8SFU9yKxvZ5Zp0GdrTbk708CfPiMp4AcpF+TsSXFOGgX0TA3HPDSolTQ== X-ARC-Authentication-Results: i=1; smtp.kernel.org; arc=none smtp.remote-ip=100.80.115.77 X-Received: from lkml.kernel.org (nexus.subspace.kernel.org [100.80.115.77]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.kernel.org (Postfix) with ESMTPS id 650771F00919; Fri, 30 Oct 2026 01:12:24 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1793322744; bh=MYsYTLL+AWZzeX3KKoIyGEzcXBXZoB0zYc1WsDnRnnA=; h=From:Date:Subject:To:Cc:Reply-To; b=KjFLX0fPhTG2U1AMiTs1d6cFFCLur3mS92YzWZ61oWZf/x2Xab/2xWcN2DH/sWnDM GUhieDBAGqia8ArEhmkPkN81V6aiDf+XErlkxTmSo7cPw7OlFMQTiWc4GKC27sxJK+ quYWO2OtKP76DhduguNimu77DjWJMqHL1DwYnElB7T+lXtSClmceqJ9HOPDxwPQbfb iFqz32ckBgtUxPhDyOlMTSqw1d1H6MeoYNJCm6T/VIVZMUDEI4L1OdFb30LjA+eFGd AXlOkmGYKIQIbreLF7xq2uCF+IiDtvi93IWG5CZnHBXphxjNL5sFWCipZdki2OGAXM d2hgwZ2WVvv3A== X-Received: from nexus.subspace.kernel.org (localhost [IPv6:::1]) by lkml.kernel.org (Postfix) with ESMTP id EA3144306D; Fri, 30 Oct 2026 01:12:23 +0000 (UTC) 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 X-B4-Tracking: v=1; b=H4sIAAAAAAAC/yWMQQrCMBREr1Jm7QfTpkW9inTRxLF+kShJ1ULp3 f3qYhZvhnkLCrOy4FAtyHxp0XsycJsK8TKkkaInY9TbunMW0XkMlOhbOess3d4xcOdD23jY55F p9c93hL5vkjih/w/lGa6M09eGdf0A90QNOnoAAAA= X-Change-ID: 20261026-ixgbe-c45-fix-691ebe84b534 X-Cc: intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Zac Parker <zac.parker@parcosta.com> X-Mailer: b4 0.16.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1793322743; l=3232; i=zac.parker@parcosta.com; s=20261027; h=from:subject:message-id; bh=z0czBdN6SjMUZi5kUnXLmCozGwOhDcYhnx5BsNw9Jn4=; b=EkO7qzS2S3n8cCJx6iYzkYCq/lJ5zCgns+YJ+8yxWt/0k1fSpUkEXkCP0PAOFiDuQ5jI/GzA7 Ku2KhlLJzKVANx1qOaM/6wXMF6PWzT/SwssYmpJwxi4TU54rwuumeeJ X-Developer-Key: i=zac.parker@parcosta.com; a=ed25519; pk=G+DgShRR2xDJFWGYQ0W+5eRamZbUryODJ6T6/eQZeEc= X-Endpoint-Received: by B4 Relay for zac.parker@parcosta.com/20261027 with auth_id=1361 X-Original-From: Zac Parker <zac.parker@parcosta.com> X-Reply-To: zac.parker@parcosta.com