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.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED,USER_AGENT_MUTT 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 33482C282C3 for ; Wed, 23 Jan 2019 02:10:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E654220868 for ; Wed, 23 Jan 2019 02:10:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b="eBCpn1nH" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726907AbfAWCKf (ORCPT ); Tue, 22 Jan 2019 21:10:35 -0500 Received: from vps0.lunn.ch ([185.16.172.187]:52265 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726047AbfAWCKf (ORCPT ); Tue, 22 Jan 2019 21:10:35 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=WBCj3G+sN85X1gXuSlDH3H3jIv/N+nrXawoKFILcAGk=; b=eBCpn1nHHAbQ32+nCDCzG9+FEpmnFho5z2g4chCOdQ7SOj2gPIDJs3LuE1tHwPIylIlSD3dkoFld1x31/FozWCSBfhi0pMmos4K1zwEZCz1iH2BR2Jfpgsm1VBXEpemsreg8KzMHKARAxAZ3xt6e7KtKaDG9xvFoChWkdey9e+4=; Received: from andrew by vps0.lunn.ch with local (Exim 4.84_2) (envelope-from ) id 1gm7zs-0006Yb-1Q; Wed, 23 Jan 2019 03:10:32 +0100 Date: Wed, 23 Jan 2019 03:10:32 +0100 From: Andrew Lunn To: Samu Nuutamo Cc: netdev@vger.kernel.org, Vivien Didelot , Florian Fainelli , "David S. Miller" Subject: Re: Regression: mv88e6xxx packet loss after 4.18's PHYLINK merge Message-ID: <20190123021032.GG3634@lunn.ch> References: <20190114113444.GB16632@samu-ThinkPad-T480s> <20190117022935.GJ24870@lunn.ch> <20190117113722.GA22476@samu-ThinkPad-T480s> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190117113722.GA22476@samu-ThinkPad-T480s> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org > Hi Andrew, > > I tested the patch and it has an issue that prevents the carrier from turning > on. I think it's caused by the change from using link_state to phy->phy_state, > as later in the same function the link_state attributes are read when > deciding if the carrier needs to be turned on. Hi Samu This version has had better testing. So i'm a bit more confident about it. Andrew >From d093492f9aba75cb4844d15148e0efd014f193bb Mon Sep 17 00:00:00 2001 From: Andrew Lunn Date: Wed, 16 Jan 2019 20:22:04 -0600 Subject: [PATCH] net: phy: phylink: Only change mac when fixed link changes state phylink polls the fixed-link once per second to see if the GPIO has changed state, or if the callback indicates if there has been a change in state. It then calls the MAC to reconfigure itself to the current state. For some MACs, reconfiguration can result in packets being dropped. Hence only reconfigure the MAC if the link state differs from the netdev carrier state. Reported-by: Samu Nuutamo Fixes: 9cd00a8aa42e ("net: phy: phylink: Poll link GPIOs") Signed-off-by: Andrew Lunn --- drivers/net/phy/phylink.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c index e7becc7379d7..394b1eb5b55a 100644 --- a/drivers/net/phy/phylink.c +++ b/drivers/net/phy/phylink.c @@ -409,7 +409,8 @@ static void phylink_resolve(struct work_struct *w) case MLO_AN_FIXED: phylink_get_fixed_state(pl, &link_state); - phylink_mac_config(pl, &link_state); + if (link_state.link != netif_carrier_ok(ndev)) + phylink_mac_config(pl, &link_state); break; case MLO_AN_INBAND: -- 2.20.1