From patchwork Wed May 29 13:29:19 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: 13678834 X-Patchwork-Delegate: kuba@kernel.org Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [78.32.30.218]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 08C9911CAB for ; Wed, 29 May 2024 13:29:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=78.32.30.218 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716989369; cv=none; b=bTByLfxpmw8jvxOTiW6OupKZcoifDAwL7vP6v2HNIQZLYZ/Qq2+aTJ6eT470v0gMiOh6L00CjH8H2O26sCG6MjXPaLLstzbEV4g+MwehJhXPcjZshxo6MnceTsHPLrNNRpGqrbXom9dLoWKwJzG4tHqi7WdomjaAHBUvmmdV5dg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716989369; c=relaxed/simple; bh=0cC26AS9RA8hgkXnPY6c1Jk6MvSh7crAichKJm3IVqU=; h=In-Reply-To:References:From:To:Cc:Subject:MIME-Version: Content-Disposition:Content-Type:Message-Id:Date; b=SDZvu2buLaT9CAybPtZ6nG1iegAjw1jrohbzIH723niPNadQheIrfZLl/5bRiNldFeV82mnyUUKpn7yMfN1ET8BrZgSoLpv0k1uPfASIxN3olCr+O/80hQTMZj8rNcGoNswfMS0HnFiHgBhs6O+XjD5pqUPXUfmAHauAQFYTlM8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk; spf=none smtp.mailfrom=armlinux.org.uk; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b=z2/azBst; arc=none smtp.client-ip=78.32.30.218 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="z2/azBst" 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=vn0jH6CU7KHQ/wpW+WUjXbY6CCLADkErWHq5wcQ5KPY=; b=z2/azBstyNEE8fNK9RO/j3URxN /HMqBM8QpLyXTMJbSNeb8o8BQHN0jiih+1BHVS2uc/ULIL/jlUM3h45zbaq3yN6Vo0eYg7pbbcG2o qg0ELOzgeZ7f1MC1jZ/lo2xMhb3stSMTCMxsRElBTyqFQO2MQg7PCuLjOJhMdfPXCuA6c/CSOwQYm y4Il0ybXHByyM3RoIZ5e6O4PNnJTo5nkoM23OQLs4Uc8ueIBA5Ovc3PT+6wgSBCLjQurjoTMKaw8F +ASv9Ok3s6WAog/ESr1UjOjvUmmDYgRaM+5NrYFN+xFeltKi0UYYEt8B+A3yTXxZ0SSjo07ZBB7GX UHvi0hVQ==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:33424 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 1sCJMi-00069t-39; Wed, 29 May 2024 14:29:17 +0100 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1sCJMl-00Ecqp-K0; Wed, 29 May 2024 14:29:19 +0100 In-Reply-To: References: From: "Russell King (Oracle)" To: Andrew Lunn , Heiner Kallweit Cc: Andrew Halaney , Serge Semin , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Subject: [PATCH net-next 1/6] net: phylink: rearrange phylink_parse_mode() Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline Message-Id: Sender: Russell King Date: Wed, 29 May 2024 14:29:19 +0100 X-Patchwork-Delegate: kuba@kernel.org Of the two users of phylink_config->ovr_an_inband, both manually check for a fixed link before setting this flag (or clearing it if they find a fixed link.) This is unnecessary complication. Rearrange phylink_parse_mode() a little so we can change how phylink_config->ovr_an_inband works. This will allow the flag to be tested before checking for the fixed link properties in the next patch. Signed-off-by: Russell King (Oracle) --- drivers/net/phy/phylink.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c index 994471fad833..5abd12713598 100644 --- a/drivers/net/phy/phylink.c +++ b/drivers/net/phy/phylink.c @@ -899,12 +899,15 @@ static int phylink_parse_mode(struct phylink *pl, return -EINVAL; } + pl->cfg_link_an_mode = MLO_AN_INBAND; + } + + if (pl->cfg_link_an_mode == MLO_AN_INBAND) { linkmode_zero(pl->supported); phylink_set(pl->supported, MII); phylink_set(pl->supported, Autoneg); phylink_set(pl->supported, Asym_Pause); phylink_set(pl->supported, Pause); - pl->cfg_link_an_mode = MLO_AN_INBAND; switch (pl->link_config.interface) { case PHY_INTERFACE_MODE_SGMII: From patchwork Wed May 29 13:29:24 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: 13678835 X-Patchwork-Delegate: kuba@kernel.org Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [78.32.30.218]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4D64D12E7E for ; Wed, 29 May 2024 13:29:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=78.32.30.218 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716989373; cv=none; b=U5/kYSTOTIFqCuMTrsuy7vXpSS4X9tgwgKBlNqjzZo8JQf4KyTbbaW98UQjUtXUieDQuXDw5t9VJa26GqoUwhkikRAbSiMS7LGPPGPcd/j/scW0SMYK7MKHK8x7Lp8zga/+0IoshAg4TL5c3htZCCEINi7+FTyVVzyXkTjFNl5Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716989373; c=relaxed/simple; bh=e4Rve+86ThEL12SV4fP+Xz2rtCXS1IP63nfZ4j4Bq34=; h=In-Reply-To:References:From:To:Cc:Subject:MIME-Version: Content-Disposition:Content-Type:Message-Id:Date; b=ZWOKweWjSFGnjxCKXhKEqS7VrfSqgglYAFJyhdkaIQf5B/WatVD/u+dTpn13PjOcgovRjD/yy89AoucAiv5psgIyXPa9nA9+1msh6yb98cs0MlEdXGyZZnks3sHWc/B/dIP8EZqvAEsHbksyl14nVsCDdlyBbGVDiEooyyHLfY0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk; spf=none smtp.mailfrom=armlinux.org.uk; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b=n5UU+q/0; arc=none smtp.client-ip=78.32.30.218 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="n5UU+q/0" 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=0nQ7u6L97LCdFFVUjGvL2ohDdGy+s5i+RiEbfyEYVuk=; b=n5UU+q/0e8ySAW6l5/F5Zj5mVJ XyXq58iuNvCcWD2eaSYtRTHIdsvUs8m3f9aTBBzGM14CyAvxkGRlVH9B3bJRm83ueIqokrJvOHNgp OlXgFaVsiSKSmal2zOJvSjHdyU+mctxAKzDhIwcH5UH3GPgpjO0HAuN6eGdrlDmOs0dB7ueVUj3c3 oGjwJ8OvIRyk6o/xM0RsoGgt3YnHL9o9ZXqBWKBfk9awdvaiArTgO/OvkWpFXu0TXQdqvighX5Zdw HfGkD7h0xl9VjKAnlmi+ad7odx5R5CRrIxsyxFo50OpM1aJnmkuwhYfRK2GV2vA1kQFG8fTGrjWNY TIG5rm8Q==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:55560 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 1sCJMo-0006A4-07; Wed, 29 May 2024 14:29:22 +0100 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1sCJMq-00Ecqv-P8; Wed, 29 May 2024 14:29:24 +0100 In-Reply-To: References: From: "Russell King (Oracle)" To: Andrew Lunn , Heiner Kallweit Cc: Andrew Halaney , Serge Semin , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Subject: [PATCH net-next 2/6] net: phylink: move test for ovr_an_inband Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline Message-Id: Sender: Russell King Date: Wed, 29 May 2024 14:29:24 +0100 X-Patchwork-Delegate: kuba@kernel.org Of the two users of phylink_config->ovr_an_inband, both manually check for a fixed link before setting this flag (or clearing it if they find a fixed link.) This is unnecessary complication. Test ovr_an_inband before checking for the fixed-link properties, which will allow ovr_an_inband to be overriden by a fixed link specification. Signed-off-by: Russell King (Oracle) --- drivers/net/phy/phylink.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c index 5abd12713598..c81f1c1ee675 100644 --- a/drivers/net/phy/phylink.c +++ b/drivers/net/phy/phylink.c @@ -885,14 +885,16 @@ static int phylink_parse_mode(struct phylink *pl, const char *managed; unsigned long caps; + if (pl->config->ovr_an_inband) + pl->cfg_link_an_mode = MLO_AN_INBAND; + dn = fwnode_get_named_child_node(fwnode, "fixed-link"); if (dn || fwnode_property_present(fwnode, "fixed-link")) pl->cfg_link_an_mode = MLO_AN_FIXED; fwnode_handle_put(dn); if ((fwnode_property_read_string(fwnode, "managed", &managed) == 0 && - strcmp(managed, "in-band-status") == 0) || - pl->config->ovr_an_inband) { + strcmp(managed, "in-band-status") == 0)) { if (pl->cfg_link_an_mode == MLO_AN_FIXED) { phylink_err(pl, "can't use both fixed-link and in-band-status\n"); From patchwork Wed May 29 13:29:29 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: 13678836 X-Patchwork-Delegate: kuba@kernel.org Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [78.32.30.218]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EE29D125C0 for ; Wed, 29 May 2024 13:29:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=78.32.30.218 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716989382; cv=none; b=An+TLcHzmsorzj8wIejHvTjv6BTELYMQbHaeg0WjQDyzDAKdgXDbsKZNxcTsp4u42IWrr5ryCRiwLAKrfnfZygWt/qegzd1B20cRs96gVGc3hnL2SO52f5qyuWk7521Yw15X5LjUAvOh9GtHSw76OJxiVpFI4z0oZAhb1YgBXC0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716989382; c=relaxed/simple; bh=WCMONIdKv7KWN1EtKFXwV6i/CeajaW9MLK67GioNCcw=; h=In-Reply-To:References:From:To:Cc:Subject:MIME-Version: Content-Disposition:Content-Type:Message-Id:Date; b=FTMcGNW0tQU1ztv5IEuSlYMx/tGezwvEHnNRtu0zq+ugWM/Zb29L9eC1hkRQQRz03QjuLEkuouTy0uVHrdqzECzdGpaCR0SFUtj8SL+R7AIowF5csamycA8ycEuqUwtLqQh3GVAe8SECfEn8d7XA6mIYPBWi76xqRK/QJglDmzI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk; spf=none smtp.mailfrom=armlinux.org.uk; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b=UNNy/UmC; arc=none smtp.client-ip=78.32.30.218 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="UNNy/UmC" 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=l0pFAlm4Nwz8WL1ywZPHC0jQLmXTQV0ET0gfIHEZ+0M=; b=UNNy/UmCiV3jL3duQZXmB3Lwtk 172fmHguXii0dlSnIazA/S8nu/DIQs6qHUNPPfa7RgjXBuV4T8rughjAtnI1+pkwdnyLkxIS+Dw3/ N0HOT5jXG2xGdPFfiF3xsVaNa9nV86OVqsaFFLdS8J10mYzeY13nGnfG6XjjPYKhCNlEHJsVFpUcQ T2hltlosRe9YEk6kFSiW0MqqMKT28yLU+A1gSvkLST+O88h5yx/eC93wgxshTWrhCYmG1ILvmuG79 iBP+kw/6R9jyUG19wJLP41rlw7HtCTMrwEF4RsRClUZOsBn1ZgZNK4tdvRxPT6FWr9ygREKX2h3+g ++yuaQ6w==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:42256 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 1sCJMt-0006AI-0n; Wed, 29 May 2024 14:29:27 +0100 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1sCJMv-00Ecr1-Sk; Wed, 29 May 2024 14:29:29 +0100 In-Reply-To: References: From: "Russell King (Oracle)" To: Andrew Lunn , Heiner Kallweit Cc: Andrew Halaney , Serge Semin , Madalin Bucur , Sean Anderson , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Alexandre Torgue , Jose Abreu , Maxime Coquelin , netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org Subject: [PATCH net-next 3/6] net: phylink: rename ovr_an_inband to default_an_inband Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline Message-Id: Sender: Russell King Date: Wed, 29 May 2024 14:29:29 +0100 X-Patchwork-Delegate: kuba@kernel.org Since ovr_an_inband no longer overrides every MLO_AN_xxx mode, rename it to reflect what it now does - it changes the default mode from MLO_AN_PHY to MLO_AN_INBAND. Fix up the two users of this. Signed-off-by: Russell King (Oracle) --- drivers/net/ethernet/freescale/fman/fman_memac.c | 2 +- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 +- drivers/net/phy/phylink.c | 2 +- include/linux/phylink.h | 5 +++-- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/freescale/fman/fman_memac.c b/drivers/net/ethernet/freescale/fman/fman_memac.c index 92b8f4ab26f1..9c44a3581950 100644 --- a/drivers/net/ethernet/freescale/fman/fman_memac.c +++ b/drivers/net/ethernet/freescale/fman/fman_memac.c @@ -1232,7 +1232,7 @@ int memac_initialization(struct mac_device *mac_dev, !of_property_read_bool(mac_node, "managed") && mac_dev->phy_if != PHY_INTERFACE_MODE_MII && !phy_interface_mode_is_rgmii(mac_dev->phy_if)) - mac_dev->phylink_config.ovr_an_inband = true; + mac_dev->phylink_config.default_an_inband = true; of_node_put(fixed); err = memac_init(mac_dev->fman_mac); diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index ca19b232431a..488b2fd2349c 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -1221,7 +1221,7 @@ static int stmmac_phy_setup(struct stmmac_priv *priv) mdio_bus_data = priv->plat->mdio_bus_data; if (mdio_bus_data) - priv->phylink_config.ovr_an_inband = + priv->phylink_config.default_an_inband = mdio_bus_data->xpcs_an_inband; /* Set the platform/firmware specified interface mode. Note, phylink diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c index c81f1c1ee675..02427378acfd 100644 --- a/drivers/net/phy/phylink.c +++ b/drivers/net/phy/phylink.c @@ -885,7 +885,7 @@ static int phylink_parse_mode(struct phylink *pl, const char *managed; unsigned long caps; - if (pl->config->ovr_an_inband) + if (pl->config->default_an_inband) pl->cfg_link_an_mode = MLO_AN_INBAND; dn = fwnode_get_named_child_node(fwnode, "fixed-link"); diff --git a/include/linux/phylink.h b/include/linux/phylink.h index 5ea6b2ad2396..a30a692acc32 100644 --- a/include/linux/phylink.h +++ b/include/linux/phylink.h @@ -141,7 +141,8 @@ enum phylink_op_type { * @mac_requires_rxc: if true, the MAC always requires a receive clock from PHY. * The PHY driver should start the clock signal as soon as * possible and avoid stopping it during suspend events. - * @ovr_an_inband: if true, override PCS to MLO_AN_INBAND + * @default_an_inband: if true, defaults to MLO_AN_INBAND rather than + * MLO_AN_PHY. A fixed-link specification will override. * @get_fixed_state: callback to execute to determine the fixed link state, * if MAC link is at %MLO_AN_FIXED mode. * @supported_interfaces: bitmap describing which PHY_INTERFACE_MODE_xxx @@ -154,7 +155,7 @@ struct phylink_config { bool poll_fixed_state; bool mac_managed_pm; bool mac_requires_rxc; - bool ovr_an_inband; + bool default_an_inband; void (*get_fixed_state)(struct phylink_config *config, struct phylink_link_state *state); DECLARE_PHY_INTERFACE_MASK(supported_interfaces); From patchwork Wed May 29 13:29:35 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: 13678837 X-Patchwork-Delegate: kuba@kernel.org Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [78.32.30.218]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4A6EA13ADA for ; Wed, 29 May 2024 13:29:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=78.32.30.218 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716989387; cv=none; b=D6qkGsvaMWb4GvSwkRJunhUAvPBkjApJfLq2bp0eDMXiHXOJRcFvDE/ZAUHO14Hf5gEfnYgT4S6nmL8yiwUGdXF2a1vNCaSe/CCeLYpE9VmhIZ2FTIMs7hGmOxIwWRZvndvYh3Mf2l/w0dkAd3IJ6ZUN7Ww6AGqj+RMym/eAmPA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716989387; c=relaxed/simple; bh=AGrumtKSDenFURQ8AmhTQxtcuUtiNLINOq77ZEFVlGA=; h=In-Reply-To:References:From:To:Cc:Subject:MIME-Version: Content-Disposition:Content-Type:Message-Id:Date; b=A5E0DvXK9NRiAJ2E2cSbYENXpED4HfTjns0ZEPCSu2tiBtuhDIfdTC+536zWbXlf8rTmLhibEY53+sYhzN7XoifZtPHbSJnzmf7d0LXVCQuQ4TkGVwmOss6QqAuyJwN/mA/pOCuswoXToJaG3z2Uk+1EhZS1djmwRPoF8j9Uv6M= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk; spf=none smtp.mailfrom=armlinux.org.uk; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b=sgvnac0I; arc=none smtp.client-ip=78.32.30.218 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="sgvnac0I" 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=I/Ap/ljJSxlOSU1gMqQyV0kXXftaGCsI7K45AcpMgJk=; b=sgvnac0IUz2BinfrHimnNfZlye 9ADmwbt5vq/8EyUBjoWMX/rGW/Vp1huu7CYS6c2OCv5cEIYZ6UwG3KaeicGHg/hSVsqK0cIXM5YM7 sbiLOFdftORABxWOPTtI9Z3WDlzTO0mpD8GjOk1g+bRkCb+rP93Swyhr2Amvt7t8M6zEGtMRC6ZLf Bah/KRNb97ts49xp8A2Z4QeiVE96/R7A6OvaZQb/EAGJrCSPK43L/SW3QhrYXZXJkOy1wxePaXPyH bZ0A9S//afJQ9ONzDduuJEvjPbZvPf2V+jTzM7A1uSrzEDY0Vp6hBQw8tELq4i6WIkencHPE07o9z 4hhnF7Bw==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:42270 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 1sCJMy-0006AV-1M; Wed, 29 May 2024 14:29:32 +0100 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1sCJN1-00Ecr7-02; Wed, 29 May 2024 14:29:35 +0100 In-Reply-To: References: From: "Russell King (Oracle)" To: Andrew Lunn , Heiner Kallweit Cc: Andrew Halaney , Serge Semin , Madalin Bucur , Sean Anderson , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Subject: [PATCH net-next 4/6] net: fman_memac: remove the now unnecessary checking for fixed-link Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline Message-Id: Sender: Russell King Date: Wed, 29 May 2024 14:29:35 +0100 X-Patchwork-Delegate: kuba@kernel.org Since default_an_inband can be overriden by a fixed-link specification, there is no need for memac to be checking for this before setting default_an_inband. Remove this code and update the comment. Signed-off-by: Russell King (Oracle) Reviewed-by: Sean Anderson --- drivers/net/ethernet/freescale/fman/fman_memac.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/drivers/net/ethernet/freescale/fman/fman_memac.c b/drivers/net/ethernet/freescale/fman/fman_memac.c index 9c44a3581950..796e6f4e583d 100644 --- a/drivers/net/ethernet/freescale/fman/fman_memac.c +++ b/drivers/net/ethernet/freescale/fman/fman_memac.c @@ -1066,7 +1066,6 @@ int memac_initialization(struct mac_device *mac_dev, struct fman_mac_params *params) { int err; - struct device_node *fixed; struct phylink_pcs *pcs; struct fman_mac *memac; unsigned long capabilities; @@ -1222,18 +1221,15 @@ int memac_initialization(struct mac_device *mac_dev, memac->rgmii_no_half_duplex = true; /* Most boards should use MLO_AN_INBAND, but existing boards don't have - * a managed property. Default to MLO_AN_INBAND if nothing else is - * specified. We need to be careful and not enable this if we have a - * fixed link or if we are using MII or RGMII, since those - * configurations modes don't use in-band autonegotiation. + * a managed property. Default to MLO_AN_INBAND rather than MLO_AN_PHY. + * Phylink will allow this to be overriden by a fixed link. We need to + * be careful and not enable this if we are using MII or RGMII, since + * those configurations modes don't use in-band autonegotiation. */ - fixed = of_get_child_by_name(mac_node, "fixed-link"); - if (!fixed && !of_property_read_bool(mac_node, "fixed-link") && - !of_property_read_bool(mac_node, "managed") && + if (!of_property_read_bool(mac_node, "managed") && mac_dev->phy_if != PHY_INTERFACE_MODE_MII && !phy_interface_mode_is_rgmii(mac_dev->phy_if)) mac_dev->phylink_config.default_an_inband = true; - of_node_put(fixed); err = memac_init(mac_dev->fman_mac); if (err < 0) From patchwork Wed May 29 13:29:40 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: 13678838 X-Patchwork-Delegate: kuba@kernel.org Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [78.32.30.218]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A9F2D1643A for ; Wed, 29 May 2024 13:29:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=78.32.30.218 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716989391; cv=none; b=uCsIrqf1CueZ/74JzOzW1MaYG6rsOro+uZxgVF+y7104jT8KqUpfplTUp/tkblh+EYnNxdoAU4Z/zcT+cJnV5OQdXPXZJ/9hrFvrIckOsj4GlewDEEGFuI7DLdmVReS6FAbqE1y5CK19TYLAzDYE3DIqw0iBuqP/Unhpln1q8GQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716989391; c=relaxed/simple; bh=FT5CxuChzJtt06dJ/XX1M4n1Iq2flU5JHB42HrqXqM4=; h=In-Reply-To:References:From:To:Cc:Subject:MIME-Version: Content-Disposition:Content-Type:Message-Id:Date; b=kHk25d9QwW89L7Di3zvTaO+CzF4zRScUYGYacq8mwokxyuTzU6dOpeoLo/C0+PBw2IE8G7++EmVUrccRi/acKbzNtmdZc91VlIqFax3lpz8s9R4y4gPoB1Pnb5vfYJdgn1L6wxRJ+MNaV7HfYPFPcBRp6UTZrAECwfv2r9Pw8EQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk; spf=none smtp.mailfrom=armlinux.org.uk; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b=mDTJgtoK; arc=none smtp.client-ip=78.32.30.218 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="mDTJgtoK" 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=BYvO95PpEcMgA0q270dluXDRCbFClCEyBXdlLNYYlFI=; b=mDTJgtoKsm6r/eWRMv1Rnumsm/ KZs0wqYzrpBzm30CFWHTdUQFlUp0xg8GhDXKHFu8h/U/noXD/jcfJB/zXcXPTJVSeFQfSS9zEEYUm cmmtk8syO2XxnrPXnw2cIlOQuT+QykirkGNKDg/LsrMqs8VZyDDBeXiukQIdu4UCD9R/91hjfY0jF qhT2oRxoMLcoz3CDqb/DhlRis2Q0pWBIPzUG3gAEbwtkey3kqE6i7nT35SoL/qnwe2WDp7nOEK/R5 xkVxbxy3z75NjsUM6qhigatMlba9OyxDWBhzAJ+tfF5GHBs9KeNE3Qo+NPuq3TG+CmeRTaytaV3dZ D6Sil+5g==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:44826 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 1sCJN3-0006Ak-1x; Wed, 29 May 2024 14:29:37 +0100 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1sCJN6-00EcrD-43; Wed, 29 May 2024 14:29:40 +0100 In-Reply-To: References: From: "Russell King (Oracle)" To: Andrew Lunn , Heiner Kallweit Cc: Andrew Halaney , Serge Semin , Alexandre Torgue , Jose Abreu , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org Subject: [PATCH net-next 5/6] net: stmmac: rename xpcs_an_inband to default_an_inband Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline Message-Id: Sender: Russell King Date: Wed, 29 May 2024 14:29:40 +0100 X-Patchwork-Delegate: kuba@kernel.org Rename xpcs_an_inband to default_an_inband to reflect the change in phylink and its changed functionality. Signed-off-by: Russell King (Oracle) --- drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c | 8 ++++---- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 +- include/linux/stmmac.h | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c index 60283543ffc8..5e96146b8bd9 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c @@ -248,7 +248,7 @@ static void intel_speed_mode_2500(struct net_device *ndev, void *intel_data) dev_info(priv->device, "Link Speed Mode: 2.5Gbps\n"); priv->plat->max_speed = 2500; priv->plat->phy_interface = PHY_INTERFACE_MODE_2500BASEX; - priv->plat->mdio_bus_data->xpcs_an_inband = false; + priv->plat->mdio_bus_data->default_an_inband = false; } else { priv->plat->max_speed = 1000; } @@ -586,16 +586,16 @@ static int intel_mgbe_common_data(struct pci_dev *pdev, if (plat->phy_interface == PHY_INTERFACE_MODE_SGMII || plat->phy_interface == PHY_INTERFACE_MODE_1000BASEX) { plat->mdio_bus_data->has_xpcs = true; - plat->mdio_bus_data->xpcs_an_inband = true; + plat->mdio_bus_data->default_an_inband = true; } - /* For fixed-link setup, we clear xpcs_an_inband */ + /* For fixed-link setup, we clear default_an_inband */ if (fwnode) { struct fwnode_handle *fixed_node; fixed_node = fwnode_get_named_child_node(fwnode, "fixed-link"); if (fixed_node) - plat->mdio_bus_data->xpcs_an_inband = false; + plat->mdio_bus_data->default_an_inband = false; fwnode_handle_put(fixed_node); } diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 488b2fd2349c..bbedf2a8c60f 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -1222,7 +1222,7 @@ static int stmmac_phy_setup(struct stmmac_priv *priv) mdio_bus_data = priv->plat->mdio_bus_data; if (mdio_bus_data) priv->phylink_config.default_an_inband = - mdio_bus_data->xpcs_an_inband; + mdio_bus_data->default_an_inband; /* Set the platform/firmware specified interface mode. Note, phylink * deals with the PHY interface mode, not the MAC interface mode. diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h index f92c195c76ed..8f0f156d50d3 100644 --- a/include/linux/stmmac.h +++ b/include/linux/stmmac.h @@ -83,7 +83,7 @@ struct stmmac_priv; struct stmmac_mdio_bus_data { unsigned int phy_mask; unsigned int has_xpcs; - unsigned int xpcs_an_inband; + unsigned int default_an_inband; int *irqs; int probed_phy_irq; bool needs_reset; From patchwork Wed May 29 13:29:45 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: 13678839 X-Patchwork-Delegate: kuba@kernel.org Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [78.32.30.218]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 98B23C2ED for ; Wed, 29 May 2024 13:29:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=78.32.30.218 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716989398; cv=none; b=DjpDBOb8S91gnWvLZyS0FVzGvG2GBwUY83T+4Znh/fjHyIIW6UK2ls+PhnQ56e7nprhVfp7SA5oPzsPVNGZ2so5ESp5Olp2PP+GQcQmQmy0PLxc2Yjry9IxG3N8yxilghUX8sg14YPjOydaA/qmukuD7GVilRl5EYXiF377Xsu4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716989398; c=relaxed/simple; bh=CHXeVcOxd0UzaY8yj8lIT+XgwRUaoEwyxjgK+6SPRrI=; h=In-Reply-To:References:From:To:Cc:Subject:MIME-Version: Content-Disposition:Content-Type:Message-Id:Date; b=i6vs5qFEUOBZq0ZRorOQcmPtswXAq4tGgksHmsROcQ2HhqSq2uCsMRBbjiRTxFJRELsQxa6kLgIbMCLP0cJX68QIO4uRJP0tjLR8xk6TlJDroMy8HwgU/Ph4u4bjfyHOWC0Zu8MAcEz+MdmKBmLSrNW1wEX5hEoVMLIKGtrQJ7s= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk; spf=none smtp.mailfrom=armlinux.org.uk; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b=ogYkuNg2; arc=none smtp.client-ip=78.32.30.218 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="ogYkuNg2" 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=jrnjzB7F3wcMn320kdy6SKYULM0j5Eqx/IjuBbSJc84=; b=ogYkuNg2+g9hKjYtcmQKKp04S6 sAtKeuWv++oaMXKeKURi9geL9JBaLw52BoAs6YJIeD1r1+bkgchYCwsz1Zj2iYMWePBhbt131BIZN Y16+kbLwQ60AHOaaqi/IzM+80aw6eWGjFgFxwSZnIbUlAx1TNrYUfBm3fZXmCLF1XJPaAM+5HjXio k1lfyrqThJOtc6cipODgtNThHZeGQubcLSy3KQ8KXej4x1culHBRlLCl0cgFK1PY5gcIvlcTa6Pp8 Mrb6dQs2sjhDTSSmnkfvGtDjU4OgrzXVtLzcBcTXIdyvyYI3firRPwrPTZZhFiAo7B+IqU/moRK5E ARpa+KIg==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:44828 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 1sCJN8-0006B4-23; Wed, 29 May 2024 14:29:42 +0100 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1sCJNB-00EcrJ-7L; Wed, 29 May 2024 14:29:45 +0100 In-Reply-To: References: From: "Russell King (Oracle)" To: Andrew Lunn , Heiner Kallweit Cc: Andrew Halaney , Serge Semin , Alexandre Torgue , Jose Abreu , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org Subject: [PATCH net-next 6/6] net: stmmac: dwmac-intel: remove checking for fixed link Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline Message-Id: Sender: Russell King Date: Wed, 29 May 2024 14:29:45 +0100 X-Patchwork-Delegate: kuba@kernel.org With the new default_an_inband functionality in phylink, there is no need to check for a fixed link when this flag is set, since a fixed link will now override default_an_inband. Signed-off-by: Russell King (Oracle) --- drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c index 5e96146b8bd9..56649edb18cd 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c @@ -589,17 +589,6 @@ static int intel_mgbe_common_data(struct pci_dev *pdev, plat->mdio_bus_data->default_an_inband = true; } - /* For fixed-link setup, we clear default_an_inband */ - if (fwnode) { - struct fwnode_handle *fixed_node; - - fixed_node = fwnode_get_named_child_node(fwnode, "fixed-link"); - if (fixed_node) - plat->mdio_bus_data->default_an_inband = false; - - fwnode_handle_put(fixed_node); - } - /* Ensure mdio bus scan skips intel serdes and pcs-xpcs */ plat->mdio_bus_data->phy_mask = 1 << INTEL_MGBE_ADHOC_ADDR; plat->mdio_bus_data->phy_mask |= 1 << INTEL_MGBE_XPCS_ADDR;