Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp523471rwn; Thu, 15 Sep 2022 02:22:45 -0700 (PDT) X-Google-Smtp-Source: AA6agR7vejXQo0vZGs6kMz9p2KZAC9Gu5t97ebQt678VyLpuNGnZ0N0g6vyIgqtvxdHErDANyyP4 X-Received: by 2002:a17:907:3e12:b0:780:523b:d9cf with SMTP id hp18-20020a1709073e1200b00780523bd9cfmr2338765ejc.326.1663233765456; Thu, 15 Sep 2022 02:22:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663233765; cv=none; d=google.com; s=arc-20160816; b=oZ1K0yVxV5aBdWdsxHhXESzdI0Ius2GPXcvZtK3uTCpUaIDqOFUJrFzV+OL6DH2Nsg 8OWJi3NEA5BQrGnDZUQFsuyQ9ZQdlzX7aywDdA/jcmjtou+DOFYjigjv86aUe3vM7uu5 fHUjL+amxzsr7W3fUh7ybU3S/c+YwPjhy00Kb6U333tnYbZh8lNtOz2I1QDPPSD3yPVO A+mThLzJa5YyRvSt95H+ox+2gMwiBCzy/KGS/DccfXKU9cqrlFWfu4rCYpSsGu0lUw9c lnX/Wtkv2c7be2D9OoUOJNcRYUEP9bW5s3LxKBFNV/r81hoZnwOOJy9kSYjOjoZCQcxm zLVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=0DtyK9I/q76HEqX/0WExozkgxY5BO2j7qLyMe6xkWRw=; b=kW2h0FPyE9U6fD0Gf4AVbbL4Lnosv7uk5u8rLq+19EkVvw/EiP9uaVnT1TOCPQWiEd Wyxerc9tadzt9wXLRLO0thtxwYIciGTNWwhX3L9VHwvx669OmUNFmKaIpNvEIP73pF+6 8g2QuB7N13wfK4T3xSg9HWIRCipYplE9SNOnUM43IiiP2o8ktiltOfDsR7e/0JC9VZ1M RHpajsH0d+4IEc++bKQDAckW+I0iG7sxyJOOiE7BrTd9T+vJDXHmCFWrEusCUVi6GkK5 UCpNlGILoxGMpndgQ3q+5MbLzNw8ThEsKkvUVcjBZ+twnN6nMgUw/yV0rhcCIzE+5nq4 deeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=KfPdLIr+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w4-20020a05640234c400b00447726f8e2asi16623481edc.48.2022.09.15.02.22.16; Thu, 15 Sep 2022 02:22:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=KfPdLIr+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229602AbiIOJFk (ORCPT + 99 others); Thu, 15 Sep 2022 05:05:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38904 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229452AbiIOJFj (ORCPT ); Thu, 15 Sep 2022 05:05:39 -0400 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6688795AC1; Thu, 15 Sep 2022 02:05:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1663232738; x=1694768738; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=PQd9NG7r7Qh0xrNlLQSODxX4esx5SIk8ks2+Gn/DQwQ=; b=KfPdLIr+BFwpyRNqB5cPfftsyc3zS7TRFers/ZXkwm6XfqyvRFyJjRtS tnYKZR4KogyoWkoo83swzz1Vm2DL1gXJvejAMfhM/oC/uCZIAXegwP2E6 IBUM56sAJJ17RSPfNlSSFG7BaGvCIexcAUQg1iLx+zskK9QdklSrbcdI1 lFjZNiuGwbMBYdHpV9GuNO734vTSOkcHb1Hq0rbvhd6mEcmoaVgXdtg26 zfwq0EYnXXl4JIxPD4tfpKrTzmAvnBXKUCoNtCzWEuUedEvdGXhQRZTVW 0Yy/+v2gogzMbz/68jH/lR6L1v0vJKzYVRd5ahwd+WncfsBeC/T5vwi78 A==; X-IronPort-AV: E=McAfee;i="6500,9779,10470"; a="299471889" X-IronPort-AV: E=Sophos;i="5.93,317,1654585200"; d="scan'208";a="299471889" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Sep 2022 02:05:36 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,317,1654585200"; d="scan'208";a="679424415" Received: from yongliang-ubuntu20-ilbpg12.png.intel.com ([10.88.229.33]) by fmsmga008.fm.intel.com with ESMTP; 15 Sep 2022 02:05:33 -0700 From: Choong Yong Liang To: "David S . Miller" , Andrew Lunn , Heiner Kallweit , Russell King , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Dan Murphy Cc: Song Yoong Siang , Cacho Gerome , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net 1/1] net: phy: dp83867: perform phy reset after modifying auto-neg setting Date: Thu, 15 Sep 2022 05:02:58 -0400 Message-Id: <20220915090258.2154767-1-yong.liang.choong@linux.intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.3 required=5.0 tests=AC_FROM_MANY_DOTS,BAYES_00, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Song Yoong Siang In the case where TI DP83867 is connected back-to-back with another TI DP83867, SEEDs match will occurs when advertised link speed is changed from 100 Mbps to 1 Gbps, which causing Master/Slave resolution fails and restart of the auto-negotiation. As a result, TI DP83867 copper auto-negotiation completion will takes up to 15 minutes. To resolve the issue, this patch implemented phy reset (software restart which perform a full reset, but not including registers) immediately after modifying auto-negotiation setting. By applying reset to the phy, it would also reset the lfsr which would increase the probability of SEEDS being different and help in Master/Slave resolution. Gerome from TI has confirmed that there is no harm in adding soft restart in auto-negotiation programming flow, even though the system is not facing SEEDs match issue. Fixes: 2a10154abcb7 ("net: phy: dp83867: Add TI dp83867 phy") Cc: # 5.4.x Signed-off-by: Song Yoong Siang Reviewed-by: Cacho Gerome Signed-off-by: Choong Yong Liang --- drivers/net/phy/dp83867.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/net/phy/dp83867.c b/drivers/net/phy/dp83867.c index 6939563d3b7c..6e4b10f35696 100644 --- a/drivers/net/phy/dp83867.c +++ b/drivers/net/phy/dp83867.c @@ -925,6 +925,17 @@ static void dp83867_link_change_notify(struct phy_device *phydev) } } +static int dp83867_config_aneg(struct phy_device *phydev) +{ + int err; + + err = genphy_config_aneg(phydev); + if (err < 0) + return err; + + return dp83867_phy_reset(phydev); +} + static struct phy_driver dp83867_driver[] = { { .phy_id = DP83867_PHY_ID, @@ -951,6 +962,7 @@ static struct phy_driver dp83867_driver[] = { .resume = genphy_resume, .link_change_notify = dp83867_link_change_notify, + .config_aneg = dp83867_config_aneg, }, }; module_phy_driver(dp83867_driver); -- 2.25.1