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 DA361606A683 for ; Fri, 4 Dec 2026 11:08:29 +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=YskQ3EC+; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.a=rsa-sha256 header.s=dkim header.b=EWggkElF 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=Uorag8LR926WUddDcJuXFFJReErbubNSLxk26Lf9W+Y=; b=YskQ3EC+UX0+ci HRlRPkMwDGSz9C8DNYb+fCMFCdqNnIPYkK7GbXbZ20XlowQUdHfih4OnymK2zS7l7WQbtQ1D18HAB tGwlFekGQmcJLyr2VKlrbHRCDBt3oKPStURbx42D6QCAWeJHbUzl0AfG2UvWLkk3k7OqaraIfgiDk OT8PhX0uj5C1Yn7GNwW3qkzWAAatDXhrLbSGTDYifROBUMAC2zw11bIXU/eGhYhKvAKI0lwJq7aeN +6k0516mxqDlJU6vJ0i3R6pHjUUuOhAxcocuLGOfYxtbH/r0tOZ+tM3+jk/rM8AEns/ND6hzg2ymn G8uNcA3pTFpJHl5Pcl4Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xZR9F-000000004aE-10DM; Fri, 04 Dec 2026 11:08:17 +0000 Received: from smtpout-03.galae.net ([185.246.85.4]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xZR8l-000000004Mi-3jwY for linux-arm-kernel@lists.infradead.org; Fri, 04 Dec 2026 11:07:50 +0000 Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id 401FF4E4185D; Fri, 4 Dec 2026 11:07:46 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id E2DCE6088A; Fri, 4 Dec 2026 11:07:45 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 6861111EA18ED; Fri, 04 Dec 2026 12:07:35 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1796382462; h=from:subject:date:message-id:to:cc:mime-version: content-transfer-encoding:in-reply-to:references; bh=Uorag8LR926WUddDcJuXFFJReErbubNSLxk26Lf9W+Y=; b=EWggkElF65/1tPNjummAkcf975EPXxgVixG6uhGnLrVYPs8GEwAsJBkNnVnksx5pevKNWf 4/1+plwe2zh+jwhr68Ln2vXXUC66q+J+iWz5wkHr/QiXWck++SmdteQSoYfZF7F+EUJhz3 fv/v2kzfvA7tWFjcbEkcUKiPg/T3H9yEJ0/4EH8+XytSCmHnOTCEfQIhgfYjNy21FQ850i NjZ1/J63mFDIL8KzhW/KVDfq6534M5eOpNlyZ31u4VjgICwEANxuDJVx90JCG2zuhVNZ+K 5enSn8aEXwUTT3fhn3NTSmhX/P+lU7xkYALIHUPbmkToLEsLlYIn5q9W7pwgdw== 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 08/12] net: phy: phy_mux: Add phy_mux_set_mac_managed_pm() Date: Fri, 4 Dec 2026 12:06:17 +0100 Message-ID: <20261204110622.1106492-9-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_030748_078560_EB7E7B33 X-CRM114-Status: GOOD ( 12.90 ) 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 MAC drivers that deal with the suspend/resume of their PHY on their own say so with the mac_managed_pm flag, that ends-up being set on the PHY when the MAC connects to it. With a mux, the PHYs are attached by the mux and the parent only gets to see the PHY of the selected port. The flag is needed on all of them though, as they are all attached to the netdev. Add a helper for the mux's parent to set the flag on all the PHYs behind the mux. Signed-off-by: Maxime Chevallier --- drivers/net/phy/phy_mux.c | 15 +++++++++++++++ include/linux/phy_mux.h | 5 +++++ 2 files changed, 20 insertions(+) diff --git a/drivers/net/phy/phy_mux.c b/drivers/net/phy/phy_mux.c index de3336970bd9..ed0bb8a3f429 100644 --- a/drivers/net/phy/phy_mux.c +++ b/drivers/net/phy/phy_mux.c @@ -413,6 +413,21 @@ void phy_mux_detach(struct phy_mux *mux) } EXPORT_SYMBOL_GPL(phy_mux_detach); +/** + * phy_mux_set_mac_managed_pm() - Leave the PM of the PHYs to the MAC driver + * @mux: The mux, attached + */ +void phy_mux_set_mac_managed_pm(struct phy_mux *mux) +{ + struct phy_mux_port *port; + unsigned long id; + + xa_for_each(&mux->ports, id, port) + if (port->attached) + port->phydev->mac_managed_pm = true; +} +EXPORT_SYMBOL_GPL(phy_mux_set_mac_managed_pm); + /** * phy_mux_start() - Start selecting ports * @mux: The mux, attached diff --git a/include/linux/phy_mux.h b/include/linux/phy_mux.h index 77cf389b8c77..00703371eea8 100644 --- a/include/linux/phy_mux.h +++ b/include/linux/phy_mux.h @@ -94,6 +94,7 @@ int fwnode_phy_mux_attach(const struct fwnode_handle *fwnode, void phy_mux_detach(struct phy_mux *mux); void phy_mux_start(struct phy_mux *mux); void phy_mux_stop(struct phy_mux *mux); +void phy_mux_set_mac_managed_pm(struct phy_mux *mux); struct fwnode_handle * fwnode_phy_mux_find_sfp_port(const struct fwnode_handle *fwnode); struct phy_mux_port *phy_mux_get_sfp_port(struct phy_mux *mux); @@ -121,6 +122,10 @@ static inline void phy_mux_stop(struct phy_mux *mux) { } +static inline void phy_mux_set_mac_managed_pm(struct phy_mux *mux) +{ +} + static inline struct fwnode_handle * fwnode_phy_mux_find_sfp_port(const struct fwnode_handle *fwnode) { -- 2.56.1