From patchwork Tue Dec 10 14:18:11 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: 13901524 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 999B9E77180 for ; Tue, 10 Dec 2024 14:32:31 +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=heuIwIaco0ryk9+s/3Tq5BiUJ5G/QcaQOBK21igxZiY=; b=B0X0nL6VhhY7t+evu412zhWdtU AUohIYouo7TY1SZiXwYhulPrEhpendHjOpenjKMqoCTSECKMgkwlIbLp0vNiPjtEN63DFBRcS/bJt AvaZPnd9+ZS1IjjrPzPR1v8pvwbG4nyfH/Xi0JxeWqCSsPr4qo7jmv4ajbg7Ek+KVBpTS/bUqX0Dn YITPkLIP0JPhdurRsM4e+hHnupoPDl9sZiGOFTkd/AIOrZ+K7zPT/Lie6TVoMx0u7BEgeoOnl4oHZ tD9JHRLvXhiaW1VqAWgvHyy8Q+3K6ubgh/xhaROpS3Xz52ckSQwJdDy6dJcJmWtN5cBXoUJ+OZ0WW N5UbvRQQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tL1Hi-0000000Bm3K-1JUU; Tue, 10 Dec 2024 14:32:22 +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 1tL14D-0000000BilT-0AQl; Tue, 10 Dec 2024 14:18:26 +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=heuIwIaco0ryk9+s/3Tq5BiUJ5G/QcaQOBK21igxZiY=; b=XFfBQAqncOi6+bZnJUa8u14GfE UH8WBg+i6wqTKWI8CHNHcSbcGTpgqfjaXailak5EzFeS96sihLJ4ldTDUs2ELiuRgSJmULcN9MHzi JzA6UCRt5thLH1p17CcvY6BQn/ITnlPDxkb25ziGJDZ0aPCrJTRmvLEvs3gz1jPbX076UP1hfhh8Z pxK29YsRBn34S71NiQIxMRLk9kVB0PaqRfJrc6PBhgwUEMqPTI5RPTn1RQhmEnE5M+MlCVAEyYB5W xql3R6UiD2YWN1pCm6XOY1K5hlhZ6yaT7TstmWzy+wt6p9fn8DMVhQ4J/MzmLcw2vPG5EWvwSKW65 yhKcAAjg==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:38238 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 1tL140-0002Sc-2g; Tue, 10 Dec 2024 14:18:13 +0000 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1tL13z-006cZ7-BZ; Tue, 10 Dec 2024 14:18:11 +0000 In-Reply-To: References: From: "Russell King (Oracle)" To: Andrew Lunn , Heiner Kallweit Cc: AngeloGioacchino Del Regno , "Ar__n__ __NAL" , Daniel Golle , "David S. Miller" , DENG Qingfang , Eric Dumazet , Florian Fainelli , Jakub Kicinski , linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Matthias Brugger , netdev@vger.kernel.org, Paolo Abeni , Sean Wang , Simon Horman , UNGLinuxDriver@microchip.com, Vladimir Oltean , Woojung Huh Subject: [PATCH net-next 1/9] net: dsa: remove check for dp->pl in EEE methods MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Tue, 10 Dec 2024 14:18:11 +0000 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241210_061825_084063_3ABCEE6A X-CRM114-Status: GOOD ( 12.04 ) 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 When user ports are initialised, a phylink instance is always created, and so dp->pl will always be non-NULL. The EEE methods are only used for user ports, so checking for dp->pl to be NULL makes no sense. No other phylink-calling method implements similar checks in DSA. Remove this unnecessary check. Signed-off-by: Russell King (Oracle) Reviewed-by: Florian Fainelli --- net/dsa/user.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/dsa/user.c b/net/dsa/user.c index 06c30a9e29ff..0640247b8f0a 100644 --- a/net/dsa/user.c +++ b/net/dsa/user.c @@ -1229,7 +1229,7 @@ static int dsa_user_set_eee(struct net_device *dev, struct ethtool_keee *e) int ret; /* Port's PHY and MAC both need to be EEE capable */ - if (!dev->phydev || !dp->pl) + if (!dev->phydev) return -ENODEV; if (!ds->ops->set_mac_eee) @@ -1249,7 +1249,7 @@ static int dsa_user_get_eee(struct net_device *dev, struct ethtool_keee *e) int ret; /* Port's PHY and MAC both need to be EEE capable */ - if (!dev->phydev || !dp->pl) + if (!dev->phydev) return -ENODEV; if (!ds->ops->get_mac_eee) From patchwork Tue Dec 10 14:18:16 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: 13901525 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 867A7E7717F for ; Tue, 10 Dec 2024 14:33:39 +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=gZeUKmjTWrPxI3nhYuZ5sil5KUc6LYRAxvBAbVkyF2w=; b=cEibCONDorlU2IwtflyESNxqyW 8W2zBnbzEv6n5CALK6fj1dq5Zo4tFljsoPdsvxyODrWelDP/TCpUKdnBCq+OlEsCjcQTP94Q09ddQ zAqjs9Fspi68CnWerTLHSp3zDPdieYWrzSUdLcb7maagTPnuTryGjpdXsG+/UoeoJ1HfWZWMOh/CD GRsoEvd5g+CVoP1gj3NymehsvO8b+giWM3fdQ7+SwgAXODUiAOD14a8gWMvriJ/bUrFjlA+q7ROxN hiubI9v4hu+e/8pW43YhRauqZF4jesgIFX9wK1s56jJiMlkDqO1v1QIaZGeTJT/S2UUEu07k2grU/ MlLHMVow==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tL1Ik-0000000BmOY-1LJZ; Tue, 10 Dec 2024 14:33:26 +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 1tL14D-0000000BinA-4Aut; Tue, 10 Dec 2024 14:18:27 +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=gZeUKmjTWrPxI3nhYuZ5sil5KUc6LYRAxvBAbVkyF2w=; b=g7O5fXsTSYslmoYkIrplDjGH9+ SoGILQDnbkvlyF/XdP3Cexmqb40R1sGBKHta2hHotDaEM/Ce9b0aW5p0N3LelyAo2BkaT3sx0wB1R nVdG0eew6kyRAtaeREHtXZFwzNeH2oENELF4vnqIwNjOWWdsixmB0FQ5Qmb86xLQCHmNjeLS4w5w1 tXykbrISXcMzQb2hIrrmwWp2phccFOQmehVXvaZu6IWNWAfIyD1BXCbFcYpNdPu0pGJLLJimwyxSI 1oiGtl9uXB042cceIuC4YdQQAdVo7KmPrhtXiMhjGwxHTZzITXhDfzUjUOhkm3+aOJclRJX7L/uPp bMXJgjLw==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:38252 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 1tL145-0002Sq-31; Tue, 10 Dec 2024 14:18:18 +0000 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1tL144-006cZD-El; Tue, 10 Dec 2024 14:18:16 +0000 In-Reply-To: References: From: "Russell King (Oracle)" To: Andrew Lunn , Heiner Kallweit Cc: AngeloGioacchino Del Regno , "Ar__n__ __NAL" , Daniel Golle , "David S. Miller" , DENG Qingfang , Eric Dumazet , Florian Fainelli , Jakub Kicinski , linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Matthias Brugger , netdev@vger.kernel.org, Paolo Abeni , Sean Wang , Simon Horman , UNGLinuxDriver@microchip.com, Vladimir Oltean , Woojung Huh Subject: [PATCH net-next 2/9] net: dsa: add hook to determine whether EEE is supported MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Tue, 10 Dec 2024 14:18:16 +0000 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241210_061826_030074_29A7F671 X-CRM114-Status: GOOD ( 12.93 ) 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 Add a hook to determine whether the switch supports EEE. This will return false if the switch does not, or true if it does. If the method is not implemented, we assume (currently) that the switch supports EEE. Signed-off-by: Russell King (Oracle) Reviewed-by: Florian Fainelli --- include/net/dsa.h | 1 + net/dsa/user.c | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/include/net/dsa.h b/include/net/dsa.h index 72ae65e7246a..aaa75bbaa0ea 100644 --- a/include/net/dsa.h +++ b/include/net/dsa.h @@ -988,6 +988,7 @@ struct dsa_switch_ops { /* * Port's MAC EEE settings */ + bool (*support_eee)(struct dsa_switch *ds, int port); int (*set_mac_eee)(struct dsa_switch *ds, int port, struct ethtool_keee *e); int (*get_mac_eee)(struct dsa_switch *ds, int port, diff --git a/net/dsa/user.c b/net/dsa/user.c index 0640247b8f0a..b54f61605a57 100644 --- a/net/dsa/user.c +++ b/net/dsa/user.c @@ -1228,6 +1228,10 @@ static int dsa_user_set_eee(struct net_device *dev, struct ethtool_keee *e) struct dsa_switch *ds = dp->ds; int ret; + /* Check whether the switch supports EEE */ + if (ds->ops->support_eee && !ds->ops->support_eee(ds, dp->index)) + return -EOPNOTSUPP; + /* Port's PHY and MAC both need to be EEE capable */ if (!dev->phydev) return -ENODEV; @@ -1248,6 +1252,10 @@ static int dsa_user_get_eee(struct net_device *dev, struct ethtool_keee *e) struct dsa_switch *ds = dp->ds; int ret; + /* Check whether the switch supports EEE */ + if (ds->ops->support_eee && !ds->ops->support_eee(ds, dp->index)) + return -EOPNOTSUPP; + /* Port's PHY and MAC both need to be EEE capable */ if (!dev->phydev) return -ENODEV; From patchwork Tue Dec 10 14:18:21 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: 13901535 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 72B9AE77180 for ; Tue, 10 Dec 2024 14:34:39 +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=w4Gug0yZHJ7/4tL9/AB4gLC4PdFqXx2MGKoxDny63/Y=; b=EBwcgrq88Ma9ViGveYfz0HzfxD wnTPZjWVGmmsmNYKkaHmNal5xgJ92ZuPcRFYDqfey0UGIiJl2TNoX2a7dZlwNYRjmqUsCEdC80ega xkqWlxO1IEmpyexl72ateggE4FxG31mCOKWPEMcoxXCzqp0SkoVyVTSQPYL1p4rT7JpXruUTyUPMl KkMoIqrJh329XpXh/i93Rfq/b0WAXpvicGhfsMM57xbdorOTbt3hVCiOYJ9qlq+eIv7luoE7HmF3h d3mOybMS/5jS+B9pcK9zfsXX2HMWWB24anhJeVEXADEN8krYbyBan12kQ1wX+GlQRQyjjSCV4prwC NHgLI94A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tL1Jl-0000000Bmb6-2Dgz; Tue, 10 Dec 2024 14:34:29 +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 1tL14J-0000000Bip1-1wnp; Tue, 10 Dec 2024 14:18: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=w4Gug0yZHJ7/4tL9/AB4gLC4PdFqXx2MGKoxDny63/Y=; b=YSAfXk5qKDIfwmAXk12sv+Ppvr 5rtupGvOTYtWzTs9JRNmrA1CoMOMsSYB621by2WX3SxJqZAhycCbRFa9kAyePPdZrKcbwCv1FU1l5 zKPPc45mA9KghxXGQwNoAwAX+KyLJHfl6700rEG7uNuyI3wsGA0mxzsEO+sxpusgFrmpuAQV+3/Qo FaDRL0QKWpsWGjnXDRSeiFUHv69srKutm2gWbPXCaAxSc5s++dJ1ZYBoTbpcpl/6A/qkOwGxzih7b D1e+Ze8Jex/RQsZPA1gxd9kElFCSyp8PMFBKjIygUgZYTnG6GIwrsaxHVIMTJhNffk64/73QLxR6v HogjcfUQ==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:39220 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 1tL14B-0002T9-0y; Tue, 10 Dec 2024 14:18:23 +0000 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1tL149-006cZJ-JJ; Tue, 10 Dec 2024 14:18:21 +0000 In-Reply-To: References: From: "Russell King (Oracle)" To: Andrew Lunn , Heiner Kallweit Cc: AngeloGioacchino Del Regno , "Ar__n__ __NAL" , Daniel Golle , "David S. Miller" , DENG Qingfang , Eric Dumazet , Florian Fainelli , Jakub Kicinski , linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Matthias Brugger , netdev@vger.kernel.org, Paolo Abeni , Sean Wang , Simon Horman , UNGLinuxDriver@microchip.com, Vladimir Oltean , Woojung Huh Subject: [PATCH net-next 3/9] net: dsa: provide implementation of .support_eee() MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Tue, 10 Dec 2024 14:18:21 +0000 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241210_061831_497619_A0A33C0B X-CRM114-Status: UNSURE ( 9.62 ) 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 Provide a trivial implementation for the .support_eee() method which switch drivers can use to simply indicate that they support EEE on all their user ports. Signed-off-by: Russell King (Oracle) Reviewed-by: Florian Fainelli --- include/net/dsa.h | 1 + net/dsa/port.c | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/include/net/dsa.h b/include/net/dsa.h index aaa75bbaa0ea..4aeedb296d67 100644 --- a/include/net/dsa.h +++ b/include/net/dsa.h @@ -1384,5 +1384,6 @@ static inline bool dsa_user_dev_check(const struct net_device *dev) netdev_tx_t dsa_enqueue_skb(struct sk_buff *skb, struct net_device *dev); void dsa_port_phylink_mac_change(struct dsa_switch *ds, int port, bool up); +bool dsa_supports_eee(struct dsa_switch *ds, int port); #endif diff --git a/net/dsa/port.c b/net/dsa/port.c index ee0aaec4c8e0..5c9d1798e830 100644 --- a/net/dsa/port.c +++ b/net/dsa/port.c @@ -1575,6 +1575,22 @@ void dsa_port_set_tag_protocol(struct dsa_port *cpu_dp, cpu_dp->tag_ops = tag_ops; } +/* dsa_supports_eee - indicate that EEE is supported + * @ds: pointer to &struct dsa_switch + * @port: port index + * + * A default implementation for the .support_eee() DSA operations member, + * which drivers can use to indicate that they support EEE on all of their + * user ports. + * + * Returns: true + */ +bool dsa_supports_eee(struct dsa_switch *ds, int port) +{ + return true; +} +EXPORT_SYMBOL_GPL(dsa_supports_eee); + static void dsa_port_phylink_mac_config(struct phylink_config *config, unsigned int mode, const struct phylink_link_state *state) From patchwork Tue Dec 10 14:18:26 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: 13901536 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 E62FAE77180 for ; Tue, 10 Dec 2024 14:35:45 +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=YeXCOxezUrfM140D6OtvELG0GwtRPEiO0F0OtvPAjDM=; b=R8U29hTjQwwHfUr9GtLf416BNu 8rSf9TEC6N2cZTxE7IhsvdsUBm4aFbBRsOlBdvfkoNScgjN9wn0T1rWgi1eXoQGRv4OGiL3KZdtdN spxE6PodbW90BhfLNZUUIJ1X/DimV1Egs8ceIT4IW7PU8Gg/LoGzAauuRaEnLypphbuEpSh4jo7UW oiSqK+aIb8CpmzrnyJf7EWIaKvp4kP7wqntTFJ829cqzqVzPz8+ovnstByDhJ20d1i67u336nfXpT YGJZB0kVwgZHFTEheHbyxkfpNLBb0PWzMc717//bJbOfa3IISlSPn7Qi8AbqvrCGCZHafIanjr+4M JidklFQA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tL1Km-0000000Bmvk-20Ed; Tue, 10 Dec 2024 14:35:32 +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 1tL14P-0000000BiqZ-0tKs; Tue, 10 Dec 2024 14:18:38 +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=YeXCOxezUrfM140D6OtvELG0GwtRPEiO0F0OtvPAjDM=; b=1lKwWQ0lUNF59KweF14maIy2Ss 8QpyJpAUqZR59MgZF/W24oLzcF/UwiirssAMsOofOaf7MLpFOsQ3Y9RjlXEBs38x/GyXtjXuVvNLS 1TWPbc5ht6Oq2rSLYm1/N6IFYhGI3u039iHymx8m5YJ5S93a2UP04O5t414pHWhg8vRa0j+5zMM7U rr68HtfAbRJ/OGseXFRk8LbCuAV/LF4t5cLrVCeEg+1N9W4E2s2Taa+0hoVoB0BgynpHCioH1W77F EUk271G8y681KXJnh0LE8DYIrMXiaMoE2OVqkWqyk/R/RwkjXRfhwPWVqfyO3JPnTRd42I9SdwtQ4 EwcvK9zw==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:37012 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 1tL14G-0002TT-1W; Tue, 10 Dec 2024 14:18:28 +0000 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1tL14E-006cZU-Nc; Tue, 10 Dec 2024 14:18:26 +0000 In-Reply-To: References: From: "Russell King (Oracle)" To: Andrew Lunn , Heiner Kallweit Cc: AngeloGioacchino Del Regno , "Ar__n__ __NAL" , Daniel Golle , "David S. Miller" , DENG Qingfang , Eric Dumazet , Florian Fainelli , Jakub Kicinski , linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Matthias Brugger , netdev@vger.kernel.org, Paolo Abeni , Sean Wang , Simon Horman , UNGLinuxDriver@microchip.com, Vladimir Oltean , Woojung Huh Subject: [PATCH net-next 4/9] net: dsa: b53/bcm_sf2: implement .support_eee() method MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Tue, 10 Dec 2024 14:18:26 +0000 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241210_061837_249476_77FCCEF8 X-CRM114-Status: GOOD ( 11.35 ) 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 Implement the .support_eee() method to indicate that EEE is not supported by two switch variants, rather than making these checks in the .set_mac_eee() and .get_mac_eee() methods. Signed-off-by: Russell King (Oracle) Reviewed-by: Florian Fainelli --- drivers/net/dsa/b53/b53_common.c | 13 +++++++------ drivers/net/dsa/b53/b53_priv.h | 1 + drivers/net/dsa/bcm_sf2.c | 1 + 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_common.c index 285785c942b0..0561b60f668f 100644 --- a/drivers/net/dsa/b53/b53_common.c +++ b/drivers/net/dsa/b53/b53_common.c @@ -2224,13 +2224,16 @@ int b53_eee_init(struct dsa_switch *ds, int port, struct phy_device *phy) } EXPORT_SYMBOL(b53_eee_init); -int b53_get_mac_eee(struct dsa_switch *ds, int port, struct ethtool_keee *e) +bool b53_support_eee(struct dsa_switch *ds, int port) { struct b53_device *dev = ds->priv; - if (is5325(dev) || is5365(dev)) - return -EOPNOTSUPP; + return !is5325(dev) && !is5365(dev); +} +EXPORT_SYMBOL(b53_support_eee); +int b53_get_mac_eee(struct dsa_switch *ds, int port, struct ethtool_keee *e) +{ return 0; } EXPORT_SYMBOL(b53_get_mac_eee); @@ -2240,9 +2243,6 @@ int b53_set_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; - if (is5325(dev) || is5365(dev)) - return -EOPNOTSUPP; - p->eee_enabled = e->eee_enabled; b53_eee_enable_set(ds, port, e->eee_enabled); @@ -2298,6 +2298,7 @@ static const struct dsa_switch_ops b53_switch_ops = { .phylink_get_caps = b53_phylink_get_caps, .port_enable = b53_enable_port, .port_disable = b53_disable_port, + .support_eee = b53_support_eee, .get_mac_eee = b53_get_mac_eee, .set_mac_eee = b53_set_mac_eee, .port_bridge_join = b53_br_join, diff --git a/drivers/net/dsa/b53/b53_priv.h b/drivers/net/dsa/b53/b53_priv.h index 05141176daf5..99e5cfc98ae8 100644 --- a/drivers/net/dsa/b53/b53_priv.h +++ b/drivers/net/dsa/b53/b53_priv.h @@ -384,6 +384,7 @@ int b53_enable_port(struct dsa_switch *ds, int port, struct phy_device *phy); void b53_disable_port(struct dsa_switch *ds, int port); void b53_brcm_hdr_setup(struct dsa_switch *ds, int port); int b53_eee_init(struct dsa_switch *ds, int port, struct phy_device *phy); +bool b53_support_eee(struct dsa_switch *ds, int port); int b53_get_mac_eee(struct dsa_switch *ds, int port, struct ethtool_keee *e); int b53_set_mac_eee(struct dsa_switch *ds, int port, struct ethtool_keee *e); diff --git a/drivers/net/dsa/bcm_sf2.c b/drivers/net/dsa/bcm_sf2.c index 43bde1f583ff..a53fb6191e6b 100644 --- a/drivers/net/dsa/bcm_sf2.c +++ b/drivers/net/dsa/bcm_sf2.c @@ -1232,6 +1232,7 @@ static const struct dsa_switch_ops bcm_sf2_ops = { .set_wol = bcm_sf2_sw_set_wol, .port_enable = bcm_sf2_port_setup, .port_disable = bcm_sf2_port_disable, + .support_eee = b53_support_eee, .get_mac_eee = b53_get_mac_eee, .set_mac_eee = b53_set_mac_eee, .port_bridge_join = b53_br_join, From patchwork Tue Dec 10 14:18:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 13901537 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 CDD51E7717F for ; Tue, 10 Dec 2024 14:36:46 +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=L8LSqkHv3D/T59pgz0T0Xp73TQhtkzMNkxpBOAj0JmQ=; b=169kZxkYN238RR/Td/CFxmPmnq ub+ASXjs6q1XkH6Sp7Qy9biwqWdVmfPtiEo+NS6EM4CMrWsYYeiQaw7Z6XS0SKpV+zutg/06eHLEj Bw/cu9DhS+jJaXqZKDRjipNIQHtBA3nBRrs3sFEVFvkar3IaUpp8bL/p6z8GhZYsPN1k/txs9w1vt GTsG3okXffDSGK+Uvx1Eu7TL1PTRn7qiHfcjl6WptTyN5ErS6VV2hhu0GxST0z+z0R1RGa5PH2V4A 44HOnoGiKtAnziGFWK2axVYNBYoz3R8doBdjJauL3t/TIGhIpoJP0Ht61K6wJhBzxbeYmg28IgJYQ y+cxvUvw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tL1Lo-0000000Bn9p-1YpE; Tue, 10 Dec 2024 14:36:36 +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 1tL14X-0000000Bit1-0Edb; Tue, 10 Dec 2024 14:18: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=L8LSqkHv3D/T59pgz0T0Xp73TQhtkzMNkxpBOAj0JmQ=; b=APn/RG8iAkylfVUGzGg0Yk/r/x bJ5H0Do+z3x//tzE2nj45tPmmZNelkKhb635P1agZk+vQ/dlke/KwWIdWD/ERDscVKycwFq5IqzqM VCeESG1MXufk/uygGpAKYhn8e2THQsdD2/21avQFCvz709p2yfDqsNMUJzB3yt6pQYewKqLJgzh0y EyVpIM1M/oHFkBNNqNa8cNFdcBx8rDhaYRqQZG9ykh+D2BZMmsYFxW0OZRStmIM1tb03LLIZglZPT oQ5gV+FjKMYrac/X9DrIuhmfGQDN0na4DAl9XpmIvcaAQoWsM3qjurxR6wD+Dm8/5BmVqZmuz9gGt g2kYiDyA==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:37020 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 1tL14M-0002Tq-22; Tue, 10 Dec 2024 14:18:35 +0000 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1tL14J-006cZa-Rh; Tue, 10 Dec 2024 14:18:31 +0000 In-Reply-To: References: From: "Russell King (Oracle)" To: Andrew Lunn , Heiner Kallweit Cc: AngeloGioacchino Del Regno , "Ar__n__ __NAL" , Daniel Golle , "David S. Miller" , DENG Qingfang , Eric Dumazet , Florian Fainelli , Jakub Kicinski , linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Matthias Brugger , netdev@vger.kernel.org, Paolo Abeni , Sean Wang , Simon Horman , UNGLinuxDriver@microchip.com, Vladimir Oltean , Woojung Huh Subject: [PATCH net-next 5/9] net: dsa: mt753x: implement .support_eee() method MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Tue, 10 Dec 2024 14:18:31 +0000 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241210_061845_089543_781E1E6E X-CRM114-Status: UNSURE ( 7.62 ) 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 Implement the .support_eee() method by using the generic helper as all user ports support EEE. Signed-off-by: Russell King (Oracle) Reviewed-by: Florian Fainelli Reviewed-by: Arınç ÜNAL --- drivers/net/dsa/mt7530.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/dsa/mt7530.c b/drivers/net/dsa/mt7530.c index 086b8b3d5b40..9605febd3573 100644 --- a/drivers/net/dsa/mt7530.c +++ b/drivers/net/dsa/mt7530.c @@ -3238,6 +3238,7 @@ const struct dsa_switch_ops mt7530_switch_ops = { .port_mirror_add = mt753x_port_mirror_add, .port_mirror_del = mt753x_port_mirror_del, .phylink_get_caps = mt753x_phylink_get_caps, + .support_eee = dsa_supports_eee, .get_mac_eee = mt753x_get_mac_eee, .set_mac_eee = mt753x_set_mac_eee, .conduit_state_change = mt753x_conduit_state_change, From patchwork Tue Dec 10 14:18:36 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: 13901538 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 62A2FE7717F for ; Tue, 10 Dec 2024 14:37:52 +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=Th5XEizCnNqXk/EU9TbVjgdn9a5uFSC3a1KiqRYzn6I=; b=2niSCX+LablilDS37+Fy6fjpRP +2a1L1OZKx81mISTAAszlUjQ00rqr5ImalIFWUghuwHq/Y2bHCa/2tAI15iL3/qsckYfNm+zD5Poe MDBlHcJHTR7jzwoxgM0c1hpzml5a20kCOCyZWsI+55/YI7RS8q6a0rBc/Rtn7cirtZ4FsmkAippEo 9HHddElPSX8IyJoLIPSTGFQA8y1xg9b2hmk7SnAAXH+DWnNlREelLUYKYoWzk2yO1AfFgYaYNm+xs XUaHF5P4R0DtTYulsbNGuCjNrXXvWpZ5EzzfiHf9/R8koulHDB6NYuVPp68ZLtY9xXYc37qfvmMcK m1XcO0YQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tL1Mq-0000000BnQv-1zas; Tue, 10 Dec 2024 14:37:40 +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 1tL14a-0000000Biug-0W6H; Tue, 10 Dec 2024 14:18:49 +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=Th5XEizCnNqXk/EU9TbVjgdn9a5uFSC3a1KiqRYzn6I=; b=ZM6p6TDRWaV0ZE8tcw6N+7Pwzb KPMUeIePfCWn5BdsGFHhy3PKXcvYk482vE4KRNu4KN0eugE1aWFlZnQUZ7OagJTUhsz445CFDprcj 0rZHAElR5JObUH95IgZHYdJi8aF/un4IcsYEoIJFCJzFrnLtxZ8bV0+L8MrLyY8a73XQ0bOwFh90H LU6782MH2C8oXadoLRoEA3s1vrzAcDu1HyP7YLptQ0SZOlA6LZVWV95jte1qZ7fUTbO3CcbDlEk8U tYOZhikzTHnmqMC/4FkyYM7x8krS718+AJuKZbfpV08ggsbuytY/QQe7yi+YNI9PIgo1wxnktsOpN 2Rah7UvQ==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:40604 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 1tL14Q-0002U8-2E; Tue, 10 Dec 2024 14:18:39 +0000 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1tL14O-006cZg-VM; Tue, 10 Dec 2024 14:18:36 +0000 In-Reply-To: References: From: "Russell King (Oracle)" To: Andrew Lunn , Heiner Kallweit Cc: AngeloGioacchino Del Regno , "Ar__n__ __NAL" , Daniel Golle , "David S. Miller" , DENG Qingfang , Eric Dumazet , Florian Fainelli , Jakub Kicinski , linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Matthias Brugger , netdev@vger.kernel.org, Paolo Abeni , Sean Wang , Simon Horman , UNGLinuxDriver@microchip.com, Vladimir Oltean , Woojung Huh Subject: [PATCH net-next 6/9] net: dsa: qca8k: implement .support_eee() method MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Tue, 10 Dec 2024 14:18:36 +0000 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241210_061848_158602_E64177B9 X-CRM114-Status: UNSURE ( 7.93 ) 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 Implement the .support_eee() method by using the generic helper as all user ports support EEE. Signed-off-by: Russell King (Oracle) Reviewed-by: Florian Fainelli --- drivers/net/dsa/qca/qca8k-8xxx.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/dsa/qca/qca8k-8xxx.c b/drivers/net/dsa/qca/qca8k-8xxx.c index 59b4a7240b58..ec74e3c2b0e9 100644 --- a/drivers/net/dsa/qca/qca8k-8xxx.c +++ b/drivers/net/dsa/qca/qca8k-8xxx.c @@ -2016,6 +2016,7 @@ static const struct dsa_switch_ops qca8k_switch_ops = { .get_ethtool_stats = qca8k_get_ethtool_stats, .get_sset_count = qca8k_get_sset_count, .set_ageing_time = qca8k_set_ageing_time, + .support_eee = dsa_supports_eee, .get_mac_eee = qca8k_get_mac_eee, .set_mac_eee = qca8k_set_mac_eee, .port_enable = qca8k_port_enable, From patchwork Tue Dec 10 14:18:42 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: 13901539 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 60C26E7717F for ; Tue, 10 Dec 2024 14:38:54 +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=QBw3kdsWfeaYZY+i94PpsY0B716chNrcMQ64CIsLjkM=; b=cEXbQz0SQJYfZvFynrnbej4Mmi ak4AUDtianWlzHaeY+usSQX0xjh8uKsYJwh07XpsYijrYEvuBXsf91K1cLUXXqU8Z68us3wBzoyoa kgXmQwdv9N10K+toHNm/Tuq3OVQ8JEI96v14OyZZjImTxQ/XJwskgHhosPCh4ttRD3byRXorGDJpg Zx1FPXMn56o1pksVlNOpbhkFX+u44scqZKvgcvG4fi3gwjoFAgNap5lIbpdfwIw10upuLDs2QDRhC 7hkH4s0rXcDh4NJ8Q8YW5DGvHB9EQkFxp2F4RiHLNwEbzthCK6BSM5p74MjxwIP6DZOfFQSVxuL6S 95hTCKhg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tL1Ns-0000000Bnif-1mWq; Tue, 10 Dec 2024 14:38:44 +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 1tL14g-0000000Biwa-3SY3; Tue, 10 Dec 2024 14:18:55 +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=QBw3kdsWfeaYZY+i94PpsY0B716chNrcMQ64CIsLjkM=; b=WitDPj1uZ6qfMyG2e/kmTBIFSF z3PCrbIaELDiXrxUlqOzbsYB7iij6/iWzIDUHQ7QWehO9qPLxRi9BNzz9xRC4bBVu7o8AdfIZdYtk ppN0idufkyDYuLTnCQ8kvNi5i5CyGP1j/6JRS9fIMMkcb3Hfedl4b8AVW+ByTeJIVBQsPbGOuuGs9 WZnBTom1ErgdEoEn5eNAfphyKHlTP0KGg1ZRJR5ehZrnZ113beNaHGXGmTI+8XII+fCcF2pxGGE6f PRIFmZfuKCEsf2ltdGIWl9r7j0Iw7pE3Tis1W3e7yk300+4MN35vZuo25V1T77fIsgG6hGs0iwStJ fh7hSEsg==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:40608 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 1tL14W-0002UU-0R; Tue, 10 Dec 2024 14:18:44 +0000 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1tL14U-006cZm-2K; Tue, 10 Dec 2024 14:18:42 +0000 In-Reply-To: References: From: "Russell King (Oracle)" To: Andrew Lunn , Heiner Kallweit Cc: AngeloGioacchino Del Regno , "Ar__n__ __NAL" , Daniel Golle , "David S. Miller" , DENG Qingfang , Eric Dumazet , Florian Fainelli , Jakub Kicinski , linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Matthias Brugger , netdev@vger.kernel.org, Paolo Abeni , Sean Wang , Simon Horman , UNGLinuxDriver@microchip.com, Vladimir Oltean , Woojung Huh Subject: [PATCH net-next 7/9] net: dsa: mv88e6xxx: implement .support_eee() method MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Tue, 10 Dec 2024 14:18:42 +0000 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241210_061854_860173_F0C93448 X-CRM114-Status: UNSURE ( 7.93 ) 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 Implement the .support_eee() method by using the generic helper as all user ports support EEE. Signed-off-by: Russell King (Oracle) Reviewed-by: Florian Fainelli --- drivers/net/dsa/mv88e6xxx/chip.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c index 3a792f79270d..1d78974ea2a3 100644 --- a/drivers/net/dsa/mv88e6xxx/chip.c +++ b/drivers/net/dsa/mv88e6xxx/chip.c @@ -7074,6 +7074,7 @@ static const struct dsa_switch_ops mv88e6xxx_switch_ops = { .get_sset_count = mv88e6xxx_get_sset_count, .port_max_mtu = mv88e6xxx_get_max_mtu, .port_change_mtu = mv88e6xxx_change_mtu, + .support_eee = dsa_supports_eee, .get_mac_eee = mv88e6xxx_get_mac_eee, .set_mac_eee = mv88e6xxx_set_mac_eee, .get_eeprom_len = mv88e6xxx_get_eeprom_len, From patchwork Tue Dec 10 14:18:47 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: 13901543 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 393FCE7717F for ; Tue, 10 Dec 2024 14:40:01 +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=0S0cdLQ9gUnRSIENZJ0gUiEWIZ50LEfX82jm6x9CLLw=; b=2q6cVydwEKK0S2Qy86vwklbES5 Sbx/y38ByIqX04uTrjkSXwwqTNJqu66mxM6NgdIMP5TQRoJwq00UrcAHZ47CfgrCHEFItcttogn4v l3dX1sPSeyqF1N6gMknT6oTlH1aGhNd9h1CgACUAclxwXEqp7o1MPZ6E9FiXzXabx+lNYIWC+LVcn 0qneZzEwbU9mXWh/T0pQfyiJimO8q9YeGc+XQ+zA4ap7WCvJPOQ3S6klhio/C13Yi3NX8eM+S0kIW 8bKF9vWamNi3MCgce+Oa4UYnNrAN2SyWoWuZLVRNnfJJqVVIXoXMly/KZDJ5hz+KPhKldorzzi2iG HjFGHREw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tL1Ou-0000000Bnvl-2l3E; Tue, 10 Dec 2024 14:39:48 +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 1tL14k-0000000BixX-0YlS; Tue, 10 Dec 2024 14:18:59 +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=0S0cdLQ9gUnRSIENZJ0gUiEWIZ50LEfX82jm6x9CLLw=; b=A84AYt4uGPMNGxvKBUST7flKVc WKcwVi/grcRjRuZJaBYQU/pFvxNQSLp+8YQ7A90c+++ZId80t7jy8/Sit/JZOTpHICPJGbBHfzZiZ nks5fJ98btK3MSyOes/pH2yUnSemSmjjh55kpZnf1GV4houJfHVbZ9SS+W+aNnRa0rKddWQgkPKQo +hToZ54IlMBETqapm3OtHk2kMcfl6IK8SGNbcbOS33l5oqPhf3MOfZi/KvimqhQvZ2hoc6coIVjXj qBYByUOiJrfQxR87NfKyhwzyr6hkzox+q0X5pT2LucvmyoDdj04oVH9ZqMaezUBuA+5UCXskcf0uW MjZrBW+Q==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:34132 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 1tL14a-0002Uq-27; Tue, 10 Dec 2024 14:18:49 +0000 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1tL14Z-006cZs-6o; Tue, 10 Dec 2024 14:18:47 +0000 In-Reply-To: References: From: "Russell King (Oracle)" To: Andrew Lunn , Heiner Kallweit Cc: AngeloGioacchino Del Regno , "Ar__n__ __NAL" , Daniel Golle , "David S. Miller" , DENG Qingfang , Eric Dumazet , Florian Fainelli , Jakub Kicinski , linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Matthias Brugger , netdev@vger.kernel.org, Paolo Abeni , Sean Wang , Simon Horman , UNGLinuxDriver@microchip.com, Vladimir Oltean , Woojung Huh Subject: [PATCH net-next 8/9] net: dsa: ksz: implement .support_eee() method MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Tue, 10 Dec 2024 14:18:47 +0000 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241210_061858_170589_22D77A0F X-CRM114-Status: GOOD ( 11.46 ) 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 Implement the .support_eee() method by reusing the ksz_validate_eee() method as a template, renaming the function, changing the return type and values, and removing it from the ksz_set_mac_eee() and ksz_get_mac_eee() methods. Signed-off-by: Russell King (Oracle) Reviewed-by: Florian Fainelli --- drivers/net/dsa/microchip/ksz_common.c | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/drivers/net/dsa/microchip/ksz_common.c b/drivers/net/dsa/microchip/ksz_common.c index f5822c57be32..94f9aa983ff6 100644 --- a/drivers/net/dsa/microchip/ksz_common.c +++ b/drivers/net/dsa/microchip/ksz_common.c @@ -3454,12 +3454,12 @@ static int ksz_max_mtu(struct dsa_switch *ds, int port) return -EOPNOTSUPP; } -static int ksz_validate_eee(struct dsa_switch *ds, int port) +static bool ksz_support_eee(struct dsa_switch *ds, int port) { struct ksz_device *dev = ds->priv; if (!dev->info->internal_phy[port]) - return -EOPNOTSUPP; + return false; switch (dev->chip_id) { case KSZ8563_CHIP_ID: @@ -3471,21 +3471,15 @@ static int ksz_validate_eee(struct dsa_switch *ds, int port) case KSZ9896_CHIP_ID: case KSZ9897_CHIP_ID: case LAN9646_CHIP_ID: - return 0; + return true; } - return -EOPNOTSUPP; + return false; } static int ksz_get_mac_eee(struct dsa_switch *ds, int port, struct ethtool_keee *e) { - int ret; - - ret = ksz_validate_eee(ds, port); - if (ret) - return ret; - /* There is no documented control of Tx LPI configuration. */ e->tx_lpi_enabled = true; @@ -3501,11 +3495,6 @@ static int ksz_set_mac_eee(struct dsa_switch *ds, int port, struct ethtool_keee *e) { struct ksz_device *dev = ds->priv; - int ret; - - ret = ksz_validate_eee(ds, port); - if (ret) - return ret; if (!e->tx_lpi_enabled) { dev_err(dev->dev, "Disabling EEE Tx LPI is not supported\n"); @@ -4651,6 +4640,7 @@ static const struct dsa_switch_ops ksz_switch_ops = { .cls_flower_add = ksz_cls_flower_add, .cls_flower_del = ksz_cls_flower_del, .port_setup_tc = ksz_setup_tc, + .support_eee = ksz_support_eee, .get_mac_eee = ksz_get_mac_eee, .set_mac_eee = ksz_set_mac_eee, .port_get_default_prio = ksz_port_get_default_prio, From patchwork Tue Dec 10 14:18:52 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: 13901544 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 2AE71E77180 for ; Tue, 10 Dec 2024 14:41:06 +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=KlYmLFN/8CAJKF2m4Ukp5uw+PCBqObvzNJY6qsnkWK8=; b=HOdgAxFSLmWjW01ainTk0TQqY1 GvPUZBe4y4szHskXUgT8+fj1ouBj6P41C++9rvYevsB0kfgFX9yOhvkZqQ5U0+6AtZt49JwaSjyby Pu3DvFGuygGQicW1E/DcopsgdhUU+qU6O3lrv00HxgUVTFjKHO3bIKGmdUSD27WHZIckXSyjssl7z XKOVP5CQwTFK6/ka9khEgWUgU23IDO+ORiQziou/i4UyzTi6jnjRSF8A8fERy74+I8QnkJE9J+tt+ AQ5ImTBpDNnF1GJBdGnljOdof9QGu69pygm+HSLh3RZY0Bb3bSPxHrjAbs0/Em7WbRVi118Am0mbX 0uOJzojQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tL1Py-0000000BoAt-2QvZ; Tue, 10 Dec 2024 14:40:54 +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 1tL14q-0000000Biyh-03Ot; Tue, 10 Dec 2024 14:19:05 +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=KlYmLFN/8CAJKF2m4Ukp5uw+PCBqObvzNJY6qsnkWK8=; b=F+Pf5dI51Ctrw55VBld9EEk+dn uYLqPJohRuJUK+ymYvnxdIf80s9g9Bj08uB7WAH2hHXUhXZHQdyqRTTbllxx5MN4EZmn49rhRsLq8 38IwM72V3I8y538wVPhUSy9kpvdbVl55DgKCThdHO+woh5oZg+eoQugjppoTuxYgg5ESYhR7WJcF0 xA4aqQF2KcRGIjOkxjx36pssFxR+sTckaCSstoGRiju79IoafOrwQyRvQFc9IAu67qsFfQW4UTRuv SbsK7pUpMmRQjc3DXtGbp1LnKQU9NRrrX+luZanJ3jMFU+CxEMNUqs2HWwdcwt+7GQUoeemjFjnYb 3SgGTBAA==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:34148 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 1tL14g-0002VH-2a; Tue, 10 Dec 2024 14:18:55 +0000 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1tL14e-006cZy-AT; Tue, 10 Dec 2024 14:18:52 +0000 In-Reply-To: References: From: "Russell King (Oracle)" To: Andrew Lunn , Heiner Kallweit Cc: AngeloGioacchino Del Regno , "Ar__n__ __NAL" , Daniel Golle , "David S. Miller" , DENG Qingfang , Eric Dumazet , Florian Fainelli , Jakub Kicinski , linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Matthias Brugger , netdev@vger.kernel.org, Paolo Abeni , Sean Wang , Simon Horman , UNGLinuxDriver@microchip.com, Vladimir Oltean , Woojung Huh Subject: [PATCH net-next 9/9] net: dsa: require .support_eee() method to be implemented MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Tue, 10 Dec 2024 14:18:52 +0000 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241210_061904_055984_EFB92310 X-CRM114-Status: GOOD ( 11.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 Now that we have updated all drivers, switch DSA to require an implementation of the .support_eee() method for EEE to be usable, rather than defaulting to being permissive when not implemented. Signed-off-by: Russell King (Oracle) Reviewed-by: Florian Fainelli --- net/dsa/user.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/dsa/user.c b/net/dsa/user.c index b54f61605a57..4239083c18bf 100644 --- a/net/dsa/user.c +++ b/net/dsa/user.c @@ -1229,7 +1229,7 @@ static int dsa_user_set_eee(struct net_device *dev, struct ethtool_keee *e) int ret; /* Check whether the switch supports EEE */ - if (ds->ops->support_eee && !ds->ops->support_eee(ds, dp->index)) + if (!ds->ops->support_eee || !ds->ops->support_eee(ds, dp->index)) return -EOPNOTSUPP; /* Port's PHY and MAC both need to be EEE capable */ @@ -1253,7 +1253,7 @@ static int dsa_user_get_eee(struct net_device *dev, struct ethtool_keee *e) int ret; /* Check whether the switch supports EEE */ - if (ds->ops->support_eee && !ds->ops->support_eee(ds, dp->index)) + if (!ds->ops->support_eee || !ds->ops->support_eee(ds, dp->index)) return -EOPNOTSUPP; /* Port's PHY and MAC both need to be EEE capable */