Skip to content

Commit c6d6ef3

Browse files
HoratiuVulturdavem330
authored andcommitted
net: phy: micrel: Fix PTP_PF_PEROUT for lan8841
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: e4ed8ba ("net: phy: micrel: Add support for PTP_PF_PEROUT for lan8841") Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent e61caf0 commit c6d6ef3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/phy/micrel.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3761,7 +3761,7 @@ static int lan8841_ptp_update_target(struct kszphy_ptp_priv *ptp_priv,
37613761
const struct timespec64 *ts)
37623762
{
37633763
return lan8841_ptp_set_target(ptp_priv, LAN8841_EVENT_A,
3764-
ts->tv_sec + LAN8841_BUFFER_TIME, ts->tv_nsec);
3764+
ts->tv_sec + LAN8841_BUFFER_TIME, 0);
37653765
}
37663766

37673767
#define LAN8841_PTP_LTC_TARGET_RELOAD_SEC_HI(event) ((event) == LAN8841_EVENT_A ? 282 : 292)

0 commit comments

Comments
 (0)