From mboxrd@z Thu Jan 1 00:00:00 1970 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 070A9C5478C for ; Mon, 4 Mar 2024 14:34:50 +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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=qpjGFv38r2FISRQ69X8f8s8I05DEVFZBE0uakptX8vE=; b=I9kIgfslja4R2d NdICvzovX7W0kENQhYZNR0+tBS64Wdojm+DCKDhodhDQLX+5iqBsnime5Lqn6CCMFhlZI07ZRXyj4 6yxRZgjfib/G41KIn2lfOUmE+Z883NmNJY23trqZhDrGHTGObxs1Zce8vqGUm04IuU1CGoUV1dwpV yYD8irP1OHqGY5+QQjd8an5S5kf9eUYwS6lJ/f8gf4HUDPbLwyfnHiHXNlK8fk7fAgE+a+Ht1XvIr FIw8DN6zCxUIdxHA/i93VD1AqjqxvD19KEzDrElFyuSjPMyqnFiQEFMwZ0FSc6aSpir83rsCjfsG3 2XQ0PGLfXZ9agmf+QkPw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rh9Ok-00000009OSm-29n3; Mon, 04 Mar 2024 14:34:34 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rh9Oh-00000009OSK-26SS for linux-arm-kernel@lists.infradead.org; Mon, 04 Mar 2024 14:34:32 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To: Content-Transfer-Encoding:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date: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=fYuXqjHSU4wWS8NC0tCBb8q7KcSGmYLkLI7d+Z6Xpls=; b=vO+Obnrv9UbTf4BIiOBNluFHwQ HzZDmnwV5Jx68lAk5kYKNUCXw6TrVub00LpaLuymAkqt1ybxMzAFRQVDJuEoG6DuhrANwE1rgMSM+ 6AnSNenf09xQKxhLAuUCxspi+SKwV7TRkOOi+i7hGJVs8RSHezOnrMuiUgx60pqZ4RsCE+WIwi2lt V8LuTQ3OGjkGMGua22xKF41j/ZGSUe82HW49qiqBLFeaB/pCBbk4bzsS7AN+EYMvUq1omTCJKvwbg niZOSzqqb73MjebA/FHeEE49+w/9RrOnVJRm1zfapQJkQ2WFvGseben159NC47a6J031Ovzy0D+6W 82S/Gk8w==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:46300) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1rh9OX-0005mA-0e; Mon, 04 Mar 2024 14:34:21 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1rh9OU-0004Yu-TA; Mon, 04 Mar 2024 14:34:18 +0000 Date: Mon, 4 Mar 2024 14:34:18 +0000 From: "Russell King (Oracle)" To: Romain Gantois Cc: Andrew Lunn , Heiner Kallweit , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Alexandre Torgue , Jose Abreu , Maxime Coquelin , =?iso-8859-1?Q?Cl=E9ment_L=E9ger?= , Maxime Chevallier , Miquel Raynal , Thomas Petazzoni , netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-renesas-soc@vger.kernel.org, Clark Wang Subject: Re: [PATCH net-next v5 5/7] net: stmmac: Signal to PHY/PCS drivers to keep RX clock on Message-ID: References: <20240301-rxc_bugfix-v5-0-8dac30230050@bootlin.com> <20240301-rxc_bugfix-v5-5-8dac30230050@bootlin.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20240301-rxc_bugfix-v5-5-8dac30230050@bootlin.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240304_063431_567194_7A71DDDA X-CRM114-Status: GOOD ( 19.76 ) 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: , Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Mar 01, 2024 at 04:35:02PM +0100, Romain Gantois wrote: > There is a reocurring issue with stmmac controllers where the MAC fails to > initialize its hardware if an RX clock signal isn't provided on the MAC/P= HY > link. > = > This causes issues when PHY or PCS devices either go into suspend while > cutting the RX clock or do not bring the clock signal up early enough for > the MAC to initialize successfully. > = > Set the mac_requires_rxc flag in the stmmac phylink config so that PHY/PCS > drivers know to keep the RX clock up at all times. > = > Reported-by: Clark Wang > Link: https://lore.kernel.org/all/20230202081559.3553637-1-xiaoning.wang@= nxp.com/ > Reported-by: Cl=E9ment L=E9ger > Link: https://lore.kernel.org/linux-arm-kernel/20230116103926.276869-4-cl= ement.leger@bootlin.com/ > Suggested-by: Russell King This should be: Co-developed-by: Russell King (Oracle) > Signed-off-by: Romain Gantois > --- > drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 7 +++++++ > 1 file changed, 7 insertions(+) > = > diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/= net/ethernet/stmicro/stmmac/stmmac_main.c > index 79844dbe4258..2290f4808d7e 100644 > --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c > +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c > @@ -1218,6 +1218,9 @@ static int stmmac_phy_setup(struct stmmac_priv *pri= v) > priv->phylink_config.type =3D PHYLINK_NETDEV; > priv->phylink_config.mac_managed_pm =3D true; > = > + /* Stmmac always requires an RX clock for hardware initialization */ > + priv->phylink_config.mac_requires_rxc =3D true; > + > mdio_bus_data =3D priv->plat->mdio_bus_data; > if (mdio_bus_data) > priv->phylink_config.ovr_an_inband =3D > @@ -3408,6 +3411,10 @@ static int stmmac_hw_setup(struct net_device *dev,= bool ptp_register) > u32 chan; > int ret; > = > + /* Make sure RX clock is enabled */ > + if (priv->hw->phylink_pcs) > + phylink_pcs_pre_init(priv->phylink, priv->hw->phylink_pcs); > + > /* DMA initialization and SW reset */ > ret =3D stmmac_init_dma_engine(priv); > if (ret < 0) { > = > -- = > 2.43.2 > = > = -- = RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last! _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel