From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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.subspace.kernel.org (Postfix) with ESMTPS id 48FE6606A33B for ; Fri, 4 Dec 2026 11:07:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=sg3uWeB1; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.a=rsa-sha256 header.s=dkim header.b=cD/7fAmD DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Unsubscribe-Post: List-Owner; bh=BPvTYyrmsk80415NOt+U3j+sbz/E/wmotBR3eA1iWJ8=; b=sg3uWeB1bhZ707 9GmPIE7ejQR+LObhMW/6HiIiEX6C49UDuuH5y8VvzSXpwVjDI4DSbuKjNh82DeJcYBMI9z8hI243m oiOUZgCHK4ZUkbV6yurm1RMQ0BdKu+ACpzfN6/xsjoZTqwib1tGTh6jUFyyLtxlB/W+KEj5jxseoS vtem75ZgzYKQq/qgMJDVwjenr9Jf8k+zYUHgpDNEg4qpnsqRXG9zxlExIvNbk74ueL8h1ogG51YwZ ZbAXfyQRmPEzrONysbttfYerU5nU81+UVH2qGZ6cM7b3oqAnQSqmG88OZEJfVmsc1S7Kq9zuEyd9d BOJa/qGCp/FWp50G2nWQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xZR8Z-000000004Jw-3Zhj; Fri, 04 Dec 2026 11:07:35 +0000 Received: from smtpout-04.galae.net ([185.171.202.116]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xZR8C-000000004Ek-2PEX for linux-arm-kernel@lists.infradead.org; Fri, 04 Dec 2026 11:07:20 +0000 Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id 854CEC026D7; Fri, 4 Dec 2026 11:07:21 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 9AB52603C4; Fri, 4 Dec 2026 11:07:09 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id D01B811EA187F; Fri, 04 Dec 2026 12:07:00 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1796382426; h=from:subject:date:message-id:to:cc:mime-version: content-transfer-encoding:in-reply-to:references; bh=BPvTYyrmsk80415NOt+U3j+sbz/E/wmotBR3eA1iWJ8=; b=cD/7fAmDa/dJXlLfQYLLdviPodc8nIQG/VcdGFDqO4LRDMKitQ2FmvXDRlHhqvYf3elar1 NvRX9exzcDgsg2FlaLhKzyXVjKml8Un3XTKtD8Wmhsz3WR0D7znq3zyxH6xUmesbevB5+0 kVObEwyma0did8XA0pH5jo189aNeb/aMR5TxNx568l8sCm0bM4amzSBNEBOdsJGfgEqulD +Ujr2fsnlarSqbyTboVYBIUHT+aklWXPWdC4YM0Y764bEHPz4dL6CJeRUyq8TZWM/MNcf6 v/tWGWYTKxhHc1HF/tz0dfcrdwHpR6sdH9jtGygerdV0eKLKpa30woorvmfSJQ== From: Maxime Chevallier To: davem@davemloft.net, Andrew Lunn , Jakub Kicinski , Eric Dumazet , Willem de Bruijn , Paolo Abeni , Russell King , =?UTF-8?q?Marek=20Beh=C3=BAn?= , Sebastian Hesselbarth , Gregory Clement , Heiner Kallweit Cc: Maxime Chevallier , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, thomas.petazzoni@bootlin.com, devicetree@vger.kernel.org, Conor Dooley , Krzysztof Kozlowski , Rob Herring , Christophe Leroy , Herve Codina , Florian Fainelli , Vladimir Oltean , =?UTF-8?q?K=C3=B6ry=20Maincent?= , Oleksij Rempel , =?UTF-8?q?Nicol=C3=B2=20Veronese?= , Simon Horman , marcin.s.wojtas@gmail.com, Daniel Golle , Dimitri Fedrau , Frank Wunderlich , Pietro Ameruoso , Aleksei Sviridkin Subject: [PATCH net-next 03/12] net: phy: Don't create the sysfs links for PHYs behind a mux Date: Fri, 4 Dec 2026 12:06:12 +0100 Message-ID: <20261204110622.1106492-4-maxime.chevallier@bootlin.com> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204110622.1106492-1-maxime.chevallier@bootlin.com> References: <20261204110622.1106492-1-maxime.chevallier@bootlin.com> X-Archived-By: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Last-TLS-Session-Version: TLSv1.3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20261204_030719_497359_5BECC4A2 X-CRM114-Status: GOOD ( 14.40 ) X-Spam-Score: -2.1 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" X-Spam-Status: No, score=-19.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 The phy_mux framework allows attaching multiple PHYs to the same netdev, one of them being actively used at any given time. Attached phys create sysfs links in the netdev entry, pointing to the PHY. We can't have two of them (otherwise they'd overwrite one another), so let's just not create these. PHYs are still visible through the phy_link_topology API. Signed-off-by: Maxime Chevallier --- drivers/net/phy/phy_device.c | 3 ++- include/linux/phy.h | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index 60440b62e6c7..9630578a6a5c 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c @@ -2019,7 +2019,8 @@ int phy_attach_direct(struct net_device *dev, struct phy_device *phydev, */ phydev->sysfs_links = false; - phy_sysfs_create_links(phydev); + if (!phydev->mux_port) + phy_sysfs_create_links(phydev); if (!phydev->attached_dev) { err = sysfs_create_file(&phydev->mdio.dev.kobj, diff --git a/include/linux/phy.h b/include/linux/phy.h index f1b1ad1dd82f..a6cd2fc642ad 100644 --- a/include/linux/phy.h +++ b/include/linux/phy.h @@ -328,6 +328,7 @@ static inline long rgmii_clock(int speed) struct device; struct kernel_hwtstamp_config; struct phylink; +struct phy_mux_port; struct phy_port; struct sfp_bus; struct sfp_upstream_ops; @@ -618,6 +619,7 @@ struct phy_oatc14_sqi_capability { * @sfp_cage_port: The phy_port connected to the downstream SFP cage * @mod_port: phy_port representing the SFP module, if it is phy-less * @upstream_port: phy_port this PHY's MII attaches to, if any + * @mux_port: The mux port this PHY sits behind, if any * @attached_dev: The attached enet driver's device instance ptr * @adjust_link: Callback for the enet controller to respond to changes: in the * link state. @@ -814,6 +816,7 @@ struct phy_device { struct phy_port *sfp_cage_port; struct phy_port *mod_port; struct phy_port *upstream_port; + struct phy_mux_port *mux_port; struct phylink *phylink; struct net_device *attached_dev; struct mii_timestamper *mii_ts; -- 2.56.1