From patchwork Fri Feb 2 09:33:44 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: 13542535 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 4771CC48291 for ; Fri, 2 Feb 2024 09:36:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Date:Message-Id: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=oJgDg2unP7HRKmpQbY/S3zYnjdcRja/d2VbRJIKCi3E=; b=JjuErURxX7POco oMsQtRRqZyBPgAkwwJYpgACYuLMyKn7QhmaoNJl+Ff6amIhhlEgP9hKKkQPbThCE3AM0AwfA9Ax9a tWeOC3L0bHK5uGaxSduRB4WPDppm52fspWceq/cS9xNCmrrMWpa0D4VGwmN0uX+E2pkn38GAW9en0 UrF7sRoQQ1hPYToyy8qxgzNS2X4RlGMmuMDVequXa7ZoqqkpnFE13LytGIOIFqw2vrTL2Z7dgYD7x 0CtO9riDP5pRuDXPm9XV58KU7EaBdt1paVYEJLO81N1xnckX8SiW1rYS+Wx7w+InL5ynvgmcueg/s jxRFCAr0i9axpNLIIGCg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rVpy1-0000000AzHo-2WJD; Fri, 02 Feb 2024 09:36:13 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rVpxy-0000000Ay8s-4BJv for linux-arm-kernel@lists.infradead.org; Fri, 02 Feb 2024 09:36:12 +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=PbWLK+MOR3/lEMtgzx4zTiXixve0bEAN+thqPJbkNns=; b=psvNyz0jX+trhUoXpk/jKxZUXN imbp1fYgBStwdiAHW2MVT1mPkJWZlcogn0HDyd/HrZn6NEub+0o4Ybx4uge7zxFI8wDP4ygS9M1UJ efKbb/Cprz91d+k5PStWjUax2S74XiqCFfpDdffv4DE1PuV2APYaNsEGjeLZSEoKPWYfTr0SqszwR obNuTzoflDhthi++a3/fNHkHp04mJ1p68PPMWD9DM8+J9XEWb5f5rgJqVe6jqtVRIDw3iX2ipD0iJ zzI4hFYQVS+1t0Zl6HFM/Ev6DygpyS0sfKpTFOytQyeiJNW5+bEc9/VZmmM7i6+rvWZFw8J7OL0DZ OQapDZKQ==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:45812 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 1rVpvd-0005ib-3D; Fri, 02 Feb 2024 09:33:46 +0000 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1rVpvc-002Pdp-Jj; Fri, 02 Feb 2024 09:33:44 +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 1/6] net: stmmac: remove eee_enabled/eee_active in stmmac_ethtool_op_get_eee() MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Fri, 02 Feb 2024 09:33:44 +0000 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240202_013611_049842_B7C8DA1B X-CRM114-Status: UNSURE ( 9.98 ) X-CRM114-Notice: Please train this message. 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 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(). Signed-off-by: Russell King (Oracle) Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli --- 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 Fri Feb 2 09:33:49 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: 13542532 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 762FEC48291 for ; Fri, 2 Feb 2024 09:34:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Date:Message-Id: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=bv6fcvcY2ab/wWwX4Q220mMGODblDiXFRgN9o31MwL8=; b=Ifo0Pls/tiZ+EK 9XPZXy7I2Ymd2wpzyD1MZqrO6aFXaeqlOJW0pn7f0vkPvDrEzA/QZp4+WKuq49MTFuilsO4JxrcHK FdL1Sv7urhS2ZWemnIU5XOQuQWcu4zru1cElb53q7LB5b/ns+pWRchYKEiH/shA3ZNntE+cBSYpHd cXCF5+DB7cqD5pShUf/R8BdL1c6Ws7Rm7M7rbCmcbRm1Vg9Dvbvn2aviQxbb55hHUwC8I1C/QHKi/ NB5P4Ov+LcTVgS++Y+1IkBPzVRuWZESIDkru7DuKxDvcpCd7V5s1o3GGu7/NFqYo0C03sXnzIr/X8 ZxQiUb0weYm3s/dSuGBg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rVpwN-0000000AyT4-3aDh; Fri, 02 Feb 2024 09:34:31 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rVpwE-0000000AyFu-0hXl for linux-arm-kernel@lists.infradead.org; Fri, 02 Feb 2024 09:34:25 +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=LAIXrcGLIz+mYluAnrDraCyjl4jRrDiCTuZzIy+Ppxk=; b=EAa2XEyZYQoZVTBu9npDD+xIUz QDggunk8rs8ihOSXhWjfHl+PbZMX6kA4cUQqNIvULz2DWnuSTMbEQlp5VLCJHbtQ/oPxWs1p61Ns9 xbZpv3oS5r0og9VSVeNbobqT69IEy51wH6aD4zQsfdKTd8PXx1bo2ZvYEJVKigAHBsK2HUikx+M4d XVSM1cbuj06I9+zHxXg2aEZZymiWgKuNF4mQcxKzpx/JcigBSQTetKpO/PRahTI8WnaFOZ6QDKrL7 x6MAwXAmQFq00jPhqa919W5+RTzBQI8tm2/0UFenHeFGr3evsoJmeRavhAr3NJxXNF00K1N5GBydp ywEbSFGQ==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:54174 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 1rVpvm-0005j1-0i; Fri, 02 Feb 2024 09:33:55 +0000 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1rVpvh-002Pdv-Ol; Fri, 02 Feb 2024 09:33:49 +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 2/6] net: sxgbe: remove eee_enabled/eee_active in sxgbe_get_eee() MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Fri, 02 Feb 2024 09:33:49 +0000 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240202_013422_457792_97EAA946 X-CRM114-Status: GOOD ( 10.24 ) 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 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. Signed-off-by: Russell King (Oracle) Reviewed-by: Andrew Lunn --- 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 Fri Feb 2 09:33:54 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: 13542718 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 B461EC4828E for ; Fri, 2 Feb 2024 10:47:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Date:Message-Id: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=bFUFKuYR4Fi8aRkt1OvuR9n1MTiNBfpQrk/gCiB2osU=; b=1il+6P8Y2IdZ68 SYCYNEg6y3cxhee8t60SJhwD39m46mDwjvJBzIk+Q6cbLahnNV032m3cz4VdTqxjF7Qc7GFyq+oNz BeS8FI1drlkFqYLINa+7uF8Uk1gEmU+L+g2YmJT6YMfn0rtowrzBz2hfHob7BjrGfsY7j/vQ0p+71 bnTzZvTYrfu3/tCfUVXR7QQaBrpqIEPlScJ07z6OoLjiADb6VJTIlh/GgIgTIIBHAkfIv+PeTpSzU 3JmvbwUiBg26DNfDYc6p5B1+Ds3u6Y9OgrK+t1KgIHDn2LafHMSk/n65XIZrB0INzCwwXXDi5sjHd f1RFysyHHHNZDqtYLEVg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rVr4U-0000000BC3r-1AI0; Fri, 02 Feb 2024 10:46:58 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rVpwG-0000000AyHu-28L3 for linux-arm-kernel@lists.infradead.org; Fri, 02 Feb 2024 09:34:32 +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=RYigqvKp+xajIPmg+6RK+NoYme7EmhQ5CBgPRCDS1Po=; b=tp+k/0igR/CtGrHFnPuhenukta 3JwYDgctuTSy+Y4WfYNxeQN9xgsNDd2unYkHiR+jvxGLnYpYZ/zz4pFWrx/z2ycQjq4xgkgKPBUZO j5fIpL0/URZHermmyuREWU8/brcSdrOuMHZtxleb8eDxQ0tj77tyFMMP0KIU+Lw8nwRysbyoi64Tr yK7IOSz3pjaQszcGygOsl7BBQMj527XYKlmaAzYjf26GLZ+DevIFU2rqw58B07E91tk/mzRAx3UYa D1R4ultGUc6wcm8PFZCoD6FZqnxzGKgPJBmzVUV05kFDOWP+C1yw2bX371ibxw0AZFKSURcb+2RT3 OaesoQzw==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:54184 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 1rVpvs-0005jA-2T; Fri, 02 Feb 2024 09:34:00 +0000 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1rVpvm-002Pe0-TV; Fri, 02 Feb 2024 09:33:54 +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 3/6] net: fec: remove eee_enabled/eee_active in fec_enet_get_eee() MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Fri, 02 Feb 2024 09:33:54 +0000 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240202_013424_913871_38287F42 X-CRM114-Status: UNSURE ( 8.38 ) X-CRM114-Notice: Please train this message. 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 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) --- drivers/net/ethernet/freescale/fec_main.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c index 63707e065141..38dcf0989e3f 100644 --- a/drivers/net/ethernet/freescale/fec_main.c +++ b/drivers/net/ethernet/freescale/fec_main.c @@ -3140,7 +3140,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 +3159,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 Fri Feb 2 09:34:00 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: 13542533 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 719FBC4828E for ; Fri, 2 Feb 2024 09:35:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Date:Message-Id: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=rT8VbOwBuroGopfWq4KrG4WxW4WKUTTtDqpzUVt7VMI=; b=rf40BiAxiD7TsU gQRi51Qmvt7ZNEKkvUgFr5lUGrbvSGxkWXTSrZ08nRIQXl9AiPTz3/b/stD6xzv5mQyFOEiCQnKkw JQyg/X8KkmVmduZEC7TdDjv8BlxW4jdSHxyjU0U/nM4mNKqT/vuu80yG0upONbIiCe5oH5H0J2tDx 3Zjq6DPJ+OSszH5CzvrOmedWsLKT/USiXKWyZoD0Z8+ZTLVsuPLH7HEolZAau15U7BKIjHJEBn0ui rnET7JJotvpHlKfkiq6nIxICiSw2b2KRLm0Ihml8c4zxsutZk5GnqVosKVXMwfGtQdOgr3ZMGw4yZ Z+F5aUctZByBuoQYZd7Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rVpwf-0000000AygY-1kUY; Fri, 02 Feb 2024 09:34:49 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rVpwM-0000000AyPH-15ST for linux-arm-kernel@lists.infradead.org; Fri, 02 Feb 2024 09:34:41 +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=vf7BGNl9i42pdxz8Gl6B1J2fWwi9YHL54zIOUUkQn3A=; b=MOfTxRYFoSRiWJObPmMTl7GlQK qYxjPpPDJS/Z9J2jScs4o5Z3IHEJuC74nVyreC6jomiZMDGhTF4ZlliEGll/dI3oCB4u5l2wT6AqY UwsU/y/Wh0C0I+gevrg5/lmLH0ffrXGHnnDjxgODAegyQUulG7YZi9zEMsWx3VaDzONEXhLs5M0N9 qrGK37CxUb1hk7bodP4OjJ0CYp2i+NROytIkKAOeQy8jySwdcZVgA3hUJCmmyO92vMWyJ8NR3U7jz IoOjzfsXzU8mnzRaa8xW5lSNEA73DqGRPatHBlo+yQlFz/K7fnPE01yxeVcJ7dl5q+Tk8r6rVWNpz uFUfArtQ==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:38142 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 1rVpvw-0005jK-1m; Fri, 02 Feb 2024 09:34:04 +0000 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1rVpvs-002Pe6-1w; Fri, 02 Feb 2024 09:34:00 +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 4/6] net: bcmgenet: remove eee_enabled/eee_active in bcmgenet_get_eee() MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Fri, 02 Feb 2024 09:34:00 +0000 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240202_013430_850087_EBEFCF13 X-CRM114-Status: GOOD ( 12.53 ) 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 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. Signed-off-by: Russell King (Oracle) Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli --- 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 Fri Feb 2 09:34:05 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: 13542719 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 720DAC48291 for ; Fri, 2 Feb 2024 10:47:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Date:Message-Id: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=U/B5WN+o1Vcaf5Ilpwf/dzbUygplDSNgexZzwFXBVZg=; b=Cicv8sCuMAfpHX 0tZWfcn4ItwmNfq4vsPMldA3hkpbe+v0gPgh0yErbkteOHY6PG2qakzCO0N0VNz/UUzT2i3H8IKro MLKCm3epfqm3I58bEas+9Uwk0ULgXp5zU/te//aWRJjcbvTjUrXDBwyQxiHWeQjFZXioJEjqhc7Pw gFTs/i2ZIUsJiILDtU+SsEpICbTznJorxG7fNYzWQmS6BrpIH6GNcxez0kumGZgJQb7MwDQqsVqd/ NOgR5GxvvgL2NOut7bf9dlcEJsLLcqkFsnQXlVgwjhg/XfY5Hdie16MXiE1O/NWdc+05lWIwLiATp cfSgYXMLzKdtrlyWGMrw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rVr4V-0000000BC3z-0bPS; Fri, 02 Feb 2024 10:46:59 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rVpwL-0000000AyP3-3BDz for linux-arm-kernel@lists.infradead.org; Fri, 02 Feb 2024 09:34:40 +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=M59Ne5bwhriKItk6IjExPwtQ/AHVVG1QMKc/HflM8hs=; b=RZLkUZQogpvKgwOO+Bka/H3IXN rLLis6XFiH8D1uVqWyFM9lmzFGNuDrlJdPHVoiawokkih/5BuP7oA6kjyvI/y+oovnt7b6X0luSOJ 9jHFqtSyzm+QCp5CGzzohP0LorJb0fhb2eoZR/0UNdzzrItgsbBxm4Hzn1BwVJz9bFL13gNmZqdGC /vPbCCbmir2jUPWIlpKxABkb5Iq5LysXVHVLTmG4UZ84SfBQ0N68GqH49uUbwLituxyy1nIW+5fMP sk7d0YdqIUBPRZKx+McEo/86jyJ23pFE+BLaJVcFGbAAXx/NkMlBsz34Tqjheq8rwqMsgTLRFH3BM i/NZZDaA==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:38154 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 1rVpw0-0005jl-0l; Fri, 02 Feb 2024 09:34:08 +0000 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1rVpvx-002PeD-71; Fri, 02 Feb 2024 09:34:05 +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 5/6] net: bcmasp: remove eee_enabled/eee_active in bcmasp_get_eee() MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Fri, 02 Feb 2024 09:34:05 +0000 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240202_013430_317170_685A64EB X-CRM114-Status: GOOD ( 13.40 ) 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 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. Signed-off-by: Russell King (Oracle) Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli --- 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 Fri Feb 2 09:34:10 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: 13542534 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 BB037C48291 for ; Fri, 2 Feb 2024 09:35:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Date:Message-Id: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=Oy2Kt96iMZ4yHcNTQEWXNzQn16VA0YBUh/Q0xHJ84BU=; b=vYjsGVdH07JbtS 2CYsDMwCInsEhucSpDZSnNO1fmuR3EAj71aG2fxkI+/jJMGULAwxBqppmRr7m/FOOhK6YpmSmRZzJ Ge9BlklaKKoojKO7bEu0vfxES3C2mFaW8NW+sOpj2TdooNWyER7EQoT7YDM1jWbezYSpqeDfWvG1C iv8oft7VwXebEo/daV/yWmmi5febe9NigM/JqzS0llPY5JSB8tAAv2TVdIBA2oNHHD3+XTWQs7IO4 PqEcWUkoWYVcB6T2T5EzBRF6kaAPM+5UO+zqSD6wBzBVtK16/KC/Pmk2o1DTbDhgNtgGgPtDQogaU 9/TYNaUrcjW9xFL5HK9g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rVpwk-0000000Ayjt-0AiX; Fri, 02 Feb 2024 09:34:54 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rVpwP-0000000AyTT-1yIZ for linux-arm-kernel@lists.infradead.org; Fri, 02 Feb 2024 09:34:46 +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=3G/SM6B9LVAezkmjsQuCkLPRjodqHykC7esT3tP+0gc=; b=sGd0o21jyhaVAVnBkm1EuwCq/V hIEo8T2CKS4tisynNYpw8A20vMnznJfIAht/JJL558p+ew8mw1rhdOxP2MD6OE64aUaSKLi2DHPkS W5F3tLAmNgxMpqaMsE4bg3MrFbaQ3wNBAywiFC1ojZsmWRZaVmrsvAIheRxSN23ZgBbmEDXj/mc8/ VHhVY2MyxMWq2aoWNgN9zcK88R5uh7ft8wns69R0fW/1UjO3cS6V/HB3YqVXxuVE958fLwEwFBqBl XQxqrug2/VSEdnVbhDXsybKOs/8iQBA3vt6mi86PzzfKbhMGbwXrv+ydNlJPWtjwHGuLBi3HWwL+T /s/7KqKQ==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:37130 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 1rVpw6-0005kI-1V; Fri, 02 Feb 2024 09:34:14 +0000 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1rVpw2-002PeJ-Bh; Fri, 02 Feb 2024 09:34:10 +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 6/6] net: dsa: b53: remove eee_enabled/eee_active in b53_get_mac_eee() MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Fri, 02 Feb 2024 09:34:10 +0000 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240202_013433_863908_AA4D6471 X-CRM114-Status: UNSURE ( 9.77 ) X-CRM114-Notice: Please train this message. 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 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(). Signed-off-by: Russell King (Oracle) Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli --- 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);