* Re: [PATCH net v2] net: phy: marvell10g: fix 88x3310 power up
2023-07-19 9:22 [PATCH net v2] net: phy: marvell10g: fix 88x3310 power up Jiawen Wu
@ 2023-07-19 9:13 ` Russell King (Oracle)
2023-07-20 11:34 ` Paolo Abeni
2023-07-23 10:50 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: Russell King (Oracle) @ 2023-07-19 9:13 UTC (permalink / raw)
To: Jiawen Wu
Cc: kabel, andrew, hkallweit1, davem, edumazet, kuba, pabeni, netdev
On Wed, Jul 19, 2023 at 05:22:33PM +0800, Jiawen Wu wrote:
> Clear MV_V2_PORT_CTRL_PWRDOWN bit to set power up for 88x3310 PHY,
> it sometimes does not take effect immediately. And a read of this
> register causes the bit not to clear. This will cause mv3310_reset()
> to time out, which will fail the config initialization. So add a delay
> before the next access.
>
> Fixes: c9cc1c815d36 ("net: phy: marvell10g: place in powersave mode at probe")
> Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Thanks!
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH net v2] net: phy: marvell10g: fix 88x3310 power up
@ 2023-07-19 9:22 Jiawen Wu
2023-07-19 9:13 ` Russell King (Oracle)
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Jiawen Wu @ 2023-07-19 9:22 UTC (permalink / raw)
To: linux, kabel, andrew, hkallweit1, davem, edumazet, kuba, pabeni,
netdev
Cc: Jiawen Wu
Clear MV_V2_PORT_CTRL_PWRDOWN bit to set power up for 88x3310 PHY,
it sometimes does not take effect immediately. And a read of this
register causes the bit not to clear. This will cause mv3310_reset()
to time out, which will fail the config initialization. So add a delay
before the next access.
Fixes: c9cc1c815d36 ("net: phy: marvell10g: place in powersave mode at probe")
Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
---
v1 -> v2:
- change poll-bit-clear to time delay
---
drivers/net/phy/marvell10g.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/net/phy/marvell10g.c b/drivers/net/phy/marvell10g.c
index 55d9d7acc32e..d4bb90d76881 100644
--- a/drivers/net/phy/marvell10g.c
+++ b/drivers/net/phy/marvell10g.c
@@ -328,6 +328,13 @@ static int mv3310_power_up(struct phy_device *phydev)
ret = phy_clear_bits_mmd(phydev, MDIO_MMD_VEND2, MV_V2_PORT_CTRL,
MV_V2_PORT_CTRL_PWRDOWN);
+ /* Sometimes, the power down bit doesn't clear immediately, and
+ * a read of this register causes the bit not to clear. Delay
+ * 100us to allow the PHY to come out of power down mode before
+ * the next access.
+ */
+ udelay(100);
+
if (phydev->drv->phy_id != MARVELL_PHY_ID_88X3310 ||
priv->firmware_ver < 0x00030000)
return ret;
--
2.27.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH net v2] net: phy: marvell10g: fix 88x3310 power up
2023-07-19 9:22 [PATCH net v2] net: phy: marvell10g: fix 88x3310 power up Jiawen Wu
2023-07-19 9:13 ` Russell King (Oracle)
@ 2023-07-20 11:34 ` Paolo Abeni
2023-07-23 10:50 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: Paolo Abeni @ 2023-07-20 11:34 UTC (permalink / raw)
To: Jiawen Wu, linux, kabel, andrew, hkallweit1, davem, edumazet,
kuba, netdev
On Wed, 2023-07-19 at 17:22 +0800, Jiawen Wu wrote:
> Clear MV_V2_PORT_CTRL_PWRDOWN bit to set power up for 88x3310 PHY,
> it sometimes does not take effect immediately. And a read of this
> register causes the bit not to clear. This will cause mv3310_reset()
> to time out, which will fail the config initialization. So add a delay
> before the next access.
>
> Fixes: c9cc1c815d36 ("net: phy: marvell10g: place in powersave mode at probe")
> Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
> ---
> v1 -> v2:
> - change poll-bit-clear to time delay
> ---
> drivers/net/phy/marvell10g.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/drivers/net/phy/marvell10g.c b/drivers/net/phy/marvell10g.c
> index 55d9d7acc32e..d4bb90d76881 100644
> --- a/drivers/net/phy/marvell10g.c
> +++ b/drivers/net/phy/marvell10g.c
> @@ -328,6 +328,13 @@ static int mv3310_power_up(struct phy_device *phydev)
> ret = phy_clear_bits_mmd(phydev, MDIO_MMD_VEND2, MV_V2_PORT_CTRL,
> MV_V2_PORT_CTRL_PWRDOWN);
>
> + /* Sometimes, the power down bit doesn't clear immediately, and
> + * a read of this register causes the bit not to clear. Delay
> + * 100us to allow the PHY to come out of power down mode before
> + * the next access.
> + */
> + udelay(100);
Out of sheer ignorance, would an usleep_range(...) be more appropriate
here?
Thanks!
Paolo
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net v2] net: phy: marvell10g: fix 88x3310 power up
2023-07-19 9:22 [PATCH net v2] net: phy: marvell10g: fix 88x3310 power up Jiawen Wu
2023-07-19 9:13 ` Russell King (Oracle)
2023-07-20 11:34 ` Paolo Abeni
@ 2023-07-23 10:50 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-07-23 10:50 UTC (permalink / raw)
To: Jiawen Wu
Cc: linux, kabel, andrew, hkallweit1, davem, edumazet, kuba, pabeni,
netdev
Hello:
This patch was applied to netdev/net.git (main)
by David S. Miller <davem@davemloft.net>:
On Wed, 19 Jul 2023 17:22:33 +0800 you wrote:
> Clear MV_V2_PORT_CTRL_PWRDOWN bit to set power up for 88x3310 PHY,
> it sometimes does not take effect immediately. And a read of this
> register causes the bit not to clear. This will cause mv3310_reset()
> to time out, which will fail the config initialization. So add a delay
> before the next access.
>
> Fixes: c9cc1c815d36 ("net: phy: marvell10g: place in powersave mode at probe")
> Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
>
> [...]
Here is the summary with links:
- [net,v2] net: phy: marvell10g: fix 88x3310 power up
https://git.kernel.org/netdev/net/c/c7b75bea853d
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-07-23 10:50 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-19 9:22 [PATCH net v2] net: phy: marvell10g: fix 88x3310 power up Jiawen Wu
2023-07-19 9:13 ` Russell King (Oracle)
2023-07-20 11:34 ` Paolo Abeni
2023-07-23 10:50 ` patchwork-bot+netdevbpf
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).