From patchwork Mon Feb 10 10:53:55 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 13967699 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CCFC4C02198 for ; Mon, 10 Feb 2025 11:13:23 +0000 (UTC) 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:Date:Message-Id:Content-Type :Content-Transfer-Encoding:MIME-Version:Subject:Cc:To:From:References: In-Reply-To:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=yWW2R/eIUnaCG5KFk31L8+3OD/t74tjs9HU32ej/AvQ=; b=NPORUix9tG9Q8IKW+7ezg7EyoA Ya/8k9DMnZLXwodbA6ddRgtuexfWjaPCtDVihSJzhRDBLrwc+xlII0BRkrCmADOYEQnbeNB2FS5c7 LX04AA2hfTHSL3ur2wgT1JyGIWLfXkHn0V0v9LSVVXqLzFMV4PktglVoeJjPxOLi93CKjCEZI1HNM ig745KjWpeXTdat2ZkxIpWndFAh2ScJCooxZZ4CJOLRyY3SCGLeujL9D5txYPgqNy+tWFUVsjRrA3 4yUvLKc2sbCVKypozGovbpsuzV02lmL1Ev8FL9OFoTynF7RZ9Me6NHhijpqn/tbyr1zaSjk1pLP/t TnfD8nMg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1thRiy-0000000HAde-2ZMy; Mon, 10 Feb 2025 11:13:12 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1thRQh-0000000H6BI-1cut for linux-arm-kernel@lists.infradead.org; Mon, 10 Feb 2025 10:54:20 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Date:Sender:Message-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Subject:Cc:To:From:References: In-Reply-To:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=yWW2R/eIUnaCG5KFk31L8+3OD/t74tjs9HU32ej/AvQ=; b=JpAZyLckK548hoeVwBF637KIyj ZHNJdPHoLPSWjAQ17dcGbDtJQNXg66p8AiEl/kNpGYWNSV8bCzELstrBL+qvPTDe4neSMi5lkJkFA 1q/TQHJnu/Jq1FhLrr+6vSlfC3R1bJNc0GFwx2+O6i7nn4cEvc2Bdw+UalqjbWBcrJshViwaiNJ3o fEUlDh4rCgDccBBUXNKjzEBWPDSOpjQ0LJkpi6a3BpSpb5hgTT1K6BbgbVeKFaKznsIsjcutxRHw0 wfomRmbwW8G/XnqWl7wIECWS0/lWes2CZ+tAF39DmR3OUAw2qEbXWljx6RkcobSjU3l39PlYPkf6s 0IV47JOg==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:48426 helo=rmk-PC.armlinux.org.uk) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1thRQc-0006W1-2U; Mon, 10 Feb 2025 10:54:14 +0000 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1thRQJ-003w7C-6v; Mon, 10 Feb 2025 10:53:55 +0000 In-Reply-To: References: From: "Russell King (Oracle)" To: Andrew Lunn , Heiner Kallweit Cc: Alexandre Torgue , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, Maxime Coquelin , netdev@vger.kernel.org, Paolo Abeni Subject: [PATCH net-next 4/8] net: xpcs: convert to phylink managed EEE MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Mon, 10 Feb 2025 10:53:55 +0000 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250210_025419_423715_172D870E X-CRM114-Status: GOOD ( 11.84 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Convert XPCS to use the new pcs_disable_eee() and pcs_enable_eee() methods. Since stmmac is the only user of xpcs_config_eee(), we can make this a no-op along with this change. Signed-off-by: Russell King (Oracle) --- drivers/net/pcs/pcs-xpcs.c | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/drivers/net/pcs/pcs-xpcs.c b/drivers/net/pcs/pcs-xpcs.c index 91ce4b13df32..1f312b5589a3 100644 --- a/drivers/net/pcs/pcs-xpcs.c +++ b/drivers/net/pcs/pcs-xpcs.c @@ -602,7 +602,8 @@ static void xpcs_get_interfaces(struct dw_xpcs *xpcs, unsigned long *interfaces) __set_bit(compat->interface, interfaces); } -int xpcs_config_eee(struct dw_xpcs *xpcs, int mult_fact_100ns, int enable) +static int __xpcs_config_eee(struct dw_xpcs *xpcs, int mult_fact_100ns, + int enable) { u16 mask, val; int ret; @@ -630,6 +631,11 @@ int xpcs_config_eee(struct dw_xpcs *xpcs, int mult_fact_100ns, int enable) DW_VR_MII_EEE_TRN_LPI, enable ? DW_VR_MII_EEE_TRN_LPI : 0); } + +int xpcs_config_eee(struct dw_xpcs *xpcs, int mult_fact_100ns, int enable) +{ + return 0; +} EXPORT_SYMBOL_GPL(xpcs_config_eee); static void xpcs_pre_config(struct phylink_pcs *pcs, phy_interface_t interface) @@ -1193,6 +1199,20 @@ static void xpcs_an_restart(struct phylink_pcs *pcs) BMCR_ANRESTART); } +static void xpcs_disable_eee(struct phylink_pcs *pcs) +{ + struct dw_xpcs *xpcs = phylink_pcs_to_xpcs(pcs); + + __xpcs_config_eee(xpcs, 0, false); +} + +static void xpcs_enable_eee(struct phylink_pcs *pcs) +{ + struct dw_xpcs *xpcs = phylink_pcs_to_xpcs(pcs); + + __xpcs_config_eee(xpcs, xpcs->eee_mult_fact, true); +} + /** * xpcs_config_eee_mult_fact() - set the EEE clock multiplying factor * @xpcs: pointer to a &struct dw_xpcs instance @@ -1355,6 +1375,8 @@ static const struct phylink_pcs_ops xpcs_phylink_ops = { .pcs_get_state = xpcs_get_state, .pcs_an_restart = xpcs_an_restart, .pcs_link_up = xpcs_link_up, + .pcs_disable_eee = xpcs_disable_eee, + .pcs_enable_eee = xpcs_enable_eee, }; static int xpcs_identify(struct dw_xpcs *xpcs)