From patchwork Tue Aug 22 18:50:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 13361336 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 9D74BEE49AB for ; Tue, 22 Aug 2023 18:50: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: 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=0lzgJCmoR7ON1vf1VaXgKO2OM9mBxKCKeXx3uHIsdGo=; b=ufnxzG9cWRhs3O /B+wtxBBWiUEzIpZHuiyA5n6VdKG3PqnQstRdxJlDpwe+DK5VIZ41BwsyobgjsxZvTya+fm+4SOqW g+WouTyhtuESuVLmwmtyaP7iVAjhfN4xjSYCLTTwNIHinchAeU9T7WNbdEHa7qe9qlpMMN/mEnuRs IjRGfL8iOECPYpKcqEXwS+6INUoawJb89ustpxhEyPckkTgokoD5Og0Y47D75mzTPXgyiZaAY5Mq0 MrUF8fM1cEZukQPmc3VAb5hrD81cZaUidd/Mk6iIcTU62gwQ2w3D70mA/iPsCEh0HIemOs6KV+l0I 2TMNHDfuJrHX/GZLMmlg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qYWSD-00GesG-2z; Tue, 22 Aug 2023 18:50:13 +0000 Received: from [2001:4d48:ad52:32c8:5054:ff:fe00:142] (helo=pandora.armlinux.org.uk) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qYWSA-00Ger5-1v for linux-arm-kernel@lists.infradead.org; Tue, 22 Aug 2023 18:50: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=wXywfinDrh/D4JMPhXkaG0+dtk6nuKfW62AiGbtgz04=; b=cijwVm5Im2kF01pDOJoh7chIpj DIKhoahSWj5nX6Vkf2ekJmjvxJJWMmn1m0WvruccuYULElHi87AHifUDH+arLjFIr02Hs4lpSHQ9g T4WEpEipBFbqxiIGH/GJBtN9QkDrYj/hWUfO5KR6T/LgWzqYcShP+eQZQocw1xBt0DdUAF3ekoTfM TmDD7/4VXbeIEyl3a1n90G19dklgdWgTBXELUGxs072pk+JyZpDUuvrx8tNB2tZ3yHEXPgBLuciwp CiSjwEyHFgliq9/e0qp2RuyqaMVtENkDlAqQkxpj4EmsGlWcE68XS7t13+w42Evea890ezWo6FEug 5Y3fi8Aw==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:33416 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 1qYWS3-0001r8-1I; Tue, 22 Aug 2023 19:50:03 +0100 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1qYWS3-005fXU-Ij; Tue, 22 Aug 2023 19:50:03 +0100 In-Reply-To: References: From: "Russell King (Oracle)" To: Alexandre Torgue , Jose Abreu Cc: Andrew Lunn , "David S. Miller" , Eric Dumazet , Feiyang Chen , Heiner Kallweit , Jakub Kicinski , linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, Maxime Coquelin , netdev@vger.kernel.org, Paolo Abeni Subject: [PATCH net-next 1/9] net: phylink: add phylink_limit_mac_speed() MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Tue, 22 Aug 2023 19:50:03 +0100 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230822_115010_638701_472795A1 X-CRM114-Status: GOOD ( 11.11 ) 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 function which can be used to limit the phylink MAC capabilities to an upper speed limit. Signed-off-by: Russell King (Oracle) --- drivers/net/phy/phylink.c | 18 ++++++++++++++++++ include/linux/phylink.h | 2 ++ 2 files changed, 20 insertions(+) diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c index 160bce608c34..b51cf92392d2 100644 --- a/drivers/net/phy/phylink.c +++ b/drivers/net/phy/phylink.c @@ -426,6 +426,24 @@ static struct { { MAC_10HD, SPEED_10, DUPLEX_HALF }, }; +/** + * phylink_limit_mac_speed - limit the phylink_config to a maximum speed + * @config: pointer to a &struct phylink_config + * @max_speed: maximum speed + * + * Mask off MAC capabilities for speeds higher than the @max_speed parameter. + * Any further motifications of config.mac_capabilities will override this. + */ +void phylink_limit_mac_speed(struct phylink_config *config, u32 max_speed) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(phylink_caps_params) && + phylink_caps_params[i].speed > max_speed; i++) + config->mac_speed &= ~phylink_caps_params.mask; +} +EXPORT_SYMBOL_GPL(phylink_limit_mac_speed); + /** * phylink_cap_from_speed_duplex - Get mac capability from speed/duplex * @speed: the speed to search for diff --git a/include/linux/phylink.h b/include/linux/phylink.h index 789c516c6b4a..7d07f8736431 100644 --- a/include/linux/phylink.h +++ b/include/linux/phylink.h @@ -223,6 +223,8 @@ struct phylink_config { unsigned long mac_capabilities; }; +void phylink_limit_mac_speed(struct phylink_config *config, u32 max_speed); + /** * struct phylink_mac_ops - MAC operations structure. * @validate: Validate and update the link configuration. From patchwork Tue Aug 22 18:50:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 13361337 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 765CAEE49AE for ; Tue, 22 Aug 2023 18:50:53 +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=aasJhOIEe80FrFRqAzAdDucSPQ6DrvFC0dImOuTyLRA=; b=2rnCBlqgXA4l9g sV/mhKlm1Yj59a7r/+t5s2YCtAVz5MfZeZCSDQmzCGvkjk9TwPhD4SrodOucm0EKPMIVRZ5WWO/ks tz2WveQVq8L3RvUKEGr9BY54zHRHCX1dranbTZo/CKCkaCcCf1cFIoJSOrAxnYuuE5c0xo2/gTfCQ OlyNUo3bRlMwvItPvQddpXQi+AurJ0sqTfBcoKBizJf3QSJKsW84zgvgjwUS8jPE32S8ZshdUvwYu 48kNamaFmnfjywTXeN5tOzGckjBi8yY6//M4Fn5pkqGspWZqygubTnGm3YFxfRiTRKPdriq+yfNja 2aWuDAOWHxEQ8viiG4oA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qYWSL-00Geuf-29; Tue, 22 Aug 2023 18:50:21 +0000 Received: from [2001:4d48:ad52:32c8:5054:ff:fe00:142] (helo=pandora.armlinux.org.uk) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qYWSD-00Gerq-0n for linux-arm-kernel@lists.infradead.org; Tue, 22 Aug 2023 18:50:15 +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=ctf+gHySOP5Wm8CJUoGTJUIHkbgxUwCF/1UiE1lOtX0=; b=RKgos06Ui7zkoTdCIwymGUh+10 wqvmXcxJbxTBJM5nQJeuHXEELmtQcW/j3UVI+XtxFTIYln0lw9x5RUMc6j9kN/lKxuE9ZxHDANip2 virNaxEsdIq9z32/0fISvqgT/O1zv5wt8KyGit5zOlMSB8lykUEldZXLDPW8cA/0WBO8cTVkpblJn 3Bve0O4BeU8Lc89kaqC9fWfdZyfyiYz43/ql0RviOL73BpWsMh7IeaSm5EHh5fQShxYigXBx7Mkoc 7PPOan/z8vDjUarqv3dT804ohVfCOi6aUuLcHWm1CC9/miXpNNzzjg8CKVrnHMFs5x2Aa5ThIayEu T6NzrC/Q==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:45032 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 1qYWS8-0001rK-1U; Tue, 22 Aug 2023 19:50:08 +0100 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1qYWS8-005fXa-OQ; Tue, 22 Aug 2023 19:50:08 +0100 In-Reply-To: References: From: "Russell King (Oracle)" To: Alexandre Torgue , Jose Abreu Cc: Andrew Lunn , "David S. Miller" , Eric Dumazet , Feiyang Chen , Heiner Kallweit , Jakub Kicinski , linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, Maxime Coquelin , netdev@vger.kernel.org, Paolo Abeni Subject: [PATCH net-next 2/9] net: stmmac: convert plat->phylink_node to fwnode MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Tue, 22 Aug 2023 19:50:08 +0100 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230822_115013_281843_32C2A821 X-CRM114-Status: GOOD ( 16.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 All users of plat->phylink_node first convert it to a fwnode. Rather than repeatedly convert to a fwnode, store it as a fwnode. To reflect this change, call it plat->port_node instead - it is used for more than just phylink. Signed-off-by: Russell King (Oracle) --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 4 ++-- drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c | 3 ++- drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 2 +- include/linux/stmmac.h | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 7a9bbcf03ea5..a2dfb624e10c 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -1153,7 +1153,7 @@ static int stmmac_init_phy(struct net_device *dev) if (!phylink_expects_phy(priv->phylink)) return 0; - fwnode = of_fwnode_handle(priv->plat->phylink_node); + fwnode = priv->plat->port_node; if (!fwnode) fwnode = dev_fwnode(priv->device); @@ -1200,7 +1200,7 @@ static int stmmac_init_phy(struct net_device *dev) static int stmmac_phy_setup(struct stmmac_priv *priv) { struct stmmac_mdio_bus_data *mdio_bus_data = priv->plat->mdio_bus_data; - struct fwnode_handle *fwnode = of_fwnode_handle(priv->plat->phylink_node); + struct fwnode_handle *fwnode = priv->plat->port_node; int max_speed = priv->plat->max_speed; int mode = priv->plat->phy_interface; struct phylink *phylink; diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c index dd9e2fec5328..fa9e7e7040b9 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c @@ -533,11 +533,11 @@ int stmmac_mdio_register(struct net_device *ndev) int err = 0; struct mii_bus *new_bus; struct stmmac_priv *priv = netdev_priv(ndev); - struct fwnode_handle *fwnode = of_fwnode_handle(priv->plat->phylink_node); struct stmmac_mdio_bus_data *mdio_bus_data = priv->plat->mdio_bus_data; struct device_node *mdio_node = priv->plat->mdio_node; struct device *dev = ndev->dev.parent; struct fwnode_handle *fixed_node; + struct fwnode_handle *fwnode; int addr, found, max_addr; if (!mdio_bus_data) @@ -601,6 +601,7 @@ int stmmac_mdio_register(struct net_device *ndev) stmmac_xgmac2_mdio_read_c45(new_bus, 0, 0, 0); /* If fixed-link is set, skip PHY scanning */ + fwnode = priv->plat->port_node; if (!fwnode) fwnode = dev_fwnode(priv->device); diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c index be8e79c7aa34..ff330423ee66 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c @@ -428,7 +428,7 @@ stmmac_probe_config_dt(struct platform_device *pdev, u8 *mac) plat->phy_node = of_parse_phandle(np, "phy-handle", 0); /* PHYLINK automatically parses the phy-handle property */ - plat->phylink_node = np; + plat->port_node = of_fwnode_handle(np); /* Get max speed of operation from device tree */ of_property_read_u32(np, "max-speed", &plat->max_speed); diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h index 784277d666eb..b2ccd827bb80 100644 --- a/include/linux/stmmac.h +++ b/include/linux/stmmac.h @@ -227,7 +227,7 @@ struct plat_stmmacenet_data { phy_interface_t phy_interface; struct stmmac_mdio_bus_data *mdio_bus_data; struct device_node *phy_node; - struct device_node *phylink_node; + struct fwnode_handle *port_node; struct device_node *mdio_node; struct stmmac_dma_cfg *dma_cfg; struct stmmac_est *est; From patchwork Tue Aug 22 18:50:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 13361339 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 D3909EE49AB for ; Tue, 22 Aug 2023 18:51: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: 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=67+NaX8V9rkXR25e754AnxoVFvjEKXLZke1FOKooDJk=; b=MziCFLoCTpwbj2 F4W2Qhb2IctUqW//yF7Lu1OGLGw1wu4abFHwN/l8yw2CixhHAePZl/ZdYDfh+TotIV0HC7JgXRoaX MM8hITnBClq8fV4/4v2SOozqbqEnC64FqEOQ7XeG+5K+IrvRE5b5/RttYRnNtcQ22rY3RZ4auYd9I tZBUiJZZWL2GNz38bPxs9M6R90UR/IBGh75KQd8LYzhXObZJydCngzkGVjLSUGlrAiXYmVbBqAcWd Z69h2DUGX/LGeWOI4unuHnGz5PRsgI6jYV/rWZ1E86E6yOc5ZrbiAz4AH/0u5IIdqr3bpDV9WMJ7Z 0LYY7sJ9rOudxvSNMORg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qYWST-00Geye-1N; Tue, 22 Aug 2023 18:50:29 +0000 Received: from [2001:4d48:ad52:32c8:5054:ff:fe00:142] (helo=pandora.armlinux.org.uk) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qYWSK-00GetC-0u for linux-arm-kernel@lists.infradead.org; Tue, 22 Aug 2023 18:50:22 +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=r6O6RSRp6YDHbbpq6uICMyLDTLB4GW3APZkGyfsKHnU=; b=rlIP6T1Z2Q6/csYsvsq82M2wx8 enLZR1bJp4TkvruHLHBAYvvdJ3GI3aOxhOoiobpBM8ZhFAaQcY1HNJUp/vjpxtbJHJphjWDNRHsya pbsCT2mfoX5FVq2h9acpx6wy7biPwiuSJJ6100C7QZ5/JFHQMKGf/3KEcsQtDhoTA1oCu1FJaZePL HKE9TU8e09PYq7Wd8AoqfpLpQxu3ZmdL0so3WtEp0T6l/MnspH+lLHm0rWoQt9KLQDiBCx3AjWUmw qHcx/uoWc2CZTjA5yGNSsLO38VRJWnbCNznpPZylCQ3NDEVkZvyXaGBTsVe2OfvveHqelAz8KAe+9 MQvWIR5g==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:45036 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 1qYWSD-0001rc-23; Tue, 22 Aug 2023 19:50:13 +0100 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1qYWSD-005fXl-TP; Tue, 22 Aug 2023 19:50:13 +0100 In-Reply-To: References: From: "Russell King (Oracle)" To: Alexandre Torgue , Jose Abreu Cc: Andrew Lunn , "David S. Miller" , Eric Dumazet , Feiyang Chen , Heiner Kallweit , Jakub Kicinski , linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, Maxime Coquelin , netdev@vger.kernel.org, Paolo Abeni Subject: [PATCH net-next 3/9] net: stmmac: clean up passing fwnode to phylink MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Tue, 22 Aug 2023 19:50:13 +0100 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230822_115020_317444_B7D38EF9 X-CRM114-Status: GOOD ( 10.80 ) 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 Move the initialisation of the fwnode variable closer to its use site, rather than scattered throughout stmmac_phy_setup(). Signed-off-by: Russell King (Oracle) --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index a2dfb624e10c..7d97166194b5 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -1200,9 +1200,9 @@ static int stmmac_init_phy(struct net_device *dev) static int stmmac_phy_setup(struct stmmac_priv *priv) { struct stmmac_mdio_bus_data *mdio_bus_data = priv->plat->mdio_bus_data; - struct fwnode_handle *fwnode = priv->plat->port_node; int max_speed = priv->plat->max_speed; int mode = priv->plat->phy_interface; + struct fwnode_handle *fwnode; struct phylink *phylink; priv->phylink_config.dev = &priv->dev->dev; @@ -1211,9 +1211,6 @@ static int stmmac_phy_setup(struct stmmac_priv *priv) priv->phylink_config.ovr_an_inband = mdio_bus_data->xpcs_an_inband; - if (!fwnode) - fwnode = dev_fwnode(priv->device); - /* Set the platform/firmware specified interface mode */ __set_bit(mode, priv->phylink_config.supported_interfaces); @@ -1254,6 +1251,10 @@ static int stmmac_phy_setup(struct stmmac_priv *priv) ~(MAC_10HD | MAC_100HD | MAC_1000HD); priv->phylink_config.mac_managed_pm = true; + fwnode = priv->plat->port_node; + if (!fwnode) + fwnode = dev_fwnode(priv->device); + phylink = phylink_create(&priv->phylink_config, fwnode, mode, &stmmac_phylink_mac_ops); if (IS_ERR(phylink)) From patchwork Tue Aug 22 18:50:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 13361338 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 971BFEE49AB for ; Tue, 22 Aug 2023 18:50:58 +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=ShpJo77gEIGJkT1w27G3RjyMtjtVO3PGnY4t9vaO3U8=; b=DVv9QRUqO3uQE4 CfTnt9Ev7gkpBZhF17+2XyE5kOMXU45NrvVXq6sszerbsAUrWrgSHYLHC3pKPT9YNVz4pONQmv6Kk YrE+puCxZDjjGvIpwyg7s/Y8V5Zmoiru0mBbtpeV4J9nKgi+S/aYRlsVrPtc60ANKEqyrWxP6ochF v1lk6JAEt4z9/7lXrEDJfyWva8a4FXxLvohWGqy6Ltdz1NpNJSEkvc5UrUr5qp7z9uR8Pxixp7IkM 0cGffGDptKNiNXfkWBVj9D7amzu/o113hndYRZUlITMOo5vvHkLl4vojYVDALBZBlNQiJTAwqHPmV G6slKz1k4XgAnPgDVuwQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qYWST-00Gez7-32; Tue, 22 Aug 2023 18:50:29 +0000 Received: from [2001:4d48:ad52:32c8:5054:ff:fe00:142] (helo=pandora.armlinux.org.uk) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qYWSN-00Gew8-2p for linux-arm-kernel@lists.infradead.org; Tue, 22 Aug 2023 18:50: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=+PIAFvnnVRoqBc3oEJJkW0gQZ7UP+fUDByEcVubuzS0=; b=rYdVHBW1mnILRLn2nkRxHDjBM8 D2/2fjXQhwIZ9856rMCRz2LsQliUybTS8V7/X8gpwul3ngsfqZNKGMIrwGIkSiYl9mxnryz+skSux GNfurXnrZ93hbwiaolggEadQjrJYiDswuu1OIIsSKa2Z/102fQjxkOOzSPGLi8cYo4XO80wmHnOxQ b/7elxhhuwruHvh0Siwyfg4p8prMefT9HiK08+PIJrwmmKrS/xL6VBbXyQOx9F1bMsTByz8ZMkDYq CUk/eCyVqEStIXurMmilBALEiQ2QBZdhbHweYrlpKoHOSwKsms4nbzzgRuqzdNcQpEbRsm1FqQmwm y+AWFv3Q==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:60680 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 1qYWSI-0001rt-2M; Tue, 22 Aug 2023 19:50:18 +0100 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1qYWSJ-005fXr-2M; Tue, 22 Aug 2023 19:50:19 +0100 In-Reply-To: References: From: "Russell King (Oracle)" To: Alexandre Torgue , Jose Abreu Cc: Andrew Lunn , "David S. Miller" , Eric Dumazet , Feiyang Chen , Heiner Kallweit , Jakub Kicinski , linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, Maxime Coquelin , netdev@vger.kernel.org, Paolo Abeni Subject: [PATCH net-next 4/9] net: stmmac: use "mdio_bus_data" local variable MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Tue, 22 Aug 2023 19:50:19 +0100 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230822_115023_914489_D3A12B2F X-CRM114-Status: GOOD ( 11.45 ) 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 We have a local variable for priv->plat->mdio_bus_data, which we use later in the conditional if() block, but we evaluate the above within the conditional expression. Use mdio_bus_data instead. Since these will be the only two users of this local variable, move its assignment just before the if(). Signed-off-by: Russell King (Oracle) --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 7d97166194b5..fe733a9f5fe4 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -1199,7 +1199,7 @@ static int stmmac_init_phy(struct net_device *dev) static int stmmac_phy_setup(struct stmmac_priv *priv) { - struct stmmac_mdio_bus_data *mdio_bus_data = priv->plat->mdio_bus_data; + struct stmmac_mdio_bus_data *mdio_bus_data; int max_speed = priv->plat->max_speed; int mode = priv->plat->phy_interface; struct fwnode_handle *fwnode; @@ -1207,7 +1207,9 @@ static int stmmac_phy_setup(struct stmmac_priv *priv) priv->phylink_config.dev = &priv->dev->dev; priv->phylink_config.type = PHYLINK_NETDEV; - if (priv->plat->mdio_bus_data) + + mdio_bus_data = priv->plat->mdio_bus_data; + if (mdio_bus_data) priv->phylink_config.ovr_an_inband = mdio_bus_data->xpcs_an_inband; From patchwork Tue Aug 22 18:50:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 13361342 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 70BC2EE49AF for ; Tue, 22 Aug 2023 18:51:15 +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=Dw0fpJ8/xA4LV2aJJS2XeT5KpSjGqYcedSfjLmg7TUI=; b=mgOEtF/7ZXpOfj 8o5z28zm38ybTqCQHrzxXH1ExP1L04nmlQpWxxSYnzGRNqTQiLHhFfOAKlqSBzvlnmUz6aUF7dfxJ yi5OOr02FvN7/oXzNBZyI7rWfj+9s4tT30vDtDTx54Wek5T5yptEOCeLdi0uXkBCVLQY1AYScz1Fa pqn+zeMVhuDBFfXOXmHZW5gaOiaAFXF+qk5+997CDiPuVUxoZXCkYSbrA4Ci5FfbBxKiV0Q+cogot AllD6f/WjnyUeJp4hctb7se6DOv2hnZjX6uCfnWj4HMubUiTgf+v9pZ03IlNRh+ALlPcQqJWnB0kJ zQYJNYNmhJdRHgm/7nEA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qYWSi-00Gf3s-33; Tue, 22 Aug 2023 18:50:44 +0000 Received: from [2001:4d48:ad52:32c8:5054:ff:fe00:142] (helo=pandora.armlinux.org.uk) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qYWST-00GexZ-23 for linux-arm-kernel@lists.infradead.org; Tue, 22 Aug 2023 18:50:31 +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=1tv6fisyvS73i6//4dmGh/vQfdBvtphslZxi1hPSN2s=; b=OsI6psZgHcUwQT+mvJq12eNeUk qU4bTw0s29HC1LWcjZuNwL1ZoRdNKSTTRjYwqcswBiw4GC9MZpERGk/Q2375hlYu3Gd8DFwJq3pBw JVv0LN+47EJbHkeWTmdAGomxhsXqPXa3sPJJ0Wbu678jOOUpUG4iFmUBHC017Yq15m7aXAye+qwUO mCxoacmafvoM45tbQo3Nur/pbc/DfkMlWu76h7+fI6MIIsajVQ4carU8NrHkiCHeH375+ulGj6Nx2 HBBFeFVssiVs4O7BKINPZTXUNE+wlXMR7/bBatB3XV4keBqQcyKGReaPkcFPGEMeHA7QO6JqKbiwr 0631/Abg==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:60688 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 1qYWSN-0001sA-33; Tue, 22 Aug 2023 19:50:23 +0100 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1qYWSO-005fXx-6w; Tue, 22 Aug 2023 19:50:24 +0100 In-Reply-To: References: From: "Russell King (Oracle)" To: Alexandre Torgue , Jose Abreu Cc: Andrew Lunn , "David S. Miller" , Eric Dumazet , Feiyang Chen , Heiner Kallweit , Jakub Kicinski , linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, Maxime Coquelin , netdev@vger.kernel.org, Paolo Abeni Subject: [PATCH net-next 5/9] net: stmmac: use phylink_limit_mac_speed() MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Tue, 22 Aug 2023 19:50:24 +0100 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230822_115029_681128_9C8EBD81 X-CRM114-Status: GOOD ( 13.32 ) 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 Use phylink_limit_mac_speed() to limit the MAC capabilities rather than coding this for each speed. Signed-off-by: Russell King (Oracle) --- .../net/ethernet/stmicro/stmmac/stmmac_main.c | 35 ++++++++----------- drivers/net/phy/phylink.c | 2 +- 2 files changed, 15 insertions(+), 22 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index fe733a9f5fe4..30a085f2b8fa 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -1200,10 +1200,10 @@ static int stmmac_init_phy(struct net_device *dev) static int stmmac_phy_setup(struct stmmac_priv *priv) { struct stmmac_mdio_bus_data *mdio_bus_data; - int max_speed = priv->plat->max_speed; int mode = priv->plat->phy_interface; struct fwnode_handle *fwnode; struct phylink *phylink; + int max_speed; priv->phylink_config.dev = &priv->dev->dev; priv->phylink_config.type = PHYLINK_NETDEV; @@ -1222,29 +1222,18 @@ static int stmmac_phy_setup(struct stmmac_priv *priv) priv->phylink_config.supported_interfaces); priv->phylink_config.mac_capabilities = MAC_ASYM_PAUSE | MAC_SYM_PAUSE | - MAC_10 | MAC_100; - - if (!max_speed || max_speed >= 1000) - priv->phylink_config.mac_capabilities |= MAC_1000; + MAC_10 | MAC_100 | MAC_1000; if (priv->plat->has_gmac4) { - if (!max_speed || max_speed >= 2500) - priv->phylink_config.mac_capabilities |= MAC_2500FD; + priv->phylink_config.mac_capabilities |= MAC_2500FD; } else if (priv->plat->has_xgmac) { - if (!max_speed || max_speed >= 2500) - priv->phylink_config.mac_capabilities |= MAC_2500FD; - if (!max_speed || max_speed >= 5000) - priv->phylink_config.mac_capabilities |= MAC_5000FD; - if (!max_speed || max_speed >= 10000) - priv->phylink_config.mac_capabilities |= MAC_10000FD; - if (!max_speed || max_speed >= 25000) - priv->phylink_config.mac_capabilities |= MAC_25000FD; - if (!max_speed || max_speed >= 40000) - priv->phylink_config.mac_capabilities |= MAC_40000FD; - if (!max_speed || max_speed >= 50000) - priv->phylink_config.mac_capabilities |= MAC_50000FD; - if (!max_speed || max_speed >= 100000) - priv->phylink_config.mac_capabilities |= MAC_100000FD; + priv->phylink_config.mac_capabilities |= MAC_2500FD; + priv->phylink_config.mac_capabilities |= MAC_5000FD; + priv->phylink_config.mac_capabilities |= MAC_10000FD; + priv->phylink_config.mac_capabilities |= MAC_25000FD; + priv->phylink_config.mac_capabilities |= MAC_40000FD; + priv->phylink_config.mac_capabilities |= MAC_50000FD; + priv->phylink_config.mac_capabilities |= MAC_100000FD; } /* Half-Duplex can only work with single queue */ @@ -1253,6 +1242,10 @@ static int stmmac_phy_setup(struct stmmac_priv *priv) ~(MAC_10HD | MAC_100HD | MAC_1000HD); priv->phylink_config.mac_managed_pm = true; + max_speed = priv->plat->max_speed; + if (max_speed) + phylink_limit_mac_speed(&priv->phylink_config, max_speed); + fwnode = priv->plat->port_node; if (!fwnode) fwnode = dev_fwnode(priv->device); diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c index b51cf92392d2..0d7354955d62 100644 --- a/drivers/net/phy/phylink.c +++ b/drivers/net/phy/phylink.c @@ -440,7 +440,7 @@ void phylink_limit_mac_speed(struct phylink_config *config, u32 max_speed) for (i = 0; i < ARRAY_SIZE(phylink_caps_params) && phylink_caps_params[i].speed > max_speed; i++) - config->mac_speed &= ~phylink_caps_params.mask; + config->mac_capabilities &= ~phylink_caps_params[i].mask; } EXPORT_SYMBOL_GPL(phylink_limit_mac_speed); From patchwork Tue Aug 22 18:50:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 13361340 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 1C59CEE49AE for ; Tue, 22 Aug 2023 18:51:11 +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=28p55mu5zX81yeUMsWKv6V8suKSr9UuNBHnw5VCwVK0=; b=CSXiiU113BZ/0X tiJypyWWrAXbM9qqrnmYwRAZgaKZxtWBQmX/rHWX0KqVcqqKebvvytWQ6/jD5U2N7hI409/VdIR2v I0NbkL7TWONb+tO/TKa8/NnTwSjeHMJSLs1Hhb1cYHDi+untr5EdQfzW83oV8z5b1p/5hekSng6dC +se9Y5x8p8+YFfGS2nZT+wl+YLeH+gctl0Nmh0Pqx+goLFScujL0jieEV3O4/RYmSsNYivT5cqEjx MW8R+5rL6pSEVe3+UOTA6l0jMlXmRhmLWZF0nT7KYE83hN4EN0SndrImX3NsuJ2xgmZQVMV9+52KR NK0Yt4ObDTUAEfaH3suQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qYWSj-00Gf48-1Q; Tue, 22 Aug 2023 18:50:45 +0000 Received: from [2001:4d48:ad52:32c8:5054:ff:fe00:142] (helo=pandora.armlinux.org.uk) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qYWSY-00Gf0C-1r for linux-arm-kernel@lists.infradead.org; Tue, 22 Aug 2023 18:50:36 +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=gSPuoQfwVLrPWrtdJC+nSwuuoMMWAeEQDe33DPw00Bc=; b=uE1TgtEfrV2LiJCXaYJbeRW/Rh /OHpLd3FbZsCveU8lafHJjERptb6FHsslsIZfpxUdgpBPSXqgDlRJ4ylXn9yDjE/2thZ7I0RQjWVU WLUmh3WVZYD4CyyYlGKNFUAvhmNkAZ8/2s3+HUK+088g0oW7ENsdISUx1/YyqpC2+R/0fjU3V9T00 W5eEeQD7TzfZR7zsyUl0sWxvtJh5sQ0haopUa+F8E/6ICAmpWWlC+T34VUimcTveO6rN4FkWlHkEM f25rb24SRd8ZLMcd+ytCzlTuNbYd99thm9d5LaBVvBnYBQcWyRWP6tyIkTm5F+6fASbGiGGGpuc1x F0RsDs5w==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:46862 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 1qYWST-0001sS-0E; Tue, 22 Aug 2023 19:50:29 +0100 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1qYWST-005fY3-C9; Tue, 22 Aug 2023 19:50:29 +0100 In-Reply-To: References: From: "Russell King (Oracle)" To: Alexandre Torgue , Jose Abreu Cc: Andrew Lunn , "David S. Miller" , Eric Dumazet , Feiyang Chen , Heiner Kallweit , Jakub Kicinski , linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, Maxime Coquelin , netdev@vger.kernel.org, Paolo Abeni Subject: [PATCH net-next 6/9] net: stmmac: provide stmmac_mac_phylink_get_caps() MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Tue, 22 Aug 2023 19:50:29 +0100 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230822_115034_619625_5E02B390 X-CRM114-Status: GOOD ( 11.90 ) 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 Allow MACs to provide their own capabilities via the MAC operations struct. Signed-off-by: Russell King (Oracle) --- drivers/net/ethernet/stmicro/stmmac/hwif.h | 4 ++++ drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 3 +++ 2 files changed, 7 insertions(+) diff --git a/drivers/net/ethernet/stmicro/stmmac/hwif.h b/drivers/net/ethernet/stmicro/stmmac/hwif.h index 238f17c50a1e..b95d3e137813 100644 --- a/drivers/net/ethernet/stmicro/stmmac/hwif.h +++ b/drivers/net/ethernet/stmicro/stmmac/hwif.h @@ -300,6 +300,8 @@ struct stmmac_est; struct stmmac_ops { /* MAC core initialization */ void (*core_init)(struct mac_device_info *hw, struct net_device *dev); + /* Get phylink capabilities */ + void (*phylink_get_caps)(struct stmmac_priv *priv); /* Enable the MAC RX/TX */ void (*set_mac)(void __iomem *ioaddr, bool enable); /* Enable and verify that the IPC module is supported */ @@ -419,6 +421,8 @@ struct stmmac_ops { #define stmmac_core_init(__priv, __args...) \ stmmac_do_void_callback(__priv, mac, core_init, __args) +#define stmmac_mac_phylink_get_caps(__priv) \ + stmmac_do_void_callback(__priv, mac, phylink_get_caps, __priv) #define stmmac_mac_set(__priv, __args...) \ stmmac_do_void_callback(__priv, mac, set_mac, __args) #define stmmac_rx_ipc(__priv, __args...) \ diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 30a085f2b8fa..a9cf6aecdddf 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -1224,6 +1224,9 @@ static int stmmac_phy_setup(struct stmmac_priv *priv) priv->phylink_config.mac_capabilities = MAC_ASYM_PAUSE | MAC_SYM_PAUSE | MAC_10 | MAC_100 | MAC_1000; + /* Get the MAC specific capabilities */ + stmmac_mac_phylink_get_caps(priv); + if (priv->plat->has_gmac4) { priv->phylink_config.mac_capabilities |= MAC_2500FD; } else if (priv->plat->has_xgmac) { From patchwork Tue Aug 22 18:50:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 13361341 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 E6635EE49AE for ; Tue, 22 Aug 2023 18:51:14 +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=xo6OHWpXoidns8HUvZRVrpwZbyNTUUTvGMi+1wIDn6E=; b=HJoR1aUKqn8U6f UOdLKL+yODarsI+bYr80QV1PTKyOqvS5PY3Jn67hjXIu92TpTeNCD0QMIEwJxQvENz/WWpnw7bYdi uOJw/4gCX+T6M/VRO4rV0dLs0lISgRqsBCT8Q5x2KIOzCkI2Q2UQKNXbgp5nOlNYSuGAulvIR87D2 zZekQEbJbraROERj1vG4q/vfWsfcS7KztLe1DKPREJ3PIYDAITA9ZcXRGYytDuGzDfx0SMpKHGKzc tBevRdJ4Zksu9Ybr4+qNoOpD2Z5EE6wgauZlCGhOrzOg+s4kHMmcwMocGJKjLNnGwDgIyS+LAYGP1 hog/i2j9Lale5x2/rtfg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qYWSk-00Gf4t-0K; Tue, 22 Aug 2023 18:50:46 +0000 Received: from [2001:4d48:ad52:32c8:5054:ff:fe00:142] (helo=pandora.armlinux.org.uk) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qYWSd-00Gf20-2Z for linux-arm-kernel@lists.infradead.org; Tue, 22 Aug 2023 18:50: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=hVOCuc5IYYSeGY5UU7ESNANeOTu+gCFR0FT1EEk+RqY=; b=OsfL23fKVLXUJo+ZsF5lvgJKSO pBZhMDBfgFyIjIqVsv4peZBbORaaZUKKqcfdndD9tAkMtg5GRKeL2PGHOE8Nqo/VIh8wnVahTd+w8 IvUqgsL/KqUpCuQyZBCky+FFhlcYgCLcIlYtj5kBVbLF21cVGcn7Ls0+j+4Mu19ZWMg0v9T+kRIzb tGoQrTatHpz9ddVDi5q7TyrvNmZ1Y25oqPg5gCrle3G6zlar1x6sZFvTx8Xm+vnKJBcN0j9e+tG+C I9Qa5WZZrEKseIJF1H5mxGnF2oRQmYoITm3q2vNhjNbbJRMAhDeyzYUksbSqfyPfOISzrl9POh3Kh VGYoZOPA==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:46866 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 1qYWSY-0001si-0d; Tue, 22 Aug 2023 19:50:34 +0100 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1qYWSY-005fY9-Gm; Tue, 22 Aug 2023 19:50:34 +0100 In-Reply-To: References: From: "Russell King (Oracle)" To: Alexandre Torgue , Jose Abreu Cc: Andrew Lunn , "David S. Miller" , Eric Dumazet , Feiyang Chen , Heiner Kallweit , Jakub Kicinski , linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, Maxime Coquelin , netdev@vger.kernel.org, Paolo Abeni Subject: [PATCH net-next 7/9] net: stmmac: move gmac4 specific phylink capabilities to gmac4 MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Tue, 22 Aug 2023 19:50:34 +0100 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230822_115039_834374_21A8E18A X-CRM114-Status: GOOD ( 11.67 ) 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 Move the setup of gmac4 speicifc phylink capabilities into gmac4 code. Signed-off-by: Russell King (Oracle) --- drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c | 8 ++++++++ drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 4 +--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c b/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c index 03b1c5a97826..c6ff1fa0e04d 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c @@ -68,6 +68,11 @@ static void dwmac4_core_init(struct mac_device_info *hw, init_waitqueue_head(&priv->tstamp_busy_wait); } +static void dwmac4_phylink_get_caps(struct stmmac_priv *priv) +{ + priv->phylink_config.mac_capabilities |= MAC_2500FD; +} + static void dwmac4_rx_queue_enable(struct mac_device_info *hw, u8 mode, u32 queue) { @@ -1131,6 +1136,7 @@ static int dwmac4_config_l4_filter(struct mac_device_info *hw, u32 filter_no, const struct stmmac_ops dwmac4_ops = { .core_init = dwmac4_core_init, + .phylink_get_caps = dwmac4_phylink_get_caps, .set_mac = stmmac_set_mac, .rx_ipc = dwmac4_rx_ipc_enable, .rx_queue_enable = dwmac4_rx_queue_enable, @@ -1173,6 +1179,7 @@ const struct stmmac_ops dwmac4_ops = { const struct stmmac_ops dwmac410_ops = { .core_init = dwmac4_core_init, + .phylink_get_caps = dwmac4_phylink_get_caps, .set_mac = stmmac_dwmac4_set_mac, .rx_ipc = dwmac4_rx_ipc_enable, .rx_queue_enable = dwmac4_rx_queue_enable, @@ -1221,6 +1228,7 @@ const struct stmmac_ops dwmac410_ops = { const struct stmmac_ops dwmac510_ops = { .core_init = dwmac4_core_init, + .phylink_get_caps = dwmac4_phylink_get_caps, .set_mac = stmmac_dwmac4_set_mac, .rx_ipc = dwmac4_rx_ipc_enable, .rx_queue_enable = dwmac4_rx_queue_enable, diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index a9cf6aecdddf..0b02845e7e9d 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -1227,9 +1227,7 @@ static int stmmac_phy_setup(struct stmmac_priv *priv) /* Get the MAC specific capabilities */ stmmac_mac_phylink_get_caps(priv); - if (priv->plat->has_gmac4) { - priv->phylink_config.mac_capabilities |= MAC_2500FD; - } else if (priv->plat->has_xgmac) { + if (priv->plat->has_xgmac) { priv->phylink_config.mac_capabilities |= MAC_2500FD; priv->phylink_config.mac_capabilities |= MAC_5000FD; priv->phylink_config.mac_capabilities |= MAC_10000FD; From patchwork Tue Aug 22 18:50:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 13361343 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 A9B1CEE49AB for ; Tue, 22 Aug 2023 18:51: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: 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=/U3pMUk3jYGuSRewm5RVFhix9fc1p1hlqiUQlgLiZq4=; b=zgbuV2I34MeBaY KyiJGzUFsTeEJuK0Tzu9GVFOjhpakqNXb9LCiHbehyVCiCOxZboxYAoYdTzA4nbuWoAOMXUmhrry0 lbZUKZzAebyQx/fqiZnjoXsoGgolZ47nfYyoOdblrl3g6MG50aeZg7lduzPUh1re4kTnZKzCMtcR+ ICs7//cwAKcLVc67B08jji/r16KPuhNPn/ue5/DwoVIx+OnLXdA4SP8o69EZUHxjXfuaCXfrn/Ti6 okleW8kSAe9tjfH1RKjA3SZkimLXYH8OzBrxcYaUalWqe/v/1AH3h29e2bcemgSNcmvrachW3861G Rq76cv0mb+ranMy2fLZg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qYWT3-00GfCu-1d; Tue, 22 Aug 2023 18:51:05 +0000 Received: from [2001:4d48:ad52:32c8:5054:ff:fe00:142] (helo=pandora.armlinux.org.uk) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qYWSj-00Gf3d-2s for linux-arm-kernel@lists.infradead.org; Tue, 22 Aug 2023 18:50:47 +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=KsLiqnb32ZcxjS1LxD1pBZYLglJtuaP+623PTyulk2g=; b=NqBejPsyt7HIdR/H0+xVVLINKR DyOmk65LmIM1I2NZv+htLfJLstz31Wgy9+cgjGntLfZ33UMRHD/u1WM/ns564rYTeU1/VQs2d+5T9 v0d3+UvZwSkkG5rVpTEryuOO9dHTI94Jy/zEEoVsPoi9A6GNpNjKIBmS7L8TeFd8jNhfhz1m826Ro 5W541McFfeTh4inZxoetQ84ZQE2URSGD1qwCVrN7jqyIR6M7g7HfBM7ytB7XBNDK4BOEFJYY5z3w6 eMuqoOg8Dn+bNrnLqDKQaevDTu1/jsKzG5k5/Oy0cMj9dyoxbgKei/dJqdhUkwwzaK1+SKp0bg/HD 1bjHUfmQ==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:50516 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 1qYWSd-0001sz-1C; Tue, 22 Aug 2023 19:50:39 +0100 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1qYWSd-005fYF-L9; Tue, 22 Aug 2023 19:50:39 +0100 In-Reply-To: References: From: "Russell King (Oracle)" To: Alexandre Torgue , Jose Abreu Cc: Andrew Lunn , "David S. Miller" , Eric Dumazet , Feiyang Chen , Heiner Kallweit , Jakub Kicinski , linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, Maxime Coquelin , netdev@vger.kernel.org, Paolo Abeni Subject: [PATCH net-next 8/9] net: stmmac: move xgmac specific phylink caps to dwxgmac2 core MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Tue, 22 Aug 2023 19:50:39 +0100 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230822_115045_933861_EFD83D19 X-CRM114-Status: GOOD ( 11.06 ) 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 Move the xgmac specific phylink capabilities to the dwxgmac2 support core. Signed-off-by: Russell King (Oracle) --- drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c | 10 ++++++++++ drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 10 ---------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c index 34e1b0c3f346..f352be269deb 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c @@ -47,6 +47,14 @@ static void dwxgmac2_core_init(struct mac_device_info *hw, writel(XGMAC_INT_DEFAULT_EN, ioaddr + XGMAC_INT_EN); } +static void xgmac_phylink_get_caps(struct stmmac_priv *priv) +{ + priv->phylink_config.mac_capabilities |= MAC_2500FD | MAC_5000FD | + MAC_10000FD | MAC_25000FD | + MAC_40000FD | MAC_50000FD | + MAC_100000FD; +} + static void dwxgmac2_set_mac(void __iomem *ioaddr, bool enable) { u32 tx = readl(ioaddr + XGMAC_TX_CONFIG); @@ -1490,6 +1498,7 @@ static void dwxgmac3_fpe_configure(void __iomem *ioaddr, u32 num_txq, const struct stmmac_ops dwxgmac210_ops = { .core_init = dwxgmac2_core_init, + .phylink_get_caps = xgmac_phylink_get_caps, .set_mac = dwxgmac2_set_mac, .rx_ipc = dwxgmac2_rx_ipc, .rx_queue_enable = dwxgmac2_rx_queue_enable, @@ -1551,6 +1560,7 @@ static void dwxlgmac2_rx_queue_enable(struct mac_device_info *hw, u8 mode, const struct stmmac_ops dwxlgmac2_ops = { .core_init = dwxgmac2_core_init, + .phylink_get_caps = xgmac_phylink_get_caps, .set_mac = dwxgmac2_set_mac, .rx_ipc = dwxgmac2_rx_ipc, .rx_queue_enable = dwxlgmac2_rx_queue_enable, diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 0b02845e7e9d..5cf8304564c6 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -1227,16 +1227,6 @@ static int stmmac_phy_setup(struct stmmac_priv *priv) /* Get the MAC specific capabilities */ stmmac_mac_phylink_get_caps(priv); - if (priv->plat->has_xgmac) { - priv->phylink_config.mac_capabilities |= MAC_2500FD; - priv->phylink_config.mac_capabilities |= MAC_5000FD; - priv->phylink_config.mac_capabilities |= MAC_10000FD; - priv->phylink_config.mac_capabilities |= MAC_25000FD; - priv->phylink_config.mac_capabilities |= MAC_40000FD; - priv->phylink_config.mac_capabilities |= MAC_50000FD; - priv->phylink_config.mac_capabilities |= MAC_100000FD; - } - /* Half-Duplex can only work with single queue */ if (priv->plat->tx_queues_to_use > 1) priv->phylink_config.mac_capabilities &= From patchwork Tue Aug 22 18:50:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 13361344 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 19B3BEE49AE for ; Tue, 22 Aug 2023 18:51:34 +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=kx18aZAjejQaZ4wrQmLygJx+EJBEYfDMq3Or3OvReFs=; b=bRx6HV9rxgRH9p aYHrpqnKOqCUM4xUB/R2b4YtvG7ecfbZqqMg/qBfHx7R2hHnbEJdkSc2IGQVnGiX1GdPlqXh9oMaO 8DeXUImnsOrnFxkQ5l3eS+hLQm7K52im9cykbshqfPRV6bJHEshApoKL96RFETIzB42jPKNYxxkDM wZ4RLlc9UsSDoQAXq0JmxtgZsJ+AubeNvjueiv8XyMtH1JPqiW4VcFm4h3fk9LBGXSsVBScY3vROW V9WTGERXhKLmGptJ41jaEoji7LDE20xTC31+EYVEn6r60bEz/bTlMtR25BgL9NbmMc9EEjT/1qmiV V1XS0TrCPbAkFR5i3Tpg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qYWT3-00GfDI-3B; Tue, 22 Aug 2023 18:51:05 +0000 Received: from [2001:4d48:ad52:32c8:5054:ff:fe00:142] (helo=pandora.armlinux.org.uk) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qYWSn-00Gf5v-2G for linux-arm-kernel@lists.infradead.org; Tue, 22 Aug 2023 18:50:51 +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=nphjihgOb/6ZWNEn5bdh2uvaeqrnXDrlYgYpyu/X48Y=; b=c5TqPRogkTgyX2mtAOV7dKA4QF 9Nb2U0HplGQv5Om2/s6XztHrEnoLHkisXNAAYcqvJSwUVVKVWLZ3uZnr/4x2ZFtjOun7WxLwca+G8 tk/G320BIPhvtmykEllqrmVi40NSyelVY4YI6K3wVc64J+OmRRnIXhY07y7ZUAOPs7XLxdnSpR+7j eVN6PwvuuRP/tWLG5jTEo8AX5frKWvaco1MXuqgBR8+yqnTf/2l7QOaIfa9E3SKyo09VTISvhWEHF TZ05UoqwPkC5JecI/FvT4yMGcAJrJDecV3KZp/9vFQuYiFpIJWDsg4lvNJJnHbVooNiDMFKdse6BH KTsuCW4g==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:50524 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 1qYWSi-0001tG-1j; Tue, 22 Aug 2023 19:50:44 +0100 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1qYWSi-005fYL-Q0; Tue, 22 Aug 2023 19:50:44 +0100 In-Reply-To: References: From: "Russell King (Oracle)" To: Alexandre Torgue , Jose Abreu Cc: Andrew Lunn , "David S. Miller" , Eric Dumazet , Feiyang Chen , Heiner Kallweit , Jakub Kicinski , linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, Maxime Coquelin , netdev@vger.kernel.org, Paolo Abeni Subject: [PATCH net-next 9/9] net: stmmac: move priv->phylink_config.mac_managed_pm MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Tue, 22 Aug 2023 19:50:44 +0100 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230822_115049_740129_514026EB 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 Move priv->phylink_config.mac_managed_pm to be along side the other phylink initialisations. Signed-off-by: Russell King (Oracle) --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 5cf8304564c6..7cfc2918c913 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -1207,6 +1207,7 @@ static int stmmac_phy_setup(struct stmmac_priv *priv) priv->phylink_config.dev = &priv->dev->dev; priv->phylink_config.type = PHYLINK_NETDEV; + priv->phylink_config.mac_managed_pm = true; mdio_bus_data = priv->plat->mdio_bus_data; if (mdio_bus_data) @@ -1231,7 +1232,6 @@ static int stmmac_phy_setup(struct stmmac_priv *priv) if (priv->plat->tx_queues_to_use > 1) priv->phylink_config.mac_capabilities &= ~(MAC_10HD | MAC_100HD | MAC_1000HD); - priv->phylink_config.mac_managed_pm = true; max_speed = priv->plat->max_speed; if (max_speed)