From: Joakim Zhang <qiangqing.zhang@nxp.com>
To: davem@davemloft.net, kuba@kernel.org, robh+dt@kernel.org,
andrew@lunn.ch, hkallweit1@gmail.com, linux@armlinux.org.uk,
f.fainelli@gmail.com, Jisheng.Zhang@synaptics.com
Cc: linux-imx@nxp.com, netdev@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH V2 net-next 4/4] net: phy: realtek: add delay to fix RXC generation issue
Date: Tue, 8 Jun 2021 11:00:34 +0800 [thread overview]
Message-ID: <20210608030034.3113-5-qiangqing.zhang@nxp.com> (raw)
In-Reply-To: <20210608030034.3113-1-qiangqing.zhang@nxp.com>
PHY will delay about 11.5ms to generate RXC clock when switching from
power down to normal operation. Read/write registers would also cause RXC
become unstable and stop for a while during this process. Realtek engineer
suggests 15ms or more delay can workaround this issue.
Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
---
drivers/net/phy/realtek.c | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/drivers/net/phy/realtek.c b/drivers/net/phy/realtek.c
index 79dc55bb4091..1b844a06fe72 100644
--- a/drivers/net/phy/realtek.c
+++ b/drivers/net/phy/realtek.c
@@ -410,6 +410,19 @@ static int rtl8211f_config_init(struct phy_device *phydev)
return genphy_soft_reset(phydev);
}
+static int rtl821x_resume(struct phy_device *phydev)
+{
+ int ret;
+
+ ret = genphy_resume(phydev);
+ if (ret < 0)
+ return ret;
+
+ msleep(20);
+
+ return 0;
+}
+
static int rtl8211e_config_init(struct phy_device *phydev)
{
int ret = 0, oldpage;
@@ -906,7 +919,7 @@ static struct phy_driver realtek_drvs[] = {
.config_intr = &rtl8211f_config_intr,
.handle_interrupt = rtl8211f_handle_interrupt,
.suspend = genphy_suspend,
- .resume = genphy_resume,
+ .resume = rtl821x_resume,
.read_page = rtl821x_read_page,
.write_page = rtl821x_write_page,
}, {
--
2.17.1
next prev parent reply other threads:[~2021-06-08 3:01 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-08 3:00 [PATCH V2 net-next 0/4] net: phy: add dt property for realtek phy Joakim Zhang
2021-06-08 3:00 ` [PATCH V2 net-next 1/4] dt-bindings: net: add dt binding for realtek rtl82xx phy Joakim Zhang
2021-06-08 3:00 ` [PATCH V2 net-next 2/4] net: phy: realtek: add dt property to disable CLKOUT clock Joakim Zhang
2021-06-08 3:00 ` [PATCH V2 net-next 3/4] net: phy: realtek: add dt property to disable ALDPS mode Joakim Zhang
2021-06-08 3:00 ` Joakim Zhang [this message]
2021-06-08 3:09 ` [PATCH V2 net-next 0/4] net: phy: add dt property for realtek phy Joakim Zhang
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=20210608030034.3113-5-qiangqing.zhang@nxp.com \
--to=qiangqing.zhang@nxp.com \
--cc=Jisheng.Zhang@synaptics.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=f.fainelli@gmail.com \
--cc=hkallweit1@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-imx@nxp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=netdev@vger.kernel.org \
--cc=robh+dt@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).