Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp989459ybp; Thu, 17 Oct 2019 06:32:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqzAUhNfQqFs7d+DJQZzfMpuAc1plfMjgFHFJiB4PTUIdaY5Fu4i5dLg6G+Io6S2jbejTese X-Received: by 2002:a17:906:8315:: with SMTP id j21mr3541460ejx.244.1571319153840; Thu, 17 Oct 2019 06:32:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571319153; cv=none; d=google.com; s=arc-20160816; b=HMfE1CSY6umKVRhvnRbMZJ04c2Qlv1+/UnXnHugTcFb4pcMhyHrGt+qLZ7pGuPhBKH kFgdSW0reTkDLySbT69KdN+gxR0d75/DIo8La1NMS05pqPiwxuzcy9U00XN97r4GlStx 8Kx0uki052ogjQL9ayhBHB+Ys7tgiqVJo5gipe6XkHgmNqxPIlMEf6quJcQdJKMq+CZ+ SWVb7+Fe9YOn0U64PPxc2UUjTrgWvdONgOJqnp2RFWa40okMdOr6Bcxo874+VEaAshD2 TLXNj0fGo/4Tbvy4pjdEVcfx1SdMNMBXXtkTCOnroKw5ThUZbG9S3x+n3Y2rzNK9clpm elKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:from:subject:cc:to:message-id:date; bh=HcbtL3YHyT3YM1+fnZfl/6CpB3MYNVH+2qIWglq40Cg=; b=nEueFTGrCQ5X1wALrCSn1WIAzJIevxVV4LN80sc6fPbSIhxD+sJ6KdcFYeL5JjHv5s tcJGtzbEhemK8/I7kkz6g5Lc5ur3rYvJcO+06T7dMvr7QOcLhOJs8sm4lbmh8YeInlbb 6hSUu/eCJvMzZ8yepmQ1qV4UcwhvXcEiaZYg8rfTYTn/wGvXVe0xF7ae0Rel9ulcdjkK fMaIlUN+KpLxndaIbGnrBNb/vyotm0MNSllaXolrcwzA6fyQlyyTLBaAtAu13B3sEceE MCLe10/YBJheH/AeKqgjbEsEsO2Cp4WT3cPlS4rL7a+D+nlbz8nn4ETbZ0kiflwvLp+D HGIw== ARC-Authentication-Results: i=1; mx.google.com; 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 x14si1496634edq.49.2019.10.17.06.32.10; Thu, 17 Oct 2019 06:32:33 -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; 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 S2437125AbfJPUSF (ORCPT + 99 others); Wed, 16 Oct 2019 16:18:05 -0400 Received: from shards.monkeyblade.net ([23.128.96.9]:53884 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733249AbfJPUSF (ORCPT ); Wed, 16 Oct 2019 16:18:05 -0400 Received: from localhost (unknown [IPv6:2601:601:9f00:1e2::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 968D81434B98B; Wed, 16 Oct 2019 13:18:04 -0700 (PDT) Date: Wed, 16 Oct 2019 13:18:01 -0700 (PDT) Message-Id: <20191016.131801.2242669095837757698.davem@davemloft.net> To: liuyonglong@huawei.com Cc: hkallweit1@gmail.com, andrew@lunn.ch, 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: Fix "link partner" information disappear issue From: David Miller In-Reply-To: <1571193039-36228-1-git-send-email-liuyonglong@huawei.com> References: <1571193039-36228-1-git-send-email-liuyonglong@huawei.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]); Wed, 16 Oct 2019 13:18:04 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yonglong Liu Date: Wed, 16 Oct 2019 10:30:39 +0800 > Some drivers just call phy_ethtool_ksettings_set() to set the > links, for those phy drivers that use genphy_read_status(), if > autoneg is on, and the link is up, than execute "ethtool -s > ethx autoneg on" will cause "link partner" information disappear. > > The call trace is phy_ethtool_ksettings_set()->phy_start_aneg() > ->linkmode_zero(phydev->lp_advertising)->genphy_read_status(), > the link didn't change, so genphy_read_status() just return, and > phydev->lp_advertising is zero now. > > This patch moves the clear operation of lp_advertising from > phy_start_aneg() to genphy_read_lpa()/genphy_c45_read_lpa(), and > if autoneg on and autoneg not complete, just clear what the > generic functions care about. > > Fixes: 88d6272acaaa ("net: phy: avoid unneeded MDIO reads in genphy_read_status") > Signed-off-by: Yonglong Liu Applied and queued up for -stable, thank you.