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.1 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no 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 EAE2DC49ED7 for ; Mon, 16 Sep 2019 15:13:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AF533206C2 for ; Mon, 16 Sep 2019 15:13:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b="XzPSsFA5" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728517AbfIPPNV (ORCPT ); Mon, 16 Sep 2019 11:13:21 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:48778 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728230AbfIPPNU (ORCPT ); Mon, 16 Sep 2019 11:13:20 -0400 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:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=qslw6kOw2Be8j7nCTauCKrs1ny5oQCdTuGpIO3utnSA=; b=XzPSsFA56UbCxXztwk8Nd0e199 xiuwFcr0XHc6gjj4SBp3xoX3CFlM364jhcnHL0E0YqDwNBQiuZQGb5eYvXiD6RLl9+Zeo5cR2K6v/ FBB9RwtRdt3Y3vSTbNtcq7gVU2CxN9RSsCNvgh8brm6RMBbB6JB++xO0jpHRDaBRWQI8=; Received: from andrew by vps0.lunn.ch with local (Exim 4.89) (envelope-from ) id 1i9sgm-00032O-O4; Mon, 16 Sep 2019 17:13:16 +0200 Date: Mon, 16 Sep 2019 17:13:16 +0200 From: Andrew Lunn To: Paul Thomas Cc: Florian Fainelli , Heiner Kallweit , "David S. Miller" , netdev@vger.kernel.org Subject: Re: net: phy: micrel KSZ9031 ifdown ifup issue Message-ID: <20190916151316.GA8144@lunn.ch> References: <20190914145443.GE27922@lunn.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 > When it is in the good state I see that reg 0x01 is 0x796d where bit > 1.2 reports 'Link is up' and bit 1.5 reports 'Auto-negotiation process > complete'. However, once I get to the bad state (it may take several > tries of ifdown, ifup to get there) then reg 0x01 is 0x7649 reporting > 'Link is down' and 'Auto-negotiation process not completed'. This can > be fixed by resetting the phy './phytool write eth0/3/0 0x9140' > > So, I guess that means the driver is doing what it is supposed to? > Could we add quirk or something to reset the phy again from the driver > if auto-negotiation doesn't complete with x seconds? Hi Paul Adding a timeout would make sense. But please try to hide all this inside the PHY driver. Since it is being polled, the read_status() should be called once per second, so you should be able to handle all this inside that driver callback. Andrew