Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp488583pxf; Thu, 18 Mar 2021 05:38:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx29yvLWcYrKYpboPwefrrEjYIdl64yxcpQgtPdp/fuzl7ISiisGipOkSCHYMJbxyvUXR7z X-Received: by 2002:aa7:d347:: with SMTP id m7mr3317061edr.260.1616071106239; Thu, 18 Mar 2021 05:38:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616071106; cv=none; d=google.com; s=arc-20160816; b=LV/eiGqlJpUzTq9Ctwwt3nV+04Jtd6elqmyX6tPel1m3eDAtWUVL2XaJzEPQDw7+Rh 7hVYXZej60ok7wlk95+hAZVOM6EUPqnaDOV/yik4OL+jeyahyxAPuATjC5YfBx1Rq3Yt CQlfSZtGItCvNHOm3T4ZHhr1uO82U/wgcU2E+SN8A3HnajXZYSmpVpUos5Ibeg3t/xkc lR2GKjloqtO/PtDam+wmL747JAEAjPt0zzAObg67CEHEMWGpDBL8L9VorFR/f+fuAG1S caqQGVwco7/TCKz5dfDFOe+EY6LCNN/9foMsjX2Lkpsj75/fnFRxwAVbJ3yC+gUA57Gi 9qrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=fY/mEmN6ZQU1jj860rorye6aqbwZ+YN6DcXclugsa3U=; b=gc/YVBp64AYPEdnAMYtNIBUnwxmMX90Z74+id0ypNZdN28Aykqc7flyvN4xM/f/qYc Be0EwwMyq3yOzedpv4qzUyyT88qQXj05Ch3iN+0rZ6TNzkhHIZAW7CopfjIJU7Yv0WWB Ni4tLSJkJvhxLjEAA6wIUOdjj0dIFz3m0cd3vZPftD0wkWjuJDT2T6zJXSsHozuUHttT 5GfXSf6ZxjAYkjY5zcngMobLYu2dscf7MOmOQgoMlCIHMiYVFZcMEMKGYHn1VxspRuyc NU//TgRiQdlFXundsuzTrvY+/6FnS8NOqgdYkHI9uuehVfs3tBv4LqDsmGe0hugPqfIe VRjw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dt8si1581827ejc.111.2021.03.18.05.38.03; Thu, 18 Mar 2021 05:38:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230169AbhCRMfD (ORCPT + 99 others); Thu, 18 Mar 2021 08:35:03 -0400 Received: from jabberwock.ucw.cz ([46.255.230.98]:52158 "EHLO jabberwock.ucw.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229508AbhCRMei (ORCPT ); Thu, 18 Mar 2021 08:34:38 -0400 Received: by jabberwock.ucw.cz (Postfix, from userid 1017) id 32A641C0B7D; Thu, 18 Mar 2021 13:34:36 +0100 (CET) Date: Thu, 18 Mar 2021 13:34:35 +0100 From: Pavel Machek To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, Florian Fainelli , Andrew Lunn , Russell King , Vladimir Oltean , "David S. Miller" Subject: Re: [PATCH 5.10 041/290] net: enetc: force the RGMII speed and duplex instead of operating in inband mode Message-ID: <20210318123435.GA8812@duo.ucw.cz> References: <20210315135541.921894249@linuxfoundation.org> <20210315135543.317947345@linuxfoundation.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="UlVJffcvxoiEqYs2" Content-Disposition: inline In-Reply-To: <20210315135543.317947345@linuxfoundation.org> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --UlVJffcvxoiEqYs2 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! > It has been reported that RGMII is broken in fixed-link, and that is not > surprising considering the fact that no PHY is attached to the MAC in > that case, but a switch. Okay, but there's something wrong in the code. > This brings us to the topic of the patch: the enetc driver should have > not enabled the optional in-band status signaling for RGMII unconditional= ly, > but should have forced the speed and duplex to what was resolved by > phylink. > +++ b/drivers/net/ethernet/freescale/enetc/enetc_pf.c > @@ -494,13 +494,20 @@ static void enetc_configure_port_mac(str > =20 > static void enetc_mac_config(struct enetc_hw *hw, phy_interface_t phy_mo= de) > { =2E.. > + u32 val; > + > + if (phy_interface_mode_is_rgmii(phy_mode)) { > + val =3D enetc_port_rd(hw, ENETC_PM0_IF_MODE); > + val &=3D ~ENETC_PM0_IFM_EN_AUTO; > + val &=3D ENETC_PM0_IFM_IFMODE_MASK; > + val |=3D ENETC_PM0_IFM_IFMODE_GMII | ENETC_PM0_IFM_RG; > + enetc_port_wr(hw, ENETC_PM0_IF_MODE, val); > + } val clears ENETC_PM0_IFM_EN_AUTO bit, then the bit is cleared again, preserving just IFMODE bits, then ors the IFMODE bits with new values. I believe this is needed: Signed-off-by: Pavel Machek (CIP) Pavel diff --git a/drivers/net/ethernet/freescale/enetc/enetc_pf.c b/drivers/net/= ethernet/freescale/enetc/enetc_pf.c index 83187cd59fdd..446ad4c43fab 100644 --- a/drivers/net/ethernet/freescale/enetc/enetc_pf.c +++ b/drivers/net/ethernet/freescale/enetc/enetc_pf.c @@ -499,7 +499,7 @@ static void enetc_mac_config(struct enetc_hw *hw, phy_i= nterface_t phy_mode) if (phy_interface_mode_is_rgmii(phy_mode)) { val =3D enetc_port_rd(hw, ENETC_PM0_IF_MODE); val &=3D ~ENETC_PM0_IFM_EN_AUTO; - val &=3D ENETC_PM0_IFM_IFMODE_MASK; + val &=3D ~ENETC_PM0_IFM_IFMODE_MASK; val |=3D ENETC_PM0_IFM_IFMODE_GMII | ENETC_PM0_IFM_RG; enetc_port_wr(hw, ENETC_PM0_IF_MODE, val); } --=20 DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany --UlVJffcvxoiEqYs2 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQRPfPO7r0eAhk010v0w5/Bqldv68gUCYFNI2wAKCRAw5/Bqldv6 8rfmAKC+2NLtn0Ev4aQO2XeCotEz714UeACgwwExRyN/HyzwIze9/gxKal/+z8U= =wAOP -----END PGP SIGNATURE----- --UlVJffcvxoiEqYs2--