From patchwork Sun Feb 4 12:13:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 13544641 X-Patchwork-Delegate: kuba@kernel.org Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [78.32.30.218]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 084312230C for ; Sun, 4 Feb 2024 12:13:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=78.32.30.218 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707048797; cv=none; b=UD4RjN5XBGciTUMLslK9lao7omVebldzF10grBWIv3p1GvMRTj3rL1uLnm5l2Qa6g3IePiTLB3v5ZCTqXC/ilIzDPBggaA6YX/5DHDUrrKteOpnA6cdHgWsY2epqHuGaK6GO5QdsHyK7HfgQHuMx7M4XF0KE1dXTRNTkVW7ANsU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707048797; c=relaxed/simple; bh=iit7EVEbjSF4MpIqoLBpg8LtBq1xpqRXFgRC5EHgCSg=; h=In-Reply-To:References:From:To:Cc:Subject:MIME-Version: Content-Disposition:Content-Type:Message-Id:Date; b=FkaIkO85OM0Se22z07AHh/9qV6iLPk0ehJaj7bZK/RjyJhxGtlkUFVNVPTFcW9TyelSTv97GhrZ+IHeGt1Fq6VjB9YQHOJkEn1tSy694v9bJJaIvLvp3cj7Lel5Oz9YnPCwe1ZOveEDZnsquVycsWrn9gmpTT6M35cjrhUfT6hg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk; spf=none smtp.mailfrom=armlinux.org.uk; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b=xLyOxf3j; arc=none smtp.client-ip=78.32.30.218 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="xLyOxf3j" 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=9TY+u62AIM3bIGhcSG/JvkNxj/XTkNruEmxy2Od3+9o=; b=xLyOxf3jDB9kplfJSOsQvCLQJY 1nDryOf3Z6rODzM8WNjEQd1EeJQsohnR2+R13DkAQ3B7s41NxwBSulPRYnOvDQRF5VCRCK8jYfDw8 xi0iWThDgMJXc72FC8kcWcilFfIU2yOLWct+hp+3D08hQy08k0U0xhGMgVNuTEzgeRNKYsx0Ae0kZ C4/oAhc5NthxmqvcQtS87bYEMZDjjR/KhhwBgIzZUCZeoj200pHE/6ljiN7jTrHqGzTi1g/LdaCK0 qRmi3g24Lkkjv0Am4TA9DfY3FkImMFLriKdgXr/k2wcV7LXUAKE9tdATrtkJyOirFAfc4BfXgFstb rfWoQGjg==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:56012 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 1rWbMt-0007vf-1K; Sun, 04 Feb 2024 12:13:03 +0000 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1rWbMs-002cCV-EE; Sun, 04 Feb 2024 12:13:02 +0000 In-Reply-To: References: From: "Russell King (Oracle)" To: Andrew Lunn , Heiner Kallweit Cc: Alexandre Torgue , bcm-kernel-feedback-list@broadcom.com, Broadcom internal kernel review list , Byungho An , Clark Wang , "David S. Miller" , Doug Berger , Eric Dumazet , Florian Fainelli , Jakub Kicinski , Jose Abreu , Justin Chen , linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, Maxime Coquelin , netdev@vger.kernel.org, NXP Linux Team , Paolo Abeni , Shenwei Wang , Vladimir Oltean , Wei Fang Subject: [PATCH net-next v2 1/6] net: stmmac: remove eee_enabled/eee_active in stmmac_ethtool_op_get_eee() Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline Message-Id: Sender: Russell King Date: Sun, 04 Feb 2024 12:13:02 +0000 X-Patchwork-Delegate: kuba@kernel.org stmmac_ethtool_op_get_eee() sets both eee_enabled and eee_active, and then goes on to call phylink_ethtool_get_eee(). phylink_ethtool_get_eee() will return -EOPNOTSUPP if there is no PHY present, otherwise calling phy_ethtool_get_eee() which in turn will call genphy_c45_ethtool_get_eee(). genphy_c45_ethtool_get_eee() will overwrite eee_enabled and eee_active with its own interpretation from the PHYs settings and negotiation result. Thus, when there is no PHY, stmmac_ethtool_op_get_eee() will fail with -EOPNOTSUPP, meaning eee_enabled and eee_active will not be returned to userspace. When there is a PHY, eee_enabled and eee_active will be overwritten by phylib, making the setting of these members in stmmac_ethtool_op_get_eee() entirely unnecessary. Remove this code, thus simplifying stmmac_ethtool_op_get_eee(). Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli Signed-off-by: Russell King (Oracle) Reviewed-by: Serge Semin --- drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c index bbecb3b89535..411c3ac8cb17 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c @@ -859,8 +859,6 @@ static int stmmac_ethtool_op_get_eee(struct net_device *dev, if (!priv->dma_cap.eee) return -EOPNOTSUPP; - edata->eee_enabled = priv->eee_enabled; - edata->eee_active = priv->eee_active; edata->tx_lpi_timer = priv->tx_lpi_timer; edata->tx_lpi_enabled = priv->tx_lpi_enabled; From patchwork Sun Feb 4 12:13:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 13544642 X-Patchwork-Delegate: kuba@kernel.org Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [78.32.30.218]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 24821224C7 for ; Sun, 4 Feb 2024 12:13:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=78.32.30.218 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707048803; cv=none; b=nTVxgrfvW7xOU+lp5H/xkW0AWfuIigTohLfxG6S7sO7WwCN8rDY2o9yZj53IEfLFnCM/3nmp4mToHbqmhjAl6J78VsZcBXXrL4VO2b2bBh7N9EHI1JVftqQ04HUxV9Ioj60AIod/dCJ+4tSQOXLVIn1nKie8SmUl462jdWlQuDg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707048803; c=relaxed/simple; bh=FkglyUFLVGmgzghevLu312fm+xgqILeVVXK2NfkgNQs=; h=In-Reply-To:References:From:To:Cc:Subject:MIME-Version: Content-Disposition:Content-Type:Message-Id:Date; b=L046e6dKocjoYOziHwANxnd/VPeC8VH7DYESEf8/fLImSWHJVtvJnwBCVfJWxQwpccBCWTd2PBcGxK22gAmtEcRxf3pTn77Cw4PC7eYQwXtk3pPt9SgaWuHEh05oeAwPeKXPaYS/I+B+Yd9xsMBAprRG0WzObB1Nw4ElC1nRwBs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk; spf=none smtp.mailfrom=armlinux.org.uk; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b=TGhkSIN8; arc=none smtp.client-ip=78.32.30.218 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="TGhkSIN8" 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=SyevgUi2ILXbA7HnAxNwt9Z0WARK1WXsvJNPF6r31mA=; b=TGhkSIN8AK0mEzgsm+0WduSUtT 0Lpzr26do4PDSHZNO7OiTXR9Y7x8V9KzFHkD078l1vdETfYvbll9fVlejdGOZ6Qie7opGiKYkj0EW V05WfQ1kzRcZqGuKvaGCF9cmQlfjvjK9Ht9ZAgw9UGj3LJ/7lTUuwUPvnLZItvpA4k311+SLD+mHR Rxms0Yc3iMU1zgEtPXjicfDP2/9UWa1/hupjrOvqhxeppfIFvUsFE7xmLIW8fXTAhBILeVjKRaBdd OTPjvXeQcQ3iYQIWoL8ml6N0vFlpEfNit0OqvVIibflHR/WeQH/MfoJ85q3fMAGDLqWhZo2g8OLoP e5IzOUXg==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:56018 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 1rWbMy-0007vx-1z; Sun, 04 Feb 2024 12:13:08 +0000 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1rWbMx-002cCb-IU; Sun, 04 Feb 2024 12:13:07 +0000 In-Reply-To: References: From: "Russell King (Oracle)" To: Andrew Lunn , Heiner Kallweit Cc: Alexandre Torgue , bcm-kernel-feedback-list@broadcom.com, Broadcom internal kernel review list , Byungho An , Clark Wang , "David S. Miller" , Doug Berger , Eric Dumazet , Florian Fainelli , Jakub Kicinski , Jose Abreu , Justin Chen , linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, Maxime Coquelin , netdev@vger.kernel.org, NXP Linux Team , Paolo Abeni , Shenwei Wang , Vladimir Oltean , Wei Fang Subject: [PATCH net-next v2 2/6] net: sxgbe: remove eee_enabled/eee_active in sxgbe_get_eee() Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline Message-Id: Sender: Russell King Date: Sun, 04 Feb 2024 12:13:07 +0000 X-Patchwork-Delegate: kuba@kernel.org sxgbe_get_eee() sets edata->eee_active and edata->eee_enabled from its own copy, and then calls phy_ethtool_get_eee() which in turn will call genphy_c45_ethtool_get_eee(). genphy_c45_ethtool_get_eee() will overwrite eee_enabled and eee_active with its own interpretation from the PHYs settings and negotiation result. Therefore, setting these members in sxgbe_get_eee() is redundant. Remove this, and remove the priv->eee_active member which then becomes a write-only variable. Reviewed-by: Andrew Lunn Signed-off-by: Russell King (Oracle) --- drivers/net/ethernet/samsung/sxgbe/sxgbe_common.h | 1 - drivers/net/ethernet/samsung/sxgbe/sxgbe_ethtool.c | 2 -- drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c | 1 - 3 files changed, 4 deletions(-) diff --git a/drivers/net/ethernet/samsung/sxgbe/sxgbe_common.h b/drivers/net/ethernet/samsung/sxgbe/sxgbe_common.h index d14e0cfc3a6b..1458939c3bf5 100644 --- a/drivers/net/ethernet/samsung/sxgbe/sxgbe_common.h +++ b/drivers/net/ethernet/samsung/sxgbe/sxgbe_common.h @@ -503,7 +503,6 @@ struct sxgbe_priv_data { bool tx_path_in_lpi_mode; int lpi_irq; int eee_enabled; - int eee_active; int tx_lpi_timer; }; diff --git a/drivers/net/ethernet/samsung/sxgbe/sxgbe_ethtool.c b/drivers/net/ethernet/samsung/sxgbe/sxgbe_ethtool.c index d93b628b7046..4a439b34114d 100644 --- a/drivers/net/ethernet/samsung/sxgbe/sxgbe_ethtool.c +++ b/drivers/net/ethernet/samsung/sxgbe/sxgbe_ethtool.c @@ -140,8 +140,6 @@ static int sxgbe_get_eee(struct net_device *dev, if (!priv->hw_cap.eee) return -EOPNOTSUPP; - edata->eee_enabled = priv->eee_enabled; - edata->eee_active = priv->eee_active; edata->tx_lpi_timer = priv->tx_lpi_timer; return phy_ethtool_get_eee(dev->phydev, edata); diff --git a/drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c b/drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c index 71439825ea4e..ecbe3994f2b1 100644 --- a/drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c +++ b/drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c @@ -130,7 +130,6 @@ bool sxgbe_eee_init(struct sxgbe_priv_data * const priv) if (phy_init_eee(ndev->phydev, true)) return false; - priv->eee_active = 1; timer_setup(&priv->eee_ctrl_timer, sxgbe_eee_ctrl_timer, 0); priv->eee_ctrl_timer.expires = SXGBE_LPI_TIMER(eee_timer); add_timer(&priv->eee_ctrl_timer); From patchwork Sun Feb 4 12:13:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 13544643 X-Patchwork-Delegate: kuba@kernel.org Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [78.32.30.218]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A098822627 for ; Sun, 4 Feb 2024 12:13:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=78.32.30.218 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707048809; cv=none; b=KstFNUyjDh1His85/s0HNGHbYW+DP5j/gNWFhXHMo5085E7etfW0YPV3lqy0tlG8VbZL6vtIOh0Y2Me1z0f1EUSru3kSaQ1SncUFDKssNSmwMDI24sIG5BDwpfSxUrPJjyPOY8QZbSgGaNQIw8Av4htePzz8wT6CsWimWcQ0DhA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707048809; c=relaxed/simple; bh=bkdHMEh+qJqoKb346Grsmt3QHErcD0aiPN+hdRyu0iM=; h=In-Reply-To:References:From:To:Cc:Subject:MIME-Version: Content-Disposition:Content-Type:Message-Id:Date; b=rq8CslnuPKNtzcgV8+JkawdORa+sB9fyp0Vr4bZ6Q5wyNO04KjNPI434leqOMMqPuhTJnb82hI9D1yS/qmgN5hMzD0gUMa7uIHeZ4V5UhsVUpdLDnU79NE9ObfF5aMIN4m8r4iE87Q2xW4HDZnbKe/GSC2pjJYY323z2WR7gQTc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk; spf=none smtp.mailfrom=armlinux.org.uk; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b=mSiogrBI; arc=none smtp.client-ip=78.32.30.218 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="mSiogrBI" 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=h2e2qQbupPLjDt7RKJD14LZY6ZDC/UDMiQaHqNdcgDc=; b=mSiogrBIUuUXYfEHNmMb9pCKXX qjt2VTB8BwJmk8LtOiCuIXPLVV/YKC3Gtq8WJdlOPkiBnq1oJhuDLn/++zRb+gd4QDA6Lx45Mpxn7 /GEEtcDGrKgXnsIoXjrVo7z/fAuLk5cwfLdLiOafrTI4khu6iHkH6t9CR8FhKcvTjzewKn77G8OEx r1oR1GjewgiQ1tYlLYdkugQNMOmqmweSDmkPfndGI1ZNHj+alvoyOytdzoV5HBvmdFpsN3U4BAxcN R7f4CG9u+e9JKtSM4xpOEvJMCI0/HVrSy3fFT/f3RZDs54QaW0WnEAeZUtjWPoUNdvGHcowJn7esu AaR6G6Ng==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:43562 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 1rWbN3-0007wH-3A; Sun, 04 Feb 2024 12:13:14 +0000 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1rWbN2-002cCh-MY; Sun, 04 Feb 2024 12:13:12 +0000 In-Reply-To: References: From: "Russell King (Oracle)" To: Andrew Lunn , Heiner Kallweit Cc: Alexandre Torgue , bcm-kernel-feedback-list@broadcom.com, Broadcom internal kernel review list , Byungho An , Clark Wang , "David S. Miller" , Doug Berger , Eric Dumazet , Florian Fainelli , Jakub Kicinski , Jose Abreu , Justin Chen , linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, Maxime Coquelin , netdev@vger.kernel.org, NXP Linux Team , Paolo Abeni , Shenwei Wang , Vladimir Oltean , Wei Fang Subject: [PATCH net-next v2 3/6] net: fec: remove eee_enabled/eee_active in fec_enet_get_eee() Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline Message-Id: Sender: Russell King Date: Sun, 04 Feb 2024 12:13:12 +0000 X-Patchwork-Delegate: kuba@kernel.org fec_enet_get_eee() sets edata->eee_active and edata->eee_enabled from its own copy, and then calls phy_ethtool_get_eee() which in turn will call genphy_c45_ethtool_get_eee(). genphy_c45_ethtool_get_eee() will overwrite eee_enabled and eee_active with its own interpretation from the PHYs settings and negotiation result. Therefore, setting these members in fec_enet_get_eee() is redundant. Remove this, and remove the setting of fep->eee.eee_active member which becomes a write-only variable. Signed-off-by: Russell King (Oracle) Reviewed-by: Andrew Lunn --- drivers/net/ethernet/freescale/fec_main.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c index 63707e065141..42bdc01a304e 100644 --- a/drivers/net/ethernet/freescale/fec_main.c +++ b/drivers/net/ethernet/freescale/fec_main.c @@ -3139,8 +3139,6 @@ static int fec_enet_eee_mode_set(struct net_device *ndev, bool enable) } p->tx_lpi_enabled = enable; - p->eee_enabled = enable; - p->eee_active = enable; writel(sleep_cycle, fep->hwp + FEC_LPI_SLEEP); writel(wake_cycle, fep->hwp + FEC_LPI_WAKE); @@ -3160,8 +3158,6 @@ fec_enet_get_eee(struct net_device *ndev, struct ethtool_keee *edata) if (!netif_running(ndev)) return -ENETDOWN; - edata->eee_enabled = p->eee_enabled; - edata->eee_active = p->eee_active; edata->tx_lpi_timer = p->tx_lpi_timer; edata->tx_lpi_enabled = p->tx_lpi_enabled; From patchwork Sun Feb 4 12:13:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 13544644 X-Patchwork-Delegate: kuba@kernel.org Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [78.32.30.218]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B54B024205 for ; Sun, 4 Feb 2024 12:13:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=78.32.30.218 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707048816; cv=none; b=sjsME+RDPcB55BFDx+Se6XSEb4bo0Y4gvXsq9Rk1gW+wqWEhvSdzJIZnkhWnoaoyYPfWAp4cwezKhOo4FYgvjyHEzYkNafHhFmjrtM9knuqC1CF47uS6ZzLLVpQ3We3K8RhTtsFIuzFUFN2fzq1IDy4OMiTlUWc+LR+WPCR9pW8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707048816; c=relaxed/simple; bh=gab2UslUgkgQ0VbFi/0WJZY1TWbnjjo++UnRr4yfy2E=; h=In-Reply-To:References:From:To:Cc:Subject:MIME-Version: Content-Disposition:Content-Type:Message-Id:Date; b=Hn6Wd+K3+1S0SGPL7NuYiVRfmCWhhzN5QgDQYI885MM6ZCAgQ8SzeRq1hjGpgT+M6h34vls1OvWd5zV1kq/OuknK9q/7c2/bo22dT+s1e5fFY7cEJ34IRXEiF9UJdW/HSJnzcWlg+TZu6B/bvCa2a+6Ka4KI8ie7JOjxzCniv7M= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk; spf=none smtp.mailfrom=armlinux.org.uk; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b=jJJjOCuM; arc=none smtp.client-ip=78.32.30.218 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="jJJjOCuM" 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=yhbQBK3MUJ9emo+hON8kj+uhA+NE4eHB0k/xSCsVIh0=; b=jJJjOCuMlw6pRjo58DScmVr34Y Ujs4H6+eeUvxIL0fY9x6rzAdVrrA4OK1Jh3HXe1/C5gHUyWcDA7TqTfz/n9ZWKTWYRgkkNPQZ0FrW k4c2+IJ3X04/15VlXUrw6LycOMnb2GgrF+BEWWt01CACyUXlXFeZYxEQ/XDkhCh5fscPatH48d4uS zDfsQra1L21Ny6/uFc47R8ZqT/zZrmNmJgQeAwR/poUpf8+RyAoh6BlAnllE17gfgpnj4UkILsoii vfihYYg/cOQFOen6vTQHs8gC8ru8Pq2tdqFHWk05bEOXvCe+QZbJgEUoDYmM7U/fy9bUohVAPVnny 5B3vPafw==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:43572 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 1rWbNA-0007wh-1b; Sun, 04 Feb 2024 12:13:20 +0000 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1rWbN7-002cCn-RO; Sun, 04 Feb 2024 12:13:17 +0000 In-Reply-To: References: From: "Russell King (Oracle)" To: Andrew Lunn , Heiner Kallweit Cc: Alexandre Torgue , bcm-kernel-feedback-list@broadcom.com, Broadcom internal kernel review list , Byungho An , Clark Wang , "David S. Miller" , Doug Berger , Eric Dumazet , Florian Fainelli , Jakub Kicinski , Jose Abreu , Justin Chen , linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, Maxime Coquelin , netdev@vger.kernel.org, NXP Linux Team , Paolo Abeni , Shenwei Wang , Vladimir Oltean , Wei Fang Subject: [PATCH net-next v2 4/6] net: bcmgenet: remove eee_enabled/eee_active in bcmgenet_get_eee() Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline Message-Id: Sender: Russell King Date: Sun, 04 Feb 2024 12:13:17 +0000 X-Patchwork-Delegate: kuba@kernel.org bcmgenet_get_eee() sets edata->eee_active and edata->eee_enabled from its own copy, and then calls phy_ethtool_get_eee() which in turn will call genphy_c45_ethtool_get_eee(). genphy_c45_ethtool_get_eee() will overwrite eee_enabled and eee_active with its own interpretation from the PHYs settings and negotiation result. Therefore, setting these members in bcmgenet_get_eee() is redundant, and can be removed. This also makes priv->eee.eee_active unnecessary, so remove this and use a local variable where appropriate. Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli Signed-off-by: Russell King (Oracle) --- drivers/net/ethernet/broadcom/genet/bcmgenet.c | 8 +++----- drivers/net/ethernet/broadcom/genet/bcmmii.c | 5 +++-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c index 051c31fb17c2..7396e2823e32 100644 --- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c @@ -1313,7 +1313,6 @@ void bcmgenet_eee_enable_set(struct net_device *dev, bool enable, } priv->eee.eee_enabled = enable; - priv->eee.eee_active = enable; priv->eee.tx_lpi_enabled = tx_lpi_enabled; } @@ -1328,8 +1327,6 @@ static int bcmgenet_get_eee(struct net_device *dev, struct ethtool_keee *e) if (!dev->phydev) return -ENODEV; - e->eee_enabled = p->eee_enabled; - e->eee_active = p->eee_active; e->tx_lpi_enabled = p->tx_lpi_enabled; e->tx_lpi_timer = bcmgenet_umac_readl(priv, UMAC_EEE_LPI_TIMER); @@ -1340,6 +1337,7 @@ static int bcmgenet_set_eee(struct net_device *dev, struct ethtool_keee *e) { struct bcmgenet_priv *priv = netdev_priv(dev); struct ethtool_keee *p = &priv->eee; + bool active; if (GENET_IS_V1(priv)) return -EOPNOTSUPP; @@ -1352,9 +1350,9 @@ static int bcmgenet_set_eee(struct net_device *dev, struct ethtool_keee *e) if (!p->eee_enabled) { bcmgenet_eee_enable_set(dev, false, false); } else { - p->eee_active = phy_init_eee(dev->phydev, false) >= 0; + active = phy_init_eee(dev->phydev, false) >= 0; bcmgenet_umac_writel(priv, e->tx_lpi_timer, UMAC_EEE_LPI_TIMER); - bcmgenet_eee_enable_set(dev, p->eee_active, e->tx_lpi_enabled); + bcmgenet_eee_enable_set(dev, active, e->tx_lpi_enabled); } return phy_ethtool_set_eee(dev->phydev, e); diff --git a/drivers/net/ethernet/broadcom/genet/bcmmii.c b/drivers/net/ethernet/broadcom/genet/bcmmii.c index 97ea76d443ab..cbbe004621bc 100644 --- a/drivers/net/ethernet/broadcom/genet/bcmmii.c +++ b/drivers/net/ethernet/broadcom/genet/bcmmii.c @@ -30,6 +30,7 @@ static void bcmgenet_mac_config(struct net_device *dev) struct bcmgenet_priv *priv = netdev_priv(dev); struct phy_device *phydev = dev->phydev; u32 reg, cmd_bits = 0; + bool active; /* speed */ if (phydev->speed == SPEED_1000) @@ -88,9 +89,9 @@ static void bcmgenet_mac_config(struct net_device *dev) } bcmgenet_umac_writel(priv, reg, UMAC_CMD); - priv->eee.eee_active = phy_init_eee(phydev, 0) >= 0; + active = phy_init_eee(phydev, 0) >= 0; bcmgenet_eee_enable_set(dev, - priv->eee.eee_enabled && priv->eee.eee_active, + priv->eee.eee_enabled && active, priv->eee.tx_lpi_enabled); } From patchwork Sun Feb 4 12:13:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 13544645 X-Patchwork-Delegate: kuba@kernel.org Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [78.32.30.218]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F357C224D7 for ; Sun, 4 Feb 2024 12:13:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=78.32.30.218 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707048821; cv=none; b=nG8lvmkXFYuoVz6AXjxKb+CkH69c1qDZHDIC+taKCyQk+Vxay04CbLoOy/ug4eAbiuNKrQq201q+BkX6BKxjwx7OpzPnxY2c94fyXvql9LIzZJpvYkTlMqknDhZCyqptg7TGr5j7SgnHKG8FTyhLzyJ1a2vR7WVTS6/be5mcbcg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707048821; c=relaxed/simple; bh=jmOhRGhyhkvWWFkQvRyuNPvEd1M4Mfxm7VyTLlhlbEM=; h=In-Reply-To:References:From:To:Cc:Subject:MIME-Version: Content-Disposition:Content-Type:Message-Id:Date; b=bQ7Yz3smnoZDgzZVZW8lhkHdv+3kMTs3pvCWU1CTHWzh4B6BQpHfbQtFK21oE9h3LOeAn6AOON0TOWv9Pd0RwP79XBTKTcZNUDJ7IuxxL0sMvQkLuO5PYaKYZBAdIjX8iLhQW+nJxXX0LjB0daH5g+mowAfVrEZwoGwi6nf/UK0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk; spf=none smtp.mailfrom=armlinux.org.uk; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b=vxqozgd6; arc=none smtp.client-ip=78.32.30.218 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="vxqozgd6" 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=BG8iQS1uwNFv5a1AmE60y/BDGePzQB5EZyGFOh6TZKg=; b=vxqozgd6KB4EGPlgVnkumoGYga W652B3Zn8kaVZwCgt6RK3sG160Z9KvpUFICfCkqo6p3yLiSVHOd7DYt17zX7JzgpGxGYk7SA9WXLK fvONiOHNGUI5GJNaCqTAkZh3mAdOZJ8K3Ofl7B9QEt21IWrY9eSgvTx2o8J4BfWRGuT/ssCWcxNfK 0WYl+Ljgel5fY6rYkuo2KnJQIHTf5n2P4QCgVQMV9rubmClIw6cQ63glirGZcz1RC2CQD2gIDg4ae wc183DRlyK2U9qdwNwBgY6/HCdb1WTsGj/+eSanZa5qGIqm/nvlX3mppWLmine/76bkhv/l36I59Y Hg9n04rg==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:39960 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 1rWbNE-0007x1-2O; Sun, 04 Feb 2024 12:13:24 +0000 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1rWbNC-002cCt-W7; Sun, 04 Feb 2024 12:13:23 +0000 In-Reply-To: References: From: "Russell King (Oracle)" To: Andrew Lunn , Heiner Kallweit Cc: Alexandre Torgue , bcm-kernel-feedback-list@broadcom.com, Broadcom internal kernel review list , Byungho An , Clark Wang , "David S. Miller" , Doug Berger , Eric Dumazet , Florian Fainelli , Jakub Kicinski , Jose Abreu , Justin Chen , linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, Maxime Coquelin , netdev@vger.kernel.org, NXP Linux Team , Paolo Abeni , Shenwei Wang , Vladimir Oltean , Wei Fang Subject: [PATCH net-next v2 5/6] net: bcmasp: remove eee_enabled/eee_active in bcmasp_get_eee() Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline Message-Id: Sender: Russell King Date: Sun, 04 Feb 2024 12:13:22 +0000 X-Patchwork-Delegate: kuba@kernel.org bcmasp_get_eee() sets edata->eee_active and edata->eee_enabled from its own copy, and then calls phy_ethtool_get_eee() which in turn will call genphy_c45_ethtool_get_eee(). genphy_c45_ethtool_get_eee() will overwrite eee_enabled and eee_active with its own interpretation from the PHYs settings and negotiation result. Therefore, setting these members in bcmasp_get_eee() is redundant, and can be removed. This also makes intf->eee.eee_active unnecessary, so remove this and use a local variable where appropriate. Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli Signed-off-by: Russell King (Oracle) --- drivers/net/ethernet/broadcom/asp2/bcmasp_ethtool.c | 4 ---- drivers/net/ethernet/broadcom/asp2/bcmasp_intf.c | 5 +++-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/broadcom/asp2/bcmasp_ethtool.c b/drivers/net/ethernet/broadcom/asp2/bcmasp_ethtool.c index 2851bed153e6..484fc2b5626f 100644 --- a/drivers/net/ethernet/broadcom/asp2/bcmasp_ethtool.c +++ b/drivers/net/ethernet/broadcom/asp2/bcmasp_ethtool.c @@ -360,7 +360,6 @@ void bcmasp_eee_enable_set(struct bcmasp_intf *intf, bool enable) umac_wl(intf, reg, UMC_EEE_CTRL); intf->eee.eee_enabled = enable; - intf->eee.eee_active = enable; } static int bcmasp_get_eee(struct net_device *dev, struct ethtool_keee *e) @@ -371,8 +370,6 @@ static int bcmasp_get_eee(struct net_device *dev, struct ethtool_keee *e) if (!dev->phydev) return -ENODEV; - e->eee_enabled = p->eee_enabled; - e->eee_active = p->eee_active; e->tx_lpi_enabled = p->tx_lpi_enabled; e->tx_lpi_timer = umac_rl(intf, UMC_EEE_LPI_TIMER); @@ -399,7 +396,6 @@ static int bcmasp_set_eee(struct net_device *dev, struct ethtool_keee *e) } umac_wl(intf, e->tx_lpi_timer, UMC_EEE_LPI_TIMER); - intf->eee.eee_active = ret >= 0; intf->eee.tx_lpi_enabled = e->tx_lpi_enabled; bcmasp_eee_enable_set(intf, true); } diff --git a/drivers/net/ethernet/broadcom/asp2/bcmasp_intf.c b/drivers/net/ethernet/broadcom/asp2/bcmasp_intf.c index 53e542881255..3a15f269c7d1 100644 --- a/drivers/net/ethernet/broadcom/asp2/bcmasp_intf.c +++ b/drivers/net/ethernet/broadcom/asp2/bcmasp_intf.c @@ -607,6 +607,7 @@ static void bcmasp_adj_link(struct net_device *dev) struct phy_device *phydev = dev->phydev; u32 cmd_bits = 0, reg; int changed = 0; + bool active; if (intf->old_link != phydev->link) { changed = 1; @@ -658,8 +659,8 @@ static void bcmasp_adj_link(struct net_device *dev) reg |= cmd_bits; umac_wl(intf, reg, UMC_CMD); - intf->eee.eee_active = phy_init_eee(phydev, 0) >= 0; - bcmasp_eee_enable_set(intf, intf->eee.eee_active); + active = phy_init_eee(phydev, 0) >= 0; + bcmasp_eee_enable_set(intf, active); } reg = rgmii_rl(intf, RGMII_OOB_CNTRL); From patchwork Sun Feb 4 12:13:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 13544646 X-Patchwork-Delegate: kuba@kernel.org Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [78.32.30.218]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 123072556E for ; Sun, 4 Feb 2024 12:13:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=78.32.30.218 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707048825; cv=none; b=Oq/U5a/UJyY8au8rxojT9pXDZrVulF3w2ETOfsZUj7BuKMoKnBb9btZn+hmFa7fBbuuEn4dlPCa3lqW02ilL1fZcb0aD+yDjeTVI+9ltVK0XOjUrk5IUQktz9tRsmqdGY+N7hWTJz0c3q1SMIMWg7sjYGf9BAsGSOUsVisL+k44= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707048825; c=relaxed/simple; bh=Qbjf0JT9hYoBy0aIjTyuugeXnqNtP+7bBqJlN4UUpEc=; h=In-Reply-To:References:From:To:Cc:Subject:MIME-Version: Content-Disposition:Content-Type:Message-Id:Date; b=kfRK3d+UxzEQrFMvWKt2jg3oYiATASD3vICGmb7jy2gpUtPGDDhB+TnN8PJeJ8K+2udCz09SHTgrOCTcZPOMQYhhxnIKy10+6nDhd3Ctwimje4H7aaW+CdRrTXURRZ8YYu4yVIYS3QNWGb2F4Y+d/LQMlIn3MyPu6SvMCIpR4Rg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk; spf=none smtp.mailfrom=armlinux.org.uk; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b=YJXqn2qo; arc=none smtp.client-ip=78.32.30.218 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="YJXqn2qo" 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=TeSX0Rei3geurLIn6oAwy0QNopjAv7Bbg6lKiahSH1s=; b=YJXqn2qojcMXn1u8LaCWjOxPAp 7b8xZ+9+rCAS5kQRoB6wIvPYxNXqiLVWvESM1xQM9HN3gQvmkm6OhsrQgJyIs/5tf4Mocb/uwbsjJ myLphA06U6OT9cvBffTRLdibaVaEUNBzK4haKBGnjqoR4HMWANPaRhOm3XiZ7UsMuXPaqRRrG87qP ep54QTUaKEu0wYztftkE+qGp6XVbfSOMLU/FzuHfkjS584KUTEmFeLgJl2f+8X2dDWJ8xORN93sK8 48QbM2/jpkDIXPd2viv/JnwerG2qpRWUGXzqZ+ZV5D3vCGWCaROejDXkf2x0wiMSfXHd65tx4PxGz flE2S+UA==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:39974 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 1rWbNJ-0007xM-1q; Sun, 04 Feb 2024 12:13:29 +0000 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1rWbNI-002cCz-4x; Sun, 04 Feb 2024 12:13:28 +0000 In-Reply-To: References: From: "Russell King (Oracle)" To: Andrew Lunn , Heiner Kallweit Cc: Alexandre Torgue , bcm-kernel-feedback-list@broadcom.com, Broadcom internal kernel review list , Byungho An , Clark Wang , "David S. Miller" , Doug Berger , Eric Dumazet , Florian Fainelli , Jakub Kicinski , Jose Abreu , Justin Chen , linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, Maxime Coquelin , netdev@vger.kernel.org, NXP Linux Team , Paolo Abeni , Shenwei Wang , Vladimir Oltean , Wei Fang Subject: [PATCH net-next v2 6/6] net: dsa: b53: remove eee_enabled/eee_active in b53_get_mac_eee() Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline Message-Id: Sender: Russell King Date: Sun, 04 Feb 2024 12:13:28 +0000 X-Patchwork-Delegate: kuba@kernel.org b53_get_mac_eee() sets both eee_enabled and eee_active, and then returns zero. dsa_slave_get_eee(), which calls this function, will then continue to call phylink_ethtool_get_eee(), which will return -EOPNOTSUPP if there is no PHY present, otherwise calling phy_ethtool_get_eee() which in turn will call genphy_c45_ethtool_get_eee(). genphy_c45_ethtool_get_eee() will overwrite eee_enabled and eee_active with its own interpretation from the PHYs settings and negotiation result. Thus, when there is no PHY, dsa_slave_get_eee() will fail with -EOPNOTSUPP, meaning eee_enabled and eee_active will not be returned to userspace. When there is a PHY, eee_enabled and eee_active will be overwritten by phylib, making the setting of these members in b53_get_mac_eee() entirely unnecessary. Remove this code, thus simplifying b53_get_mac_eee(). Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli Signed-off-by: Russell King (Oracle) Reviewed-by: Vladimir Oltean --- drivers/net/dsa/b53/b53_common.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_common.c index adc93abf4551..9e4c9bd6abcc 100644 --- a/drivers/net/dsa/b53/b53_common.c +++ b/drivers/net/dsa/b53/b53_common.c @@ -2227,16 +2227,10 @@ EXPORT_SYMBOL(b53_eee_init); int b53_get_mac_eee(struct dsa_switch *ds, int port, struct ethtool_keee *e) { struct b53_device *dev = ds->priv; - struct ethtool_keee *p = &dev->ports[port].eee; - u16 reg; if (is5325(dev) || is5365(dev)) return -EOPNOTSUPP; - b53_read16(dev, B53_EEE_PAGE, B53_EEE_LPI_INDICATE, ®); - e->eee_enabled = p->eee_enabled; - e->eee_active = !!(reg & BIT(port)); - return 0; } EXPORT_SYMBOL(b53_get_mac_eee);