Ivan Oleynikov
2016-07-01 10:43:11 UTC
Some network interfaces do not specify PTP clock id that provides interface to
their hardware clock. In this case the interface driver returns -1 in
`ethtool_ts_info` to SIOCETHTOOL. This commit makes linuxptp ignore it instead
of failing with error "PHC device mismatch".
Signed-off-by: Ivan Oleynikov <***@metrotek.spb.ru>
---
port.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/port.c b/port.c
index 161157c..29b2468 100644
--- a/port.c
+++ b/port.c
@@ -2550,7 +2550,8 @@ struct port *port_open(int phc_index,
; /* UDS cannot have a PHC. */
else if (!interface->ts_info.valid)
pr_warning("port %d: get_ts_info not supported", number);
- else if (phc_index >= 0 && phc_index != interface->ts_info.phc_index) {
+ else if (phc_index >= 0 && phc_index != interface->ts_info.phc_index &&
+ interface->ts_info.phc_index >= 0) {
if (p->jbod) {
pr_warning("port %d: just a bunch of devices", number);
p->phc_index = interface->ts_info.phc_index;
their hardware clock. In this case the interface driver returns -1 in
`ethtool_ts_info` to SIOCETHTOOL. This commit makes linuxptp ignore it instead
of failing with error "PHC device mismatch".
Signed-off-by: Ivan Oleynikov <***@metrotek.spb.ru>
---
port.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/port.c b/port.c
index 161157c..29b2468 100644
--- a/port.c
+++ b/port.c
@@ -2550,7 +2550,8 @@ struct port *port_open(int phc_index,
; /* UDS cannot have a PHC. */
else if (!interface->ts_info.valid)
pr_warning("port %d: get_ts_info not supported", number);
- else if (phc_index >= 0 && phc_index != interface->ts_info.phc_index) {
+ else if (phc_index >= 0 && phc_index != interface->ts_info.phc_index &&
+ interface->ts_info.phc_index >= 0) {
if (p->jbod) {
pr_warning("port %d: just a bunch of devices", number);
p->phc_index = interface->ts_info.phc_index;
--
2.1.4
--
Ivan Oleynikov
STC Metrotek
St.Petersburg
2.1.4
--
Ivan Oleynikov
STC Metrotek
St.Petersburg