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=-2.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS, 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 0D215C31680 for ; Mon, 21 Jan 2019 17:52:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C139F2089F for ; Mon, 21 Jan 2019 17:52:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b="Nho61+yg" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726222AbfAURwk (ORCPT ); Mon, 21 Jan 2019 12:52:40 -0500 Received: from vps0.lunn.ch ([185.16.172.187]:50681 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725908AbfAURwk (ORCPT ); Mon, 21 Jan 2019 12:52:40 -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=KYARfIT1TTbPrF85r/jI48zW4E1f2m54w3jW68/62N8=; b=Nho61+yggwtpTbAdCgAlbh1qZ808vJYmzSSXL9iPrTHAUntcpTcdf7Ece/ub7Yk5Lg1F7S4ZK8RMzrtJ+3bqy3arqbVg2lzPmzXmyZnyHbNoKWG+lJjM89QkAZ2VTElAFHMEKmlsWT1JLNC2R5ZTS1ZoPSobUlAHY/mbyUG8kKg=; Received: from andrew by vps0.lunn.ch with local (Exim 4.84_2) (envelope-from ) id 1gldkT-0003oF-Jo; Mon, 21 Jan 2019 18:52:37 +0100 Date: Mon, 21 Jan 2019 18:52:37 +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: <20190121175237.GC13437@lunn.ch> References: <20190114113444.GB16632@samu-ThinkPad-T480s> <20190117022935.GJ24870@lunn.ch> <20190117154604.GA15435@samu-ThinkPad-T480s> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190117154604.GA15435@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've debugged the issue further by dumping all the values inside > phylink_resolve to get a better understand how the link state behaves. > > As this is a fixed link the link_state structure is populated by > phylink_get_fixed_state(), but in our case neither get_fixed_state callback > or GPIO is used. This means the link_state comes straight from the > link_config, meaning link_state.link will always be 1. On the other hand the > pl->phy_state seems to never change and the phy_state.link stays 0 even > when the link is up and functional. > > This makes it impossible to use these variables for deciding if > phylink_mac_config needs to be run, and this got me thinking: do we even need > to reconfigure the link? The phylink_mac_config() is already called from > phylink_start and fixed links shouldn't change(?). Fixed links do change, they can read a GPIO to tell you if the link is up/down, and there is a callback which can be used to indicate if the link is up or down. If you remove that call as suggested, you break a number of boards. The state tracking has to be made to work, so that phylink_mac_config() is called once on state change, and not more. Andrew