Miroslav Lichvar
2013-01-17 17:31:40 UTC
The PPS time stamps are always made by the system clock, don't allow
running the PPS loop with other clocks.
Signed-off-by: Miroslav Lichvar <***@redhat.com>
---
phc2sys.8 | 3 ++-
phc2sys.c | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/phc2sys.8 b/phc2sys.8
index adce4ad..a5051c8 100644
--- a/phc2sys.8
+++ b/phc2sys.8
@@ -54,7 +54,8 @@ should be already close to the correct time before
.B phc2sys
is started or the
.B \-s
-option should be used too.
+option should be used too. This option can be used only with the system clock as
+the slave clock.
.TP
.BI \-s " phc-device"
Specify the master clock by device (e.g. /dev/ptp0) or name (e.g. CLOCK_REALTIME
diff --git a/phc2sys.c b/phc2sys.c
index 1c0d8b2..988a3f0 100644
--- a/phc2sys.c
+++ b/phc2sys.c
@@ -378,7 +378,8 @@ int main(int argc, char *argv[])
src = clock_open(phc_device);
}
if (!(device || src != CLOCK_INVALID) ||
- dst_clock.clkid == CLOCK_INVALID) {
+ dst_clock.clkid == CLOCK_INVALID ||
+ (device && dst_clock.clkid != CLOCK_REALTIME)) {
usage(progname);
return -1;
}
running the PPS loop with other clocks.
Signed-off-by: Miroslav Lichvar <***@redhat.com>
---
phc2sys.8 | 3 ++-
phc2sys.c | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/phc2sys.8 b/phc2sys.8
index adce4ad..a5051c8 100644
--- a/phc2sys.8
+++ b/phc2sys.8
@@ -54,7 +54,8 @@ should be already close to the correct time before
.B phc2sys
is started or the
.B \-s
-option should be used too.
+option should be used too. This option can be used only with the system clock as
+the slave clock.
.TP
.BI \-s " phc-device"
Specify the master clock by device (e.g. /dev/ptp0) or name (e.g. CLOCK_REALTIME
diff --git a/phc2sys.c b/phc2sys.c
index 1c0d8b2..988a3f0 100644
--- a/phc2sys.c
+++ b/phc2sys.c
@@ -378,7 +378,8 @@ int main(int argc, char *argv[])
src = clock_open(phc_device);
}
if (!(device || src != CLOCK_INVALID) ||
- dst_clock.clkid == CLOCK_INVALID) {
+ dst_clock.clkid == CLOCK_INVALID ||
+ (device && dst_clock.clkid != CLOCK_REALTIME)) {
usage(progname);
return -1;
}
--
1.7.11.7
1.7.11.7