From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=185.246.84.56 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796382468; b=MU5hj1vxneSosKZdlRD8aTz6j+ZBodKM2hIEipmi/hT+kcQCPv3+fGS5ZU3BP4KELudJ UoOu8UV1TIExuS36ipx4MOysohGvqHiiFEfOY6/v7At+Rf2xFloTgkZIg3GuN1pr9H+z0 z8AF8m2ouVHCmf3fcVLpWjR7QuqTmgc3rep/BR68FWDqnKQJob/eAo1IImAs35HO5F1T4 6nq9TwG3O0zTxJ9iPuirJ9B+CkjkP9mvCCzOfZl6VV0yMmN3stBOqMMgjaNulXnVLvXIJ FvnC1Xu05NYN9rBZhUHxdgQl75TI5CDDkWvG2HmImC+8cBOihDUsmJ8qjqd2RMerlBA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796382468; 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=Uorag8LR926WUddDcJuXFFJReErbubNSLxk26Lf9W+Y=; b=AlHbrdBILSsx5fg6Aj9s0apq4bJHGGUVDZ9rSxVyzMuFpdr7gz1H+ofsmAHTwnFBGY/4 D7QcVCFXyaPVXZWaMHfxW11a1rKZbk/EXzcFXSYBNMbu6NiB8MQLmNAf1clfuGOPryIr5 ch+pyyMsYwIrvbpmwY03P2viZskjhsSpaSD43veXBuwQqNQGMhm+zm+G8vEh0vNTuaV6d KHT5n0En3mh43TgRHd3CwUxhEKROaO5wb8xto1EJyxG0WnQdE7/IlHZyhbNI2chocVWrz m+NPmyNV11j0/pSxzwn16fvXK4ZJ28lwQ0sujvE79vuZcQ0beYwzGFhfozeUI2PkpRA== 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=EWggkElF; arc=none smtp.remote-ip=185.246.84.56 Received: from smtpout-02.galae.net (smtpout-02.galae.net [185.246.84.56]) (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 8BECB606A32D; Fri, 4 Dec 2026 11:07:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 8BECB606A32D 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=EWggkElF Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id 4027B1A1949; 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-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 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