linux/drivers/ptp
Clark Wang c3f2fc231a ptp: netc: explicitly clear TMR_OFF during initialization
The NETC timer does not support function level reset, so TMR_OFF_L/H
registers are not cleared by pcie_flr(). If TMR_OFF was set to a
non-zero value in a previous binding, it will persist across driver
rebind and cause inaccurate PTP time.

There is also a hardware issue: after a warm reset or soft reset,
TMR_OFF_L/H registers appear to be cleared to zero, but the timer clock
domain internally retains the stale value. When the timer is re-enabled,
TMR_CUR_TIME continues to track the old offset until TMR_OFF is written
explicitly. This can cause incorrect PTP timestamps and even PTP clock
synchronization failures.

Per the recommendation from the IP team, explicitly write 0 to TMR_OFF
in netc_timer_init() to flush the internally cached value and ensure
TMR_CUR_TIME follows the freshly initialized counter.

Fixes: 87a201d599 ("ptp: netc: add NETC V4 Timer PTP driver support")
Signed-off-by: Clark Wang <xiaoning.wang@nxp.com>
Signed-off-by: Wei Fang <wei.fang@nxp.com>
Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
Reviewed-by: Breno Leitao <leitao@debian.org>
Link: https://patch.msgid.link/20260720012508.23227-1-wei.fang@oss.nxp.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-07-23 09:16:14 -07:00
..
Kconfig ptp: ptp_vmclock: remove dependency on CONFIG_ACPI 2026-02-02 18:06:01 -08:00
Makefile ptp: qoriq: convert to use generic interfaces to set loopback mode 2025-09-09 19:28:52 -07:00
ptp_chardev.c ptp: Switch to ktime_get_snapshot_id() for pre/post timestamps 2026-06-04 11:04:18 +02:00
ptp_clock.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
ptp_clockmatrix.c ptp: ptp_clockmatrix: Remove redundant semicolons 2025-08-14 17:35:49 -07:00
ptp_clockmatrix.h
ptp_dfl_tod.c
ptp_dte.c Replace <linux/mod_devicetable.h> by more specific <linux/device-id/*.h> (c files) 2026-07-03 07:38:17 +02:00
ptp_fc3.c ptp: switch to using FIELD_GET_SIGNED() 2026-05-20 11:18:27 -04:00
ptp_fc3.h
ptp_idt82p33.c net: ptp: introduce .supported_extts_flags to ptp_clock_info 2025-04-15 20:20:57 -07:00
ptp_idt82p33.h
ptp_ines.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
ptp_kvm_arm.c
ptp_kvm_common.c
ptp_kvm_x86.c
ptp_mock.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
ptp_netc.c ptp: netc: explicitly clear TMR_OFF during initialization 2026-07-23 09:16:14 -07:00
ptp_ocp.c Networking changes for 7.2. 2026-06-17 08:17:00 +01:00
ptp_pch.c kernel.h: drop hex.h and update all hex.h users 2026-01-20 19:44:19 -08:00
ptp_private.h Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2025-10-01 10:14:49 +02:00
ptp_qoriq.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
ptp_s390.c ptp: ptp_s390: Add missing facility check 2026-07-23 07:02:34 -07:00
ptp_sysfs.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
ptp_vclock.c ptp: vclock: Switch from RCU to SRCU 2026-06-03 18:58:54 -07:00
ptp_vmclock.c ptp: vmclock: Use hw_cycles from snapshot for precise TSC pairing 2026-06-05 14:25:03 +02:00
ptp_vmw.c ptp: vmw: Drop ptp_vmw_acpi_device 2026-05-14 16:50:09 -07:00