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 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 DE8EAECE599 for ; Wed, 16 Oct 2019 20:18:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B5148207FF for ; Wed, 16 Oct 2019 20:18:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2437129AbfJPUSF (ORCPT ); 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.