Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp100392pxj; Wed, 9 Jun 2021 17:46:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz4as4T4/e0oIlx7IWEOf1euTBsmlC1TjEPtDrx5JKItzDjpWorMGBUP/+ENzYw19omW7qW X-Received: by 2002:a17:906:4c8c:: with SMTP id q12mr2172822eju.254.1623285979303; Wed, 09 Jun 2021 17:46:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623285979; cv=none; d=google.com; s=arc-20160816; b=vKWGqGb1QoSNs6S+c+6fY7bhXJhLs3UiO51R6LxmmNHfFMhRLqoh5uo0ykOV7x7Io9 0s4IoSzNSHzSJCXc5H5aNgZBw0aE02E1BwXzaOC9ww5NZci9dn2x+uKsZt+Ku3W1cCvQ wDfh4rLNKBHSJgOHDMrZoaswTDgiO+ITlcAULseZRGQP5mqz6bF963RdqPMoOrmetgZu zYrHs3KSaLNnZSz1RDEloBl7din7EY/WyTVHAxHenNjbp/yvlKGHm5wV6gALSo41J8qr 7HDJjRf5heUpLmTNSy2/9vO5rBAb+m03UxbpAR5jOqLv1sNOdbTooKdtq74qP3ieLJRh xsgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=TWF0rV/swOt00TUr1BLIJqsEXjaJJeA+VDeQwUbOhZU=; b=trXdNmVB6qbuIcBmTAFvitT0Fwz/ZmQ2BgWdk+EAgTdDZSHL9ZKduA/Y6F4M2FAv41 QmG723gqtT1iP1NpQvHJZBSjdrjOPj8fj4F994Ia1r80QVjv0AnNU6HTTeMF/ie1laIn g3HdsKMJ6Hoy+qQKzPJY6z50uTlmgOBt1Jz4MdOw+vH3vZGlyNRdxV14C/2mV0HQkn3v 2IdrZd3lYxp8+GS9i3J9ynKW30UO2D3Zs+JPcmZIoIgjIbPMM+RvgPTXCl0xHAIks0h7 vMVH8mU50YLp+TUpriNKf8D/TtQNZwyHyZrYLs2sinBgvUXM5tOeozp8Z6y0GWyjAWC3 CUCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=VBbPz+KJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e6si1069672edz.65.2021.06.09.17.45.55; Wed, 09 Jun 2021 17:46:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=VBbPz+KJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229993AbhFJApr (ORCPT + 99 others); Wed, 9 Jun 2021 20:45:47 -0400 Received: from fllv0015.ext.ti.com ([198.47.19.141]:37170 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229507AbhFJApq (ORCPT ); Wed, 9 Jun 2021 20:45:46 -0400 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 15A0hgB3125931; Wed, 9 Jun 2021 19:43:42 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1623285822; bh=TWF0rV/swOt00TUr1BLIJqsEXjaJJeA+VDeQwUbOhZU=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=VBbPz+KJLM69HXguapwpEpJsIa7jBGIqROgCxBzuyo3NeP3tKXmgBZHsM0sre+fOX H85T+fL49GrUBEw7nEaRty8FsXXaT/zEtK0SMKjEEeGyOY+W8u48px6NVOOqtqXJMq JC8EIYx4J5khYPkA2pcMxnEiNIcih0HANj+Cu8pQ= Received: from DLEE114.ent.ti.com (dlee114.ent.ti.com [157.170.170.25]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 15A0hgxX079270 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 9 Jun 2021 19:43:42 -0500 Received: from DLEE113.ent.ti.com (157.170.170.24) by DLEE114.ent.ti.com (157.170.170.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2; Wed, 9 Jun 2021 19:43:42 -0500 Received: from fllv0040.itg.ti.com (10.64.41.20) by DLEE113.ent.ti.com (157.170.170.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2 via Frontend Transport; Wed, 9 Jun 2021 19:43:42 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0040.itg.ti.com (8.15.2/8.15.2) with ESMTP id 15A0hgpY005753; Wed, 9 Jun 2021 19:43:42 -0500 From: To: Praneeth Bajjuri , Andrew Lunn , Geet Modi , CC: "David S . Miller" , Jakub Kicinski , Subject: [PATCH v2] net: phy: dp83867: perform soft reset and retain established link Date: Wed, 9 Jun 2021 19:43:42 -0500 Message-ID: <20210610004342.4493-1-praneeth@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <3494dcf6-14ca-be2b-dbf8-dda2e208b70b@ti.com> References: <3494dcf6-14ca-be2b-dbf8-dda2e208b70b@ti.com> MIME-Version: 1.0 Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Praneeth Bajjuri Current logic is performing hard reset and causing the programmed registers to be wiped out. as per datasheet: https://www.ti.com/lit/ds/symlink/dp83867cr.pdf 8.6.26 Control Register (CTRL) do SW_RESTART to perform a reset not including the registers, If performed when link is already present, it will drop the link and trigger re-auto negotiation. Signed-off-by: Praneeth Bajjuri Signed-off-by: Geet Modi --- drivers/net/phy/dp83867.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/net/phy/dp83867.c b/drivers/net/phy/dp83867.c index 9bd9a5c0b1db..6bbc81ad295f 100644 --- a/drivers/net/phy/dp83867.c +++ b/drivers/net/phy/dp83867.c @@ -826,16 +826,12 @@ static int dp83867_phy_reset(struct phy_device *phydev) { int err; - err = phy_write(phydev, DP83867_CTRL, DP83867_SW_RESET); + err = phy_write(phydev, DP83867_CTRL, DP83867_SW_RESTART); if (err < 0) return err; usleep_range(10, 20); - /* After reset FORCE_LINK_GOOD bit is set. Although the - * default value should be unset. Disable FORCE_LINK_GOOD - * for the phy to work properly. - */ return phy_modify(phydev, MII_DP83867_PHYCTRL, DP83867_PHYCR_FORCE_LINK_GOOD, 0); } -- 2.17.1