Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp7314588ybh; Thu, 8 Aug 2019 13:38:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqyX8+d7FWf2bfhqmMMJ9FHqAoWOaa8E2i4y45HRkemdLgkheQp+6J6O3t4MFlni8KQ+3rZi X-Received: by 2002:a62:2f06:: with SMTP id v6mr17586599pfv.195.1565296685176; Thu, 08 Aug 2019 13:38:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565296685; cv=none; d=google.com; s=arc-20160816; b=q8NPdjY8QEp0681TQvdfTUy0oBfiTqhmTwx3JFBkZ4p0AEjSIZ7uTW/CRu8w2b+7kk knpwnJaqy+DYum/9Gqf9dQDxqcDu9dlweyS7jC1YnDUjtWvr/z0jX0R3vFj+rltdqdEf VUuZbQYabMeLV3eyJf/ibw4UK0af+vWKZSIINHAp8Schmd6cf/3CLkNECHfaGk/lRbg0 bFnq9p7cCjTdHUqFT6OQIHA/QuZ+h/BiMkxMMQfGZmoQx3GIe/n3y5vkTp88qBKRY6lk YilIeLM9/v4eqFQxVDjFygSjebSIDiYbetg+7f3zt9saztUfiCZHh+eoiewDpURnimw+ wCYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=FlJZGarl3bbH3/pyryWmZ82ojdu1jbJlpm/J+vJz06E=; b=m1MFo8E5UdEnVn5eSTzQMofNBsKHIp1l2/WILDPJ6WGZQbL5enxtVeG9vNcigAVuJb H+Nd7RJU5LrV4hkjr9dQBb+pA+/iRxzFnvb9rsGELR4/tPDw5W8WO7uJnRjqr4TRte2J mdWK8cNQ/iwO6EycAt/ePwXx/npOQGxO9ovYcV6hOezZK8ekgcf/v62LH+mCU1ksfDSL hx6lmPMH6bZJw3TG8f3Fa7ECuEaWk5ng3dCi3Oqz5mxHHtE6R3TMV/1w2QwQwD9M+NB+ Kj1/lAfV6sadYkwS9Q8F+koZyPB0w7RE8XVl3w+QOk8DaOE7UOnDx1NNo0R75Y81kVL4 pL+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@lunn.ch header.s=20171124 header.b=0hOmMEjL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w21si46311774plq.91.2019.08.08.13.37.50; Thu, 08 Aug 2019 13:38:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@lunn.ch header.s=20171124 header.b=0hOmMEjL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390410AbfHHUeU (ORCPT + 99 others); Thu, 8 Aug 2019 16:34:20 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:45646 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390399AbfHHUeT (ORCPT ); Thu, 8 Aug 2019 16:34:19 -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=FlJZGarl3bbH3/pyryWmZ82ojdu1jbJlpm/J+vJz06E=; b=0hOmMEjLp44q+7Z8ZdVCOhSsF9 7CyBnLfLvJ1CyenbpGxPQMBPANu+U6FuuTVEuJJ5/LFOqLZdr3L2yhNMg+kPSgXIzGqa2kXPsmNdR Fa+uXbdefu/j/qdkCPFepaJ65tYYDId6vPRGgjLEri+RhGRnBYgCeGAuu3voLKEVaaSk=; Received: from andrew by vps0.lunn.ch with local (Exim 4.89) (envelope-from ) id 1hvp71-0005sf-1V; Thu, 08 Aug 2019 22:34:15 +0200 Date: Thu, 8 Aug 2019 22:34:15 +0200 From: Andrew Lunn To: Heiner Kallweit Cc: Yonglong Liu , davem@davemloft.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linuxarm@huawei.com, salil.mehta@huawei.com, yisen.zhuang@huawei.com, shiju.jose@huawei.com Subject: Re: [PATCH net] net: phy: rtl8211f: do a double read to get real time link status Message-ID: <20190808203415.GO27917@lunn.ch> References: <1565183772-44268-1-git-send-email-liuyonglong@huawei.com> <080b68c7-abe6-d142-da4b-26e8a7d4dc19@gmail.com> <20190808194049.GM27917@lunn.ch> <26e2c5c9-915c-858b-d091-e5bfa7ab6a5b@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <26e2c5c9-915c-858b-d091-e5bfa7ab6a5b@gmail.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 08, 2019 at 10:01:39PM +0200, Heiner Kallweit wrote: > On 08.08.2019 21:40, Andrew Lunn wrote: > >> @@ -568,6 +568,11 @@ int phy_start_aneg(struct phy_device *phydev) > >> if (err < 0) > >> goto out_unlock; > >> > >> + /* The PHY may not yet have cleared aneg-completed and link-up bit > >> + * w/o this delay when the following read is done. > >> + */ > >> + usleep_range(1000, 2000); > >> + > > > > Hi Heiner > > > > Does 802.3 C22 say anything about this? > > > C22 says: > "The Auto-Negotiation process shall be restarted by setting bit 0.9 to a logic one. This bit is self- > clearing, and a PHY shall return a value of one in bit 0.9 until the Auto-Negotiation process has been > initiated." > > Maybe we should read bit 0.9 in genphy_update_link() after having read BMSR and report > aneg-complete and link-up as false (no matter of their current value) if 0.9 is set. Yes. That sounds sensible. Andrew