linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: <praneeth@ti.com>
To: Praneeth Bajjuri <praneeth@ti.com>, Andrew Lunn <andrew@lunn.ch>,
	Geet Modi <geet.modi@ti.com>, <netdev@vger.kernel.org>
Cc: "David S . Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>, <linux-kernel@vger.kernel.org>
Subject: [PATCH v2] net: phy: dp83867: perform soft reset and retain established link
Date: Wed, 9 Jun 2021 19:43:42 -0500	[thread overview]
Message-ID: <20210610004342.4493-1-praneeth@ti.com> (raw)
In-Reply-To: <3494dcf6-14ca-be2b-dbf8-dda2e208b70b@ti.com>

From: Praneeth Bajjuri <praneeth@ti.com>

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 <praneeth@ti.com>
Signed-off-by: Geet Modi <geet.modi@ti.com>
---
 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


  parent reply	other threads:[~2021-06-10  0:43 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-24  1:00 [PATCH] net: phy: dp83867: perform soft reset and retain established link praneeth
2021-03-24 12:32 ` Andrew Lunn
     [not found]   ` <404285EC-BBF0-4482-8454-3289C7AF3084@ti.com>
2021-03-31 16:35     ` [EXTERNAL] " Andrew Lunn
2021-03-31 20:36       ` [EXTERNAL] " Modi, Geet
2021-05-28 16:32       ` Bajjuri, Praneeth
2021-05-28 16:52         ` Andrew Lunn
     [not found]           ` <5480BEB5-B540-4BB6-AC32-65CB27439270@ti.com>
     [not found]             ` <EC713CBF-D669-4A0E-ADF2-093902C03C49@ti.com>
2021-06-01 19:18               ` [EXTERNAL] " Andrew Lunn
2021-06-01 23:52                 ` [EXTERNAL] " Modi, Geet
2021-06-10  0:47                 ` Bajjuri, Praneeth
2021-06-10  0:43         ` praneeth [this message]
2021-06-10  4:07           ` [PATCH v2] " Andrew Lunn
2021-06-10  5:53             ` Johannes Pointner
2021-06-11 17:05               ` Bajjuri, Praneeth
2021-06-14  8:17                 ` Johannes Pointner
2021-06-11 17:20           ` patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210610004342.4493-1-praneeth@ti.com \
    --to=praneeth@ti.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=geet.modi@ti.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).