From: Heiner Kallweit Subject: Re: [PATCH net-next 1/2] net: phy: don't stop state machine in case of MDIO error Date: Sun, 16 Dec 2018 10:40:54 +0100 Message-ID: <4dfc05d9-9f4f-101f-e026-b57b0c194e1d@gmail.com> References: <6e57b405-e39e-91a1-c843-f461db9bc286@gmail.com> <20181216084251.GD18287@lunn.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: Florian Fainelli , David Miller , Fugang Duan , "netdev@vger.kernel.org" To: Andrew Lunn Return-path: Received: from mail-wr1-f68.google.com ([209.85.221.68]:38822 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729354AbeLPJlC (ORCPT ); Sun, 16 Dec 2018 04:41:02 -0500 Received: by mail-wr1-f68.google.com with SMTP id v13so9350500wrw.5 for ; Sun, 16 Dec 2018 01:41:01 -0800 (PST) In-Reply-To: <20181216084251.GD18287@lunn.ch> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 16.12.2018 09:42, Andrew Lunn wrote: > On Sat, Dec 15, 2018 at 05:18:33PM +0100, Heiner Kallweit wrote: >> If we detect a MDIO error, it seems to be a little bit too aggressive >> to stop the state machine and bring down the PHY completely. > > Hi Heiner > > My assumption is, if we get one MDIO error, we will gets lots more > MDIO errors. This should be the sort of bus which either works, or it > does not. In that situation, i think it does make sense to stop > everything. > > I would like to know more about the FEC. Unfortunately, the commit > adding the timeout handling code does not explain why it is needed. > We might need to dig further backwards in time to figure it out. > After checking the fec history it seems that at the time this workaround was added as part of phylib support (8 years ago), the MDIO access timeout value was too low and therefore sometimes MDIO access failed. Later timeout was set to a higher value and driver switched to an event-driven mechanism to signal end of MDIO access. So it should be safe to remove the workaround. One issue with phy_error() is that it silently stops the PHY. We should at least add a phydev_err() to let the user know. > Andrew > Heiner