From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=185.171.202.116 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796382431; b=bQaQ51CXprKcI/a5lOrO8KeCArGG6lu8kAbqzm7XiXn4zdwfMaNJCIdcT4FeDTXa8aNF YymSLAIxE4tKZ1PBd6ry+J8uXCNv3wxdQS+9KZ4W4fP4vqrB5YwBsd1TUJ7hB0yq87kh8 O85eC7jJo2JPicVqXzG6ND2vXIVxquFlTbz4M95Eoc5RpLy/v42Ul2CtggI69RgQVgUu3 9yNtHKpdQl5Lf1o7d1pn8R9rpl5WvHegLmZpSk+FvelT+uuImKzi7RcNBTlFuwiDg7JgP +K5YVmm/PyvqTJndhw7pYfLYt2yoTaab5H/eWo+Glzb1Hcl5mCb1W9vJTrwWammeqJg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796382431; h=DMARC-Filter:Received:Received:Received:DKIM-Signature:From:To:Cc: Subject:Date:Message-ID:X-Mailer:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding:X-Last-TLS-Session-Version; bh=BPvTYyrmsk80415NOt+U3j+sbz/E/wmotBR3eA1iWJ8=; b=5UlgGxxPnxzUB2PWWJuAbMVcG0+n7/5YLFuwLD0yyvatluWJf8PTvCqR7FFh0nbDk8fc cvqgaCEHwemhDlZhJqtCAiPNAY99UHCqjBbV/xUVbkuoXdQE4ewmv4Tc92ERtvRi415jk 4w6+gjPiR0gpHtqd+8RpaiuvvnofsMhLa71zPx9JEEf39fDOkUg1wcIEGfrcB6B5KsW8R dgTvSPhjcdAHvm5sKiHNjt0dkB15wC3qKs6lnzb4woNssfZG8aZZZNT1mTkpRPOR8fegS aJMT0DKFOpikNSOlRBSFa/YForJ5eAQNPdqpQRL6sscsSloAOmWTwNgIkRUfjKPITlQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass header.d=bootlin.com header.i=@bootlin.com header.a=rsa-sha256 header.s=dkim header.b="cD/7fAmD"; arc=none smtp.remote-ip=185.171.202.116 Received: from smtpout-04.galae.net (smtpout-04.galae.net [185.171.202.116]) (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 3FA60606A338 for ; Fri, 4 Dec 2026 11:07:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 3FA60606A338 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.a=rsa-sha256 header.s=dkim header.b=cD/7fAmD 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-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Last-TLS-Session-Version: TLSv1.3 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