mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH net-next] net: phy: micrel: Fix PTP_PF_PEROUT for lan8841
@ 2023-04-14  8:26 Horatiu Vultur
  2023-04-17  7:20 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Horatiu Vultur @ 2023-04-14  8:26 UTC (permalink / raw)
  To: netdev, linux-kernel
  Cc: andrew, hkallweit1, linux, davem, edumazet, kuba, pabeni, Horatiu Vultur

If the 1PPS output was enabled and then lan8841 was configured to be a
follower, then target clock which is used to generate the 1PPS was not
configure correctly. The problem was that for each adjustments of the
time, also the nanosecond part of the target clock was changed.
Therefore the initial nanosecond part of the target clock was changed.
The issue can be observed if both the leader and the follower are
generating 1PPS and see that their PPS are not aligned even if the time
is allined.
The fix consists of not modifying the nanosecond part of the target
clock when adjusting the time. In this way the 1PPS get also aligned.

Fixes: e4ed8ba08e3f ("net: phy: micrel: Add support for PTP_PF_PEROUT for lan8841")
Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
---
 drivers/net/phy/micrel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c
index 3fee682603ef5..382144a6306f0 100644
--- a/drivers/net/phy/micrel.c
+++ b/drivers/net/phy/micrel.c
@@ -4025,7 +4025,7 @@ static int lan8841_ptp_update_target(struct kszphy_ptp_priv *ptp_priv,
 				     const struct timespec64 *ts)
 {
 	return lan8841_ptp_set_target(ptp_priv, LAN8841_EVENT_A,
-				      ts->tv_sec + LAN8841_BUFFER_TIME, ts->tv_nsec);
+				      ts->tv_sec + LAN8841_BUFFER_TIME, 0);
 }
 
 #define LAN8841_PTP_LTC_TARGET_RELOAD_SEC_HI(event)	((event) == LAN8841_EVENT_A ? 282 : 292)
-- 
2.38.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH net-next] net: phy: micrel: Fix PTP_PF_PEROUT for lan8841
  2023-04-14  8:26 [PATCH net-next] net: phy: micrel: Fix PTP_PF_PEROUT for lan8841 Horatiu Vultur
@ 2023-04-17  7:20 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-04-17  7:20 UTC (permalink / raw)
  To: Horatiu Vultur
  Cc: netdev, linux-kernel, andrew, hkallweit1, linux, davem, edumazet,
	kuba, pabeni

Hello:

This patch was applied to netdev/net-next.git (main)
by David S. Miller <davem@davemloft.net>:

On Fri, 14 Apr 2023 10:26:59 +0200 you wrote:
> If the 1PPS output was enabled and then lan8841 was configured to be a
> follower, then target clock which is used to generate the 1PPS was not
> configure correctly. The problem was that for each adjustments of the
> time, also the nanosecond part of the target clock was changed.
> Therefore the initial nanosecond part of the target clock was changed.
> The issue can be observed if both the leader and the follower are
> generating 1PPS and see that their PPS are not aligned even if the time
> is allined.
> The fix consists of not modifying the nanosecond part of the target
> clock when adjusting the time. In this way the 1PPS get also aligned.
> 
> [...]

Here is the summary with links:
  - [net-next] net: phy: micrel: Fix PTP_PF_PEROUT for lan8841
    https://git.kernel.org/netdev/net-next/c/c6d6ef3ee3b6

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] 2+ messages in thread

end of thread, other threads:[~2023-04-17  7:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-14  8:26 [PATCH net-next] net: phy: micrel: Fix PTP_PF_PEROUT for lan8841 Horatiu Vultur
2023-04-17  7:20 ` 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

all inboxes | Powered by JetHome®