linux-yocto/drivers/ptp
Vladimir Oltean 8e1525098c ptp: allow reading of currently dialed frequency to succeed on free-running clocks
[ Upstream commit aa112cbc5f ]

There is a bug in ptp_clock_adjtime() which makes it refuse the
operation even if we just want to read the current clock dialed
frequency, not modify anything (tx->modes == 0). That should be possible
even if the clock is free-running. For context, the kernel UAPI is the
same for getting and setting the frequency of a POSIX clock.

For example, ptp4l errors out at clock_create() -> clockadj_get_freq()
-> clock_adjtime() time, when it should logically only have failed on
actual adjustments to the clock, aka if the clock was configured as
slave. But in master mode it should work.

This was discovered when examining the issue described in the previous
commit, where ptp_clock_freerun() returned true despite n_vclocks being
zero.

Fixes: 73f37068d5 ("ptp: support ptp physical/virtual clocks conversion")
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Link: https://patch.msgid.link/20250613174749.406826-3-vladimir.oltean@nxp.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-06-27 11:07:39 +01:00
..
Kconfig
Makefile
ptp_chardev.c ptp: Properly handle compat ioctls 2025-02-21 13:49:28 +01:00
ptp_clock.c ptp: allow reading of currently dialed frequency to succeed on free-running clocks 2025-06-27 11:07:39 +01:00
ptp_clockmatrix.c
ptp_clockmatrix.h
ptp_dte.c
ptp_idt82p33.c
ptp_idt82p33.h
ptp_ines.c
ptp_kvm_arm.c
ptp_kvm_common.c
ptp_kvm_x86.c ptp: kvm: x86: Return EOPNOTSUPP instead of ENODEV from kvm_arch_ptp_init() 2024-12-19 18:08:53 +01:00
ptp_ocp.c ptp: ocp: fix start time alignment in ptp_ocp_signal_set 2025-04-25 10:43:51 +02:00
ptp_pch.c
ptp_private.h ptp: fix breakage after ptp_vclock_in_use() rework 2025-06-27 11:07:39 +01:00
ptp_qoriq_debugfs.c
ptp_qoriq.c
ptp_sysfs.c
ptp_vclock.c
ptp_vmw.c