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=-3.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 CB90DC0650F for ; Sat, 3 Aug 2019 01:15:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9447C20665 for ; Sat, 3 Aug 2019 01:15:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388657AbfHCBPU (ORCPT ); Fri, 2 Aug 2019 21:15:20 -0400 Received: from shards.monkeyblade.net ([23.128.96.9]:53082 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387926AbfHCBPU (ORCPT ); Fri, 2 Aug 2019 21:15:20 -0400 Received: from localhost (unknown [IPv6:2601:601:9f80:35cd::d71]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id BF93212B88C08; Fri, 2 Aug 2019 18:15:19 -0700 (PDT) Date: Fri, 02 Aug 2019 18:15:19 -0700 (PDT) Message-Id: <20190802.181519.236187362730601447.davem@davemloft.net> To: hkallweit1@gmail.com Cc: andrew@lunn.ch, f.fainelli@gmail.com, netdev@vger.kernel.org, liuyonglong@huawei.com Subject: Re: [PATCH net] net: phy: fix race in genphy_update_link From: David Miller In-Reply-To: <19122a98-cfcd-424c-a598-e034c1a9349d@gmail.com> References: <19122a98-cfcd-424c-a598-e034c1a9349d@gmail.com> X-Mailer: Mew version 6.8 on Emacs 26.1 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Fri, 02 Aug 2019 18:15:19 -0700 (PDT) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Heiner Kallweit Date: Wed, 31 Jul 2019 23:05:10 +0200 > In phy_start_aneg() autoneg is started, and immediately after that > link and autoneg status are read. As reported in [0] it can happen that > at time of this read the PHY has reset the "aneg complete" bit but not > yet the "link up" bit, what can result in a false link-up detection. > To fix this don't report link as up if we're in aneg mode and PHY > doesn't signal "aneg complete". > > [0] https://marc.info/?t=156413509900003&r=1&w=2 > > Fixes: 4950c2ba49cc ("net: phy: fix autoneg mismatch case in genphy_read_status") > Reported-by: liuyonglong > Tested-by: liuyonglong > Signed-off-by: Heiner Kallweit Applied.