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 X-Spam-Level: X-Spam-Status: No, score=-8.3 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_2 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0585EC32751 for ; Sun, 11 Aug 2019 01:57:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C59F8208C3 for ; Sun, 11 Aug 2019 01:57:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nic.cz header.i=@nic.cz header.b="JKnHWRnE" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726509AbfHKB5D (ORCPT ); Sat, 10 Aug 2019 21:57:03 -0400 Received: from mail.nic.cz ([217.31.204.67]:46684 "EHLO mail.nic.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726496AbfHKB5D (ORCPT ); Sat, 10 Aug 2019 21:57:03 -0400 Received: from localhost (unknown [172.20.6.135]) by mail.nic.cz (Postfix) with ESMTPSA id 7F3CE140BB6; Sun, 11 Aug 2019 03:47:42 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nic.cz; s=default; t=1565488062; bh=VUbzR1diTFcPxuQ4KhHZImhBUkMdHZ0VbIlnKoYDvDg=; h=Date:From:To; b=JKnHWRnESsP8mtWhhU3eqznA+HI2I0f0mXIGVjSmD1C6LzOp1eJ6FKr2yr3wJB4kq 1kpLiqEkFKfLwaQWiCoewMCYqIh3m0LL34Zy2/ArmckQmFtvo0pbUarMA9RFQPhtns Vk69u9gZxQbejqkBW65P9yH6fJ/JSdE/EipLRy2o= Date: Sun, 11 Aug 2019 03:47:42 +0200 From: Marek Behun To: netdev@vger.kernel.org Cc: Heiner Kallweit , Sebastian Reichel , Vivien Didelot , Andrew Lunn , Florian Fainelli , "David S . Miller" Subject: Re: [PATCH net-next 1/1] net: dsa: fix fixed-link port registration Message-ID: <20190811034742.349f0ef1@nic.cz> In-Reply-To: <20190811014650.28141-1-marek.behun@nic.cz> References: <20190811014650.28141-1-marek.behun@nic.cz> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: clamav-milter 0.100.3 at mail.nic.cz X-Virus-Status: Clean Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This should probably go into stable as well, after review. Marek On Sun, 11 Aug 2019 03:46:50 +0200 Marek Beh=C3=BAn wrote: > Commit 88d6272acaaa ("net: phy: avoid unneeded MDIO reads in > genphy_read_status") broke fixed link DSA port registration in > dsa_port_fixed_link_register_of: the genphy_read_status does not do what > it is supposed to and the following adjust_link is given wrong > parameters. >=20 > This causes a regression on Turris Omnia, where the mvneta driver for > the interface connected to the switch reports crc errors, for some > reason. >=20 > I realize this fix is not ideal, something else could change in genphy > functions which could cause DSA fixed-link port to break again. > Hopefully DSA fixed-link port functionality will be converted to phylink > API soon. >=20 > Signed-off-by: Marek Beh=C3=BAn > Cc: Heiner Kallweit > Cc: Sebastian Reichel > Cc: Vivien Didelot > Cc: Andrew Lunn > Cc: Florian Fainelli > Cc: David S. Miller > --- > net/dsa/port.c | 11 +++++++++++ > 1 file changed, 11 insertions(+) >=20 > diff --git a/net/dsa/port.c b/net/dsa/port.c > index 363eab6df51b..c424ebb373e1 100644 > --- a/net/dsa/port.c > +++ b/net/dsa/port.c > @@ -485,6 +485,17 @@ static int dsa_port_fixed_link_register_of(struct ds= a_port *dp) > phydev->interface =3D mode; > =20 > genphy_config_init(phydev); > + > + /* > + * Commit 88d6272acaaa caused genphy_read_status not to do it's work if > + * autonegotiation is enabled and link status did not change. This is > + * the case for fixed_phy. By setting phydev->link =3D 0 before the call > + * to genphy_read_status we force it to read and fill in the parameters. > + * > + * Hopefully this dirty hack will be removed soon by converting DSA > + * fixed link ports to phylink API. > + */ > + phydev->link =3D 0; > genphy_read_status(phydev); > =20 > if (ds->ops->adjust_link)