On Wed, Jul 13, 2022 at 10:30:56AM +0000, Osterried Markus (ETAS-DAP/XPC-Fe3)
via Linuxptp-users wrote:
> This is an extract of the messages when ptp4l starts, then link goes down and
> link goes up again:
> ptp4l[10842.853]: selected /dev/ptp2 as PTP clock
> ptp4l[10842.854]: port 1 (swp0): /dev/ptp2 is virtual clock
> ptp4l[10864.838]: port 1 (swp0): link down
> ptp4l[10878.197]: port 1 (swp0): link up
> ptp4l[10878.202]: Switching PHC, failed to open /dev/ptp1: Device or resource
> busy
>
> It seems when link goes up ptp4l wants to switch from requested /dev/ptp2 to
> physical clock /dev/ptp1, which fails.
> Why does ptp4l switch the PHC when link is changed?
It's a bug.
Can you please try it with this patch?
--- a/port.c
+++ b/port.c
@@ -2708,7 +2708,8 @@ void port_link_status(void *ctx, int linkup, int ts_index)
/* Only switch phc with HW time stamping mode */
if (interface_tsinfo_valid(p->iface) &&
- interface_phc_index(p->iface) >= 0) {
+ interface_phc_index(p->iface) >= 0 &&
+ interface_get_vclock(p->iface) < 0) {
required_modes = clock_required_modes(p->clock);
if (!interface_tsmodes_supported(p->iface,
required_modes)) {
pr_err("interface '%s' does not support
requested "
--
Miroslav Lichvar
_______________________________________________
Linuxptp-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linuxptp-users