[Linuxptp-devel] [PATCH 4/6] Add definitions for PTP pin ioctls for backwards kernel compatibility.

2020-03-06 Thread Richard Cochran
for the ancillary PTP Hardware Clock functionality. The original ioctls failed to enforce the various flags and reversed fields, but the second version has fixed the issues. Going forward, our user space PTP stack ought to use the newer ioctls (if available) from day one. Signed-off-by: Richard Cochran

Re: [Linuxptp-devel] [RFC V2] Add IEEE 802.1AS-2011 time-aware bridge support

2020-03-06 Thread Richard Cochran
On Wed, Feb 19, 2020 at 01:52:28AM +, Y.b. Lu wrote: > May I know your opinion on time-aware bridge support? I would like to see someone carefully review them. I'm especially interested in having the new code conform to the new standard (which I haven't read yet). Could you possibly arrange

Re: [Linuxptp-devel] [PATCH 5/6] Add PHC methods for querying and configuring the pin functionality.

2020-03-09 Thread Richard Cochran
On Mon, Mar 09, 2020 at 11:55:05AM +0100, Jiri Benc wrote: > On Fri, 6 Mar 2020 11:23:00 -0800, Richard Cochran wrote: > > +int phc_number_pins(clockid_t clkid) > > +{ > > + struct ptp_clock_caps caps; > > + > > + if (phc_get_caps(clkid, )) { > > +

Re: [Linuxptp-devel] PPS generation on BeagleBoneBlack

2020-03-09 Thread Richard Cochran
On Mon, Mar 09, 2020 at 06:30:24PM +0530, Lokesh Vutla wrote: > So the solution proposed to generate PPS is: > - Configure DMTIMER in PWM mode with 1 second period. > - Enable HW_TS_PUSH support in CPTS driver. > - Synchronize the PWM period to PTP using the timestamps such that the rising > edge

Re: [Linuxptp-devel] PPS generation on BeagleBoneBlack

2020-03-10 Thread Richard Cochran
On Tue, Mar 10, 2020 at 01:17:40PM +0530, Lokesh Vutla wrote: > Timer resolution is entirely dependent on the input clock frequency. 30us > resolution is true only if the input clock frequency of DMTIMER is 32KHz. > AM335x[0] and later TI SoCs provide the following 3 options as the input > clocks

[Linuxptp-devel] [PATCH V2 1/6] clock: Safely remove event subscribers from list.

2020-03-11 Thread Richard Cochran
Signed-off-by: Richard Cochran Reported-by: Michael Walle --- clock.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/clock.c b/clock.c index 1668383..6f9cc21 100644 --- a/clock.c +++ b/clock.c @@ -145,9 +145,9 @@ static void remove_subscriber(struct clock_subscriber *

[Linuxptp-devel] [PATCH V2 2/6] Remove the unfinished SNMP code.

2020-03-11 Thread Richard Cochran
of the features. Signed-off-by: Richard Cochran --- makefile| 14 snmp4lptp.8 | 119 -- snmp4lptp.c | 192 snmp4lptp_mib.h | 30 snmpflg.sh | 42 --- 5 files changed, 397

[Linuxptp-devel] [PATCH V2 6/6] Provide a method to convert a tmv_t into a timespec.

2020-03-11 Thread Richard Cochran
Currently there is a method to convert a timespec into a tmv_t, but not the other way round. This patch adds the missing function in anticipation of a new feature that will need this conversion. Signed-off-by: Richard Cochran --- tmv.h | 10 ++ 1 file changed, 10 insertions(+) diff

[Linuxptp-devel] [PATCH V2 3/6] Balance the posix clock open function with a close method.

2020-03-11 Thread Richard Cochran
. Signed-off-by: Richard Cochran --- phc2sys.c | 2 +- phc_ctl.c | 1 + util.c| 8 util.h| 6 ++ 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/phc2sys.c b/phc2sys.c index c0b7b3d..64bdf26 100644 --- a/phc2sys.c +++ b/phc2sys.c @@ -341,7 +341,7 @@ static void

[Linuxptp-devel] [PATCH V2 4/6] Add definitions for PTP pin ioctls for backwards kernel compatibility.

2020-03-11 Thread Richard Cochran
for the ancillary PTP Hardware Clock functionality. The original ioctls failed to enforce the various flags and reversed fields, but the second version has fixed the issues. Going forward, our user space PTP stack ought to use the newer ioctls (if available) from day one. Signed-off-by: Richard Cochran

[Linuxptp-devel] [PATCH V2 0/6] Clean up in preparation for GrandMaster support.

2020-03-11 Thread Richard Cochran
. Richard Cochran (6): clock: Safely remove event subscribers from list. Remove the unfinished SNMP code. Balance the posix clock open function with a close method. Add definitions for PTP pin ioctls for backwards kernel compatibility. Add PHC methods for querying and configuring the pin

[Linuxptp-devel] [PATCH V2 5/6] Add PHC methods for querying and configuring the pin functionality.

2020-03-11 Thread Richard Cochran
In anticipation of support for external time stamping in PHC devices, this patch adds wrapper functions around the pin functionality. Signed-off-by: Richard Cochran --- phc.c | 23 +-- phc.h | 21 + 2 files changed, 42 insertions(+), 2 deletions(-) diff

Re: [Linuxptp-devel] [RFC V2] Add IEEE 802.1AS-2011 time-aware bridge support

2020-04-17 Thread Richard Cochran
On Fri, Apr 17, 2020 at 03:32:09PM +0200, Kamil Alkhouri wrote: > Additionally, I would like to raise the same discussion started earlier > by Michael. Some hardware already supports two PTP clocks, one can be > free running and used to transport 802.1AS synchronization while the > other is a

Re: [Linuxptp-devel] Adding libpmc

2020-04-16 Thread Richard Cochran
On Thu, Apr 16, 2020 at 02:18:25PM +, Geva, Erez wrote: > I see that linux PTP is under GPL 2. > > I would like to ask your permission to allow using a libpmc library and > headers needed by it under LGPL 2. As one of the copyright holders, I do not agree to any change of license. Thanks,

Re: [Linuxptp-devel] Adding libpmc

2020-04-16 Thread Richard Cochran
On Thu, Apr 16, 2020 at 05:06:46PM +, Geva, Erez wrote: > Do you have another suggestion? >From a technical POV, I think that the pmc_common.c file does not provide you very much at all. It does not, IMHO, rise to the level of substance for a real shared library. So the very idea of libpmc

[Linuxptp-devel] [PATCH 2/5] pmc: Move private macros back into their source files.

2020-04-03 Thread Richard Cochran
The header file, pmc_common.h, makes some private macros public. The intent was to use those macros in SNMP code, but that development never materialized into production code. This patch removes the private macros from public view. Signed-off-by: Richard Cochran --- pmc.c| 1

[Linuxptp-devel] [PATCH 5/5] pmc: Allow multiple local subscribers.

2020-04-03 Thread Richard Cochran
notifications at the same time, for example. This patch sets the PortIdentity.portNumber attribute of UDS clients to the local process ID, making each such client subscription unique. Signed-off-by: Richard Cochran --- pmc_common.c | 19 --- 1 file changed, 12 insertions(+), 7

[Linuxptp-devel] [PATCH 1/5] clock: Reply with correct payload length for SUBSCRIBE_EVENTS_NP queries.

2020-04-03 Thread Richard Cochran
. Signed-off-by: Richard Cochran --- clock.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clock.c b/clock.c index 6f9cc21..b928f56 100644 --- a/clock.c +++ b/clock.c @@ -442,6 +442,7 @@ static int clock_management_fill_response(struct clock *c, struct port *p

[Linuxptp-devel] [PATCH 3/5] pmc: Allow printing of the SUBSCRIBE_EVENTS_NP tlv.

2020-04-03 Thread Richard Cochran
While we are at it, reformat the pmc_show() function into reverse Christmas tree order. Signed-off-by: Richard Cochran --- pmc.c | 32 +--- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/pmc.c b/pmc.c index e3cd6f3..f074621 100644 --- a/pmc.c +++ b

[Linuxptp-devel] [PATCH 0/5] Push notification support for pmc

2020-04-03 Thread Richard Cochran
logAnnounceInterval 1 announceReceiptTimeout 3 logSyncInterval 0 delayMechanism 1 logMinPdelayReqInterval 0 versionNumber 2 ... Richard Cochran (5): clock: Reply with correct payload

[Linuxptp-devel] [PATCH 4/5] pmc: Subscribe to port state push notification events when requested.

2020-04-03 Thread Richard Cochran
Allow interactive input like set SUBSCRIBE_EVENTS_NP duration 60 NOTIFY_PORT_STATE on to request push notifications from the ptp4l service. Signed-off-by: Richard Cochran --- pmc_common.c | 25 ++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git

Re: [Linuxptp-devel] [RFC PATCH 0/3] Introduce an utility to sync pwm with PTP clock

2020-04-30 Thread Richard Cochran
On Wed, Apr 29, 2020 at 04:42:55PM +0530, Lokesh Vutla wrote: > Ping on this series. Any comments are much appreciated. I wanted to try it out, first. I was waiting until the kernel side hit net-next. What is the status there? Thanks, Richard ___

Re: [Linuxptp-devel] [RFC PATCH 3/3] phc2pwm: Introduce an utility to sync pwm with PTP clock

2020-04-30 Thread Richard Cochran
On Fri, Apr 17, 2020 at 10:00:09AM +0530, Lokesh Vutla wrote: > - I could not fit pwm servo within existing servo implementations. Let > me know if you have any idea to do it. Why not just use the exising PI servo? > +static void usage(char *progname) > +{ > + fprintf(stderr, > +

[Linuxptp-devel] [PATCH V1 RFC 2/5] ts2phc: Support using a PHC as the master clock.

2020-05-01 Thread Richard Cochran
vices" together forms a Transparent Clock. If the master clock is synchronized to a global time source (like a PPS from a GPS), then the system becomes a mutli-port Grand Master or a Boundary Clock with GM capability. Signed-off-by: Richard Cochran --- configs/ts2phc-TC.cfg | 27 ++

[Linuxptp-devel] [PATCH V1 RFC 5/5] Add documentation for the ts2phc program.

2020-05-01 Thread Richard Cochran
Signed-off-by: Richard Cochran --- ts2phc.8 | 217 +++ 1 file changed, 217 insertions(+) create mode 100644 ts2phc.8 diff --git a/ts2phc.8 b/ts2phc.8 new file mode 100644 index 000..07a4026 --- /dev/null +++ b/ts2phc.8 @@ -0,0 +1,217

[Linuxptp-devel] [PATCH V1 RFC 1/5] Introduce the ts2phc program.

2020-05-01 Thread Richard Cochran
s and time or date information. The generic master assumes that the Linux system time is approximately correct (by NTP or RTC for example) in order to calculate the time of the incoming PPS edges. Signed-off-by: Richard Cochran Signed-off-by: Balint Ferencz --- .gitignore | 1 +

[Linuxptp-devel] [PATCH V1 RFC 3/5] Introduce a leap second table.

2020-05-01 Thread Richard Cochran
, this patch introduces a leap second table based on the information published by the IETF and NIST. The hard coded default table can be updated at run time by reading the standard leap seconds file from the commonly used tzdata package. Signed-off-by: Richard Cochran --- lstab.c | 206

[Linuxptp-devel] [PATCH V1 RFC 0/5] GPS based Grand Master Support

2020-05-01 Thread Richard Cochran
is already quite usable. Richard Cochran (5): Introduce the ts2phc program. ts2phc: Support using a PHC as the master clock. Introduce a leap second table. ts2phc: Support using a GPS radio as the master clock. Add documentation for the ts2phc program. .gitignore | 1

[Linuxptp-devel] [PATCH V1 RFC 4/5] ts2phc: Support using a GPS radio as the master clock.

2020-05-01 Thread Richard Cochran
s sentence provides adequate time of day for determining the time of the PPS edge. Signed-off-by: Richard Cochran --- config.c | 3 + makefile | 6 +- nmea.c | 202 ++ nmea.h | 44 + serial.c

Re: [Linuxptp-devel] [RFC PATCH v2 2/3] pwm: Add helper apis to control pwm

2020-05-16 Thread Richard Cochran
On Sat, May 16, 2020 at 11:53:57PM +0530, Lokesh Vutla wrote: > +#define PWM_CHAN_EXPORT "/sys/class/pwm/pwmchip%d/export" > +#define PWM_CHAN_ENABLE "/sys/class/pwm/pwmchip%d/pwm%d/enable" > +#define PWM_CHAN_PERIOD "/sys/class/pwm/pwmchip%d/pwm%d/period"

Re: [Linuxptp-devel] [RFC PATCH v2 3/3] phc2pwm: Introduce an utility to sync pwm with PTP clock

2020-05-16 Thread Richard Cochran
On Sat, May 16, 2020 at 11:53:58PM +0530, Lokesh Vutla wrote: > diff --git a/makefile b/makefile > index a965bd4..094c062 100644 > --- a/makefile > +++ b/makefile > @@ -22,7 +22,7 @@ CC = $(CROSS_COMPILE)gcc > VER = -DVER=$(version) > CFLAGS = -Wall $(VER) $(incdefs) $(DEBUG)

Re: [Linuxptp-devel] [RFC PATCH 3/3] phc2pwm: Introduce an utility to sync pwm with PTP clock

2020-05-16 Thread Richard Cochran
On Sat, May 16, 2020 at 10:35:33PM +0530, Lokesh Vutla wrote: > Hi Richard, > > On 16/05/20 10:24 PM, Richard Cochran wrote: > > On Fri, Apr 17, 2020 at 10:00:09AM +0530, Lokesh Vutla wrote: > >> phc2pwm.c | 233 ++ &g

Re: [Linuxptp-devel] [RFC PATCH 0/3] Introduce an utility to sync pwm with PTP clock

2020-05-16 Thread Richard Cochran
On Fri, Apr 17, 2020 at 10:00:06AM +0530, Lokesh Vutla wrote: > Following dependencies are needed in kernel for testing: > - Grygorii's series to support HW_TS_PUSH[2] > - Add pwm node in BBB DT. > All dependencies are available at[3]. > [3] https://github.com/lokeshvutla/linux.git

Re: [Linuxptp-devel] [RFC PATCH v2 3/3] phc2pwm: Introduce an utility to sync pwm with PTP clock

2020-05-16 Thread Richard Cochran
On Sat, May 16, 2020 at 01:42:51PM -0700, Richard Cochran wrote: > > + clkid = phc_open(ptp_dev); > > + if (clkid == CLOCK_INVALID) > > + return -1; Also, printing a error message in this case would be helpful to the user

Re: [Linuxptp-devel] [RFC PATCH v2 3/3] phc2pwm: Introduce an utility to sync pwm with PTP clock

2020-05-16 Thread Richard Cochran
On Sat, May 16, 2020 at 11:53:58PM +0530, Lokesh Vutla wrote: > +int main(int argc, char *argv[]) > +{ > + unsigned int pwm_chip = 0, pwm_chan = 0, event_index = 0; > + int c, err, level = LOG_INFO; > + char *progname, *ptp_dev; > + struct pwm_chan *chan; > + struct pwm_servo

Re: [Linuxptp-devel] [RFC PATCH v2 3/3] phc2pwm: Introduce an utility to sync pwm with PTP clock

2020-05-16 Thread Richard Cochran
On Sat, May 16, 2020 at 11:53:58PM +0530, Lokesh Vutla wrote: > + while (is_running()) { > + if (phc_read_extts(clkid, )) > + continue; > + > + fprintf(stdout, "Timestamp = %lld.%09lld\n", ts / NS_PER_SEC, > + ts % NS_PER_SEC);

Re: [Linuxptp-devel] [RFC PATCH 0/3] Introduce an utility to sync pwm with PTP clock

2020-05-05 Thread Richard Cochran
On Tue, May 05, 2020 at 10:48:40AM +0530, Lokesh Vutla wrote: > Yes, cpts patches are available in next[0]. When trying out please make sure > BBB > dts has pwm timer added as I mentioned previously in cover letter. This is not > posted as this has to be an overlay and the overlay story is not

[Linuxptp-devel] [PATCH V1 1/2] Decouple servo state from automotive profile.

2020-05-16 Thread Richard Cochran
ing write phase mode feature would like to take advantage of the SERVO_LOCKED_STABLE state to trigger its activation. This patch introduces a proper configuration option to enable transmission of the message interval request that is specific to the Automotive Profile. Signed-off-by: Vincent Cheng Si

[Linuxptp-devel] [PATCH V1 2/2] Add support for write phase mode.

2020-05-16 Thread Richard Cochran
pi write_phase_mode1 servo_offset_threshold 50 servo_num_offset_values 10 tsproc_mode raw Signed-off-by: Vincent Cheng Signed-off-by: Richard Cochran --- clock.c | 60 +++-- clockadj.c

[Linuxptp-devel] [PATCH V1 1/3] Implement the synchronization uncertain flag.

2020-05-16 Thread Richard Cochran
al process. This patch adds background support for handling the flag. Signed-off-by: Richard Cochran --- clock.c | 50 ++ clock.h | 4 ++-- msg.h | 1 + port.c | 12 ++-- tlv.h | 6 ++ 5 files changed, 61 insertions(+), 12 deletion

[Linuxptp-devel] [PATCH V1 3/3] Let the free running port state reflect the synchronization uncertain flag.

2020-05-16 Thread Richard Cochran
ain" management message. This patch lets the port state transitions from UNCALIBRATED to SLAVE based on that message. Signed-off-by: Richard Cochran --- clock.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/clock.c b/clock.c index 11082fe..a559cd4 100644

[Linuxptp-devel] [PATCH V1 2/3] pmc: Support getting and setting the local synchronization uncertain flag.

2020-05-16 Thread Richard Cochran
Signed-off-by: Richard Cochran --- pmc.c| 5 + pmc_common.c | 22 ++ 2 files changed, 27 insertions(+) diff --git a/pmc.c b/pmc.c index f074621..490c140 100644 --- a/pmc.c +++ b/pmc.c @@ -305,6 +305,11 @@ static void pmc_show(struct ptp_message *msg, FILE *fp

[Linuxptp-devel] [PATCH 09/11] port: Export the value of the wildcard port identity.

2020-05-16 Thread Richard Cochran
Code in other modules will need this special port ID value. This patch makes it available through the port header file. Signed-off-by: Richard Cochran --- port.h | 3 +++ port_signaling.c | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/port.h b/port.h index

[Linuxptp-devel] [PATCH 04/11] uds: Convey transmit path errors to the caller.

2020-05-16 Thread Richard Cochran
of the error message, leaving that task up to caller, just like the other transport modules. Signed-off-by: Richard Cochran --- uds.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/uds.c b/uds.c index a4c856b..641a672 100644 --- a/uds.c +++ b/uds.c @@ -119,8 +119,8 @@ static int

[Linuxptp-devel] [PATCH 07/11] port: Convey targeted forwarding errors to the caller.

2020-05-16 Thread Richard Cochran
The port_forward_to() method clobbers the specific error code returned by the transport layer with -1. This patch lets the code preserve the specific error in question. Signed-off-by: Richard Cochran --- port.c | 6 -- port.h | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff

[Linuxptp-devel] [PATCH 03/11] udp6: Convey transmit path errors to the caller.

2020-05-16 Thread Richard Cochran
The transport layer's functional interface foresees having error codes percolate back up to the caller. However, up until now, the udp6 module simply returned -1 for any error. This patch lets the code return the specific error instead. Signed-off-by: Richard Cochran --- udp6.c | 2 +- 1 file

[Linuxptp-devel] [PATCH 00/11] Background work for slave event monitoring.

2020-05-16 Thread Richard Cochran
The IEEE 1588v2.1 standard introduces a new optional feature called slave event monitoring. While implementing that, I found a number of small issues that wanted cleaning up. This series presents patches addressing them. Richard Cochran (11): transport: Correct grammar in the doxygen comments

[Linuxptp-devel] [PATCH 01/11] transport: Correct grammar in the doxygen comments.

2020-05-16 Thread Richard Cochran
Signed-off-by: Richard Cochran --- transport.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/transport.h b/transport.h index 5b8c413..7a7f87b 100644 --- a/transport.h +++ b/transport.h @@ -70,7 +70,7 @@ int transport_recv(struct transport *t, int fd, struct

[Linuxptp-devel] [PATCH 02/11] udp: Convey transmit path errors to the caller.

2020-05-16 Thread Richard Cochran
The transport layer's functional interface foresees having error codes percolate back up to the caller. However, up until now, the udp module simply returned -1 for any error. This patch lets the code return the specific error instead. Signed-off-by: Richard Cochran --- udp.c | 2 +- 1 file

[Linuxptp-devel] [PATCH 11/11] Reject path trace TLVs with excessive elements.

2020-05-16 Thread Richard Cochran
such malformed messages, this patch changes the logic to reject them. Signed-off-by: Richard Cochran --- tlv.c | 22 -- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/tlv.c b/tlv.c index 2440482..6ab54a5 100644 --- a/tlv.c +++ b/tlv.c @@ -18,6 +18,7

[Linuxptp-devel] [PATCH 06/11] sk: Convey transmit path errors to the caller.

2020-05-16 Thread Richard Cochran
The transport layer's functional interface foresees having error codes percolate back up to the caller. However, up until now, the sk module simply returned -1 for any error. This patch lets the code return the specific error instead. Signed-off-by: Richard Cochran --- sk.c | 14

[Linuxptp-devel] [PATCH 05/11] raw: Convey transmit path errors to the caller.

2020-05-16 Thread Richard Cochran
of the error message, leaving that task up to caller, just like the other transport modules. Signed-off-by: Richard Cochran --- raw.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/raw.c b/raw.c index 81ec431..15c9756 100644 --- a/raw.c +++ b/raw.c @@ -336,8 +336,7 @@ static int

[Linuxptp-devel] [PATCH 10/11] port: Publish the method for creating signaling messages.

2020-05-16 Thread Richard Cochran
Signed-off-by: Richard Cochran --- port.h | 3 +++ port_signaling.c | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/port.h b/port.h index 80c543e..0b07d55 100644 --- a/port.h +++ b/port.h @@ -210,6 +210,9 @@ struct port *port_open(const char *phc_device

[Linuxptp-devel] [PATCH 08/11] util: Mark port identity comparisons as const.

2020-05-16 Thread Richard Cochran
The utility function to compare port IDs takes pointers, but it only needs to read the referenced data. This patch marks the parameters as const, allowing passing constants in the future. Signed-off-by: Richard Cochran --- util.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff

Re: [Linuxptp-devel] [PATCH 04/11] uds: Convey transmit path errors to the caller.

2020-05-18 Thread Richard Cochran
On Mon, May 18, 2020 at 04:17:34PM -0700, Jacob Keller wrote: > > @@ -119,8 +119,8 @@ static int uds_send(struct transport *t, struct fdarray > > *fda, > > addr = >address; > > > > cnt = sendto(fd, buf, buflen, 0, >sa, addr->len); > > - if (cnt <= 0 && errno != ECONNREFUSED) {

Re: [Linuxptp-devel] [PATCH V1 1/2] Decouple servo state from automotive profile.

2020-05-18 Thread Richard Cochran
On Mon, May 18, 2020 at 04:12:52PM -0700, Jacob Keller wrote: > > +.B msg_interval_request > > +This will enable sending message interval request when servo transitions > > to > > +SERVO_LOCKED_STABLE state. If msg_interval_request is set, entry into > > +SERVO_LOCKED_STABLE state triggers the

Re: [Linuxptp-devel] PPS generation on BeagleBoneBlack

2020-03-20 Thread Richard Cochran
On Mon, Mar 16, 2020 at 10:58:30PM +0200, Grygorii Strashko wrote: > The above solution adds PPS generation using PTP_EXTTS events and PIN output, > but, as per my understanding, there are no way now to feed phc2sys with such > PPS. > So question is how PPS generated by PTP_EXTTS events can be

Re: [Linuxptp-devel] [RFC V2] Add IEEE 802.1AS-2011 time-aware bridge support

2020-03-20 Thread Richard Cochran
On Tue, Mar 17, 2020 at 04:41:14PM +, Rodney Cummings wrote: > Recommendation: Keep to 802.1AS-2011 bridge for the upcoming patches. Okay. > Recommendation: After 802.1AS-2011 bridge is in the Linuxptp master, NI runs > the UNH-IOL Conformance bridge tests, and submits category A) and B)

[Linuxptp-devel] [PATCH V3 0/6] Clean up in preparation for GrandMaster support.

2020-03-21 Thread Richard Cochran
. Changes in V3 ~ - use compat_ptp_clock_caps per Jacob's review - pick up Jacob's review tags Changes in V2 ~ - introduce an out-of-tree 'struct ptp_clock_caps' in missing.h Richard Cochran (6): clock: Safely remove event subscribers from list. Remove the unfinished

[Linuxptp-devel] [PATCH V3 2/6] Remove the unfinished SNMP code.

2020-03-21 Thread Richard Cochran
of the features. Signed-off-by: Richard Cochran Reviewed-by: Jacob Keller --- makefile| 14 snmp4lptp.8 | 119 -- snmp4lptp.c | 192 snmp4lptp_mib.h | 30 snmpflg.sh | 42

[Linuxptp-devel] [PATCH V3 1/6] clock: Safely remove event subscribers from list.

2020-03-21 Thread Richard Cochran
Signed-off-by: Richard Cochran Reported-by: Michael Walle Reviewed-by: Jacob Keller --- clock.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/clock.c b/clock.c index 1668383..6f9cc21 100644 --- a/clock.c +++ b/clock.c @@ -145,9 +145,9 @@ static void remove_subscri

[Linuxptp-devel] [PATCH V3 6/6] Provide a method to convert a tmv_t into a timespec.

2020-03-21 Thread Richard Cochran
Currently there is a method to convert a timespec into a tmv_t, but not the other way round. This patch adds the missing function in anticipation of a new feature that will need this conversion. Signed-off-by: Richard Cochran --- tmv.h | 10 ++ 1 file changed, 10 insertions(+) diff

[Linuxptp-devel] [PATCH V3 5/6] Add PHC methods for querying and configuring the pin functionality.

2020-03-21 Thread Richard Cochran
In anticipation of support for external time stamping in PHC devices, this patch adds wrapper functions around the pin functionality. Signed-off-by: Richard Cochran --- phc.c | 23 +-- phc.h | 21 + 2 files changed, 42 insertions(+), 2 deletions(-) diff

[Linuxptp-devel] [PATCH V3 4/6] Add definitions for PTP pin ioctls for backwards kernel compatibility.

2020-03-21 Thread Richard Cochran
for the ancillary PTP Hardware Clock functionality. The original ioctls failed to enforce the various flags and reversed fields, but the second version has fixed the issues. Going forward, our user space PTP stack ought to use the newer ioctls (if available) from day one. Signed-off-by: Richard Cochran

[Linuxptp-devel] [PATCH V3 3/6] Balance the posix clock open function with a close method.

2020-03-21 Thread Richard Cochran
. Signed-off-by: Richard Cochran --- phc2sys.c | 2 +- phc_ctl.c | 1 + util.c| 8 util.h| 6 ++ 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/phc2sys.c b/phc2sys.c index c0b7b3d..64bdf26 100644 --- a/phc2sys.c +++ b/phc2sys.c @@ -341,7 +341,7 @@ static void

Re: [Linuxptp-devel] [PATCH V2 4/6] Add definitions for PTP pin ioctls for backwards kernel compatibility.

2020-03-21 Thread Richard Cochran
On Wed, Mar 11, 2020 at 03:40:42PM -0700, Jacob Keller wrote: > I'm used to seeing this done like > > #ifndef PTP_PIN_SETFUNC > > struct compat_ptp_clock_caps { > } > > #define ptp_clock_caps compat_ptp_clock_caps > > #endif > > so that the other code doesn't need to change, as the

Re: [Linuxptp-devel] [RFC PATCH v2 2/3] pwm: Add helper apis to control pwm

2020-05-19 Thread Richard Cochran
On Tue, May 19, 2020 at 11:41:45AM +, Geva, Erez wrote: > From a quick look. > It seems that it is 'pwmchip%d' for a long time. > > https://elixir.bootlin.com/linux/v4.0/source/drivers/pwm/sysfs.c#L314 Looks like my v4.19.25-rt16 kernel has a bad commit with a regression. The documentation,

Re: [Linuxptp-devel] [RFC PATCH 3/3] phc2pwm: Introduce an utility to sync pwm with PTP clock

2020-05-19 Thread Richard Cochran
On Mon, May 18, 2020 at 04:26:33PM -0700, Jacob Keller wrote: > Yep, the current code doing that is incorrect if the platform can't do > unaligned access. But only if the pointer is actually not aligned. The way the buffers are allocated and the message definitions ensure proper alignment. In a

Re: [Linuxptp-devel] [RFC PATCH 0/3] Introduce an utility to sync pwm with PTP clock

2020-05-19 Thread Richard Cochran
On Tue, May 19, 2020 at 10:14:00PM +0530, Lokesh Vutla wrote: > Any luck with the setup? I'll try it as soon as it can... Thanks, Richard ___ Linuxptp-devel mailing list Linuxptp-devel@lists.sourceforge.net

Re: [Linuxptp-devel] [RFC PATCH v2 14/14] ts2phc_phc_master: make use of new kernel API for perout waveform

2020-08-29 Thread Richard Cochran
On Sun, Aug 30, 2020 at 12:21:49AM +0300, Vladimir Oltean wrote: > A potentially relevant question to be asked is if we're ok with the lack > of backwards compatibility here. The program ought to still work with the older interface. > The program used to be a passive observer of

Re: [Linuxptp-devel] [RFC PATCH 00/15] Dynamic sync direction for ts2phc

2020-08-17 Thread Richard Cochran
On Mon, Aug 17, 2020 at 11:28:34PM +0300, Vladimir Oltean wrote: > Do I need to fix up the patches now, or are you still going to review > them? I'll go forward, reviewing the patches as is... Thanks, Richard ___ Linuxptp-devel mailing list

Re: [Linuxptp-devel] [RFC PATCH 00/15] Dynamic sync direction for ts2phc

2020-08-17 Thread Richard Cochran
Vladimir, On Tue, Aug 04, 2020 at 02:40:11PM +0300, Vladimir Oltean wrote: > The diff is large, yes, even though I tried to avoid making unnecessary > changes. I hope it isn't too difficult to review, it isn't as polished > as I typically like, because the idea itself was uncertain, so I >

[Linuxptp-devel] [PATCH RFC 1/1] Convert usage messages to time source/sink terminology.

2020-08-18 Thread Richard Cochran
Signed-off-by: Richard Cochran --- phc2sys.c | 10 +- ptp4l.c | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/phc2sys.c b/phc2sys.c index 64bdf26..18d9a9c 100644 --- a/phc2sys.c +++ b/phc2sys.c @@ -1319,10 +1319,10 @@ static void usage(char *progname

[Linuxptp-devel] [PATCH RFC 0/1] Introduce inclusive terminology

2020-08-18 Thread Richard Cochran
at the man pages, and later on the identifiers in the program. With very few exceptions, none of the re-naming would impact any existing user configuration scripts. We will take care not to cause issues for the myriad deployments of this software world wide. Thanks, Richard Richard Cochran (1):

Re: [Linuxptp-devel] [PATCH RFC 0/1] Introduce inclusive terminology

2020-08-18 Thread Richard Cochran
On Tue, Aug 18, 2020 at 02:51:26PM -0700, Jacob Keller wrote: > Yep, makes sense. Long term, after changing the stuff which doesn't > impact config, we can work towards finding a way to deprecate and rename > config options in a way that won't break existing deployment. I'm > personally Ok with

Re: [Linuxptp-devel] [RFC PATCH v2 00/14] Dynamic sync direction for ts2phc

2020-08-29 Thread Richard Cochran
On Tue, Aug 18, 2020 at 02:19:26AM +0300, Vladimir Oltean wrote: > Changes in v2: > - Added Jacob's review tags, addressed some feedback. > - Dropped patch "pmc_common: fix potential memory leak in > run_pmc_events()" > - Reordered patches (put the tmv helpers first) > - Fixed memory leaks I

Re: [Linuxptp-devel] [RFC PATCH v2 06/14] ts2phc: create a private data structure

2020-08-29 Thread Richard Cochran
On Tue, Aug 18, 2020 at 02:19:32AM +0300, Vladimir Oltean wrote: > Eliminate the ad-hoc use of global variables in the ts2phc program by > introducing one data structure that incorporates them. This might make > the code more understandable to people coming from a kernel background, > since it

Re: [Linuxptp-devel] [RFC PATCH v2 05/14] phc2sys: break out pmc code into pmc_common.c

2020-08-29 Thread Richard Cochran
On Tue, Aug 18, 2020 at 02:19:31AM +0300, Vladimir Oltean wrote: > diff --git a/phc2sys.c b/phc2sys.c > index a36cbe071d7d..c4d72bd7d17a 100644 > --- a/phc2sys.c > +++ b/phc2sys.c > @@ -56,18 +56,13 @@ > #include "uds.h" > #include "util.h" > #include "version.h" > +#include "contain.h"

Re: [Linuxptp-devel] [RFC PATCH v2 07/14] ts2phc: instantiate a full clock structure for every slave PHC

2020-08-29 Thread Richard Cochran
On Tue, Aug 18, 2020 at 02:19:33AM +0300, Vladimir Oltean wrote: > Slaves in ts2phc are PHC devices that implement the extts kernel API. > They are slaves just in the sense that they timestamp a pulse emitted by > somebody else. > > Currently in ts2phc, PPS slaves are also the only candidates for

Re: [Linuxptp-devel] [RFC PATCH v2 14/14] ts2phc_phc_master: make use of new kernel API for perout waveform

2020-08-29 Thread Richard Cochran
On Tue, Aug 18, 2020 at 02:19:40AM +0300, Vladimir Oltean wrote: > This API was introduced for 2 reasons: > > 1. Some hardware can emit PPS signals but not starting from arbitrary >absolute times, but rather phase-aligned to the beginning of a >second. We _could_ patch ts2phc to always

Re: [Linuxptp-devel] [RFC PATCH v2 09/14] ts2phc: instantiate a pmc node

2020-08-29 Thread Richard Cochran
On Tue, Aug 18, 2020 at 02:19:35AM +0300, Vladimir Oltean wrote: > @@ -153,7 +352,7 @@ int main(int argc, char *argv[]) > /* Process the command line arguments. */ > progname = strrchr(argv[0], '/'); > progname = progname ? 1 + progname : argv[0]; > - while (EOF != (c =

Re: [Linuxptp-devel] [PATCH RFC 0/1] Introduce inclusive terminology

2020-08-19 Thread Richard Cochran
On Wed, Aug 19, 2020 at 03:06:22PM +, Geva, Erez wrote: > Personally I prefer leader/followers over source/sink. Let's think about those terms... If clock A is leading clock B, then clock A is running ahead. If clock A is following clock B, then clock A is running behind. Sounds rather

Re: [Linuxptp-devel] [PATCH RFC 0/1] Introduce inclusive terminology

2020-08-19 Thread Richard Cochran
On Wed, Aug 19, 2020 at 04:13:38PM +, Geva, Erez wrote: > I short. It means that they are follows the leader. Anyone who has ever been on a hiking trip or watched ducks in a pond knows that the leader goes in front and the followers behind, with each follower at different distance from the

Re: [Linuxptp-devel] [PATCH RFC 0/1] Introduce inclusive terminology

2020-08-19 Thread Richard Cochran
On Wed, Aug 19, 2020 at 11:37:15PM +0530, Jagmeet Singh Hanspal wrote: > Yes, each client is correcting itself to match to the the master and as a > continuous process of matching to the chosen one by following it like a > closed-loop dogfight. "closed-loop dogfight" -- love it! > Anyways,

Re: [Linuxptp-devel] [PATCH RFC 0/1] Introduce inclusive terminology

2020-08-20 Thread Richard Cochran
On Thu, Aug 20, 2020 at 04:02:30PM +0300, Vladimir Oltean wrote: > On Wed, Aug 19, 2020 at 09:42:40AM -0700, Richard Cochran wrote: > > > > In any case, this is just the kind of bikeshedding discussion that I > > want to avoid. > > But you are the one who asked for

Re: [Linuxptp-devel] [PATCH RFC 0/1] Introduce inclusive terminology

2020-08-20 Thread Richard Cochran
On Thu, Aug 20, 2020 at 06:45:37PM +0300, Vladimir Oltean wrote: > What I don't get is where is the need for linuxptp to "take the lead" on > this topic? see next answer... > What if the terms on which IEEE 1588 settles are not the terms in your > mind ("source"/"sink")? Because linuxptp is

Re: [Linuxptp-devel] [PATCH RFC 0/1] Introduce inclusive terminology

2020-08-20 Thread Richard Cochran
On Thu, Aug 20, 2020 at 07:50:29PM +0100, Richard Hill wrote: > I'm all a bit lost here. Perfectly understandable that the word 'Slave' > needs to be > dropped ASAP. > Waiting for the official committee might be like watching paint dry. Agreed. My plan is NOT to wait for the committee but

Re: [Linuxptp-devel] [PATCH v3 00/12] Dynamic sync direction for ts2phc

2020-09-30 Thread Richard Cochran
On Tue, Sep 29, 2020 at 01:46:37PM +0300, Vladimir Oltean wrote: > Should I resend these patches on top of your NMEA fixes, or can you > continue to review them as-is? I think the conflicts are small, but I'm on vacation right now, and so I'll complete the review in about two weeks. (The

[Linuxptp-devel] [PATCH 1/8] ts2phc: nmea: Correct UTC to TAI conversion.

2020-09-21 Thread Richard Cochran
The time value passed into the leap second lookup table should be in seconds, but the calling code in the nmea module passes nanoseconds instead. This patch fixes the issue by converting the time value accordingly. Signed-off-by: Richard Cochran --- lstab.h | 2

[Linuxptp-devel] [PATCH 7/8] ts2phc: nmea: Drop time of day readings older than five seconds.

2020-09-21 Thread Richard Cochran
record is available, probably some kind of error has occurred. This patch limits the age of the RMC record used for ToD to five seconds. Signed-off-by: Richard Cochran --- ts2phc_nmea_master.c | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/ts2phc_nmea_master.c b

[Linuxptp-devel] [PATCH 3/8] ts2phc: nmea: Simplify validity checking.

2020-09-21 Thread Richard Cochran
If there is no valid fix reported by the RMC message, then calculation of the PPS time stamp is pointless. This patch simplifies the logic by returning early in this case. Signed-off-by: Richard Cochran --- ts2phc_nmea_master.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff

[Linuxptp-devel] [PATCH 8/8] lstab: Bring expiration up to date.

2020-09-21 Thread Richard Cochran
Bring the built in leap second table up to date through IERS Bulletin C59. No new leap seconds have been scheduled for this year. Signed-off-by: Richard Cochran --- lstab.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lstab.c b/lstab.c index 5fede16..391a6b9 100644

[Linuxptp-devel] [PATCH 6/8] ts2phc: nmea: Update the leap seconds table on demand.

2020-09-21 Thread Richard Cochran
If a leap seconds file is configured, the software will read the file once on start up. However, that file is nominally valid for a maximum of six months. This patch adds a check on the modification time of the file and reloads the file if needed. Signed-off-by: Richard Cochran

[Linuxptp-devel] [PATCH 5/8] ts2phc: nmea: Clean up error path.

2020-09-21 Thread Richard Cochran
The error path does not clean up properly when allocations fail. This patch fixes the memory leaks on the error path. Signed-off-by: Richard Cochran --- ts2phc_nmea_master.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ts2phc_nmea_master.c b/ts2phc_nmea_master.c index 76fc7ae..5c17e5a

[Linuxptp-devel] [PATCH 2/8] ts2phc: nmea: Add error messages for leap second lookup failures.

2020-09-21 Thread Richard Cochran
If a leap second lookup fails, the likely reason is that the table is out of date. After all, the leap second table has an expiration date. The user will surely appreciate if the software complains loudly in this case. Signed-off-by: Richard Cochran --- ts2phc_nmea_master.c | 4 1 file

[Linuxptp-devel] [PATCH 0/8] Fix NMEA train wreck

2020-09-21 Thread Richard Cochran
The NMEA mode of the ts2phc program is broken and cannot work correctly. This series fixes the damage and also completes a couple of outstanding todos. Richard Cochran (8): ts2phc: nmea: Correct UTC to TAI conversion. ts2phc: nmea: Add error messages for leap second lookup failures. ts2phc

[Linuxptp-devel] [PATCH 4/8] ts2phc: nmea: Add a configuration option for the current leap seconds file.

2020-09-21 Thread Richard Cochran
the GPS network, and that is far too long for a PTP GM to wait after startup. This patch allows the built in leap seconds table to be overridden by an up to date file provided in the environment. Signed-off-by: Richard Cochran --- config.c | 1 + ts2phc.8 | 8

Re: [Linuxptp-devel] linuxptp and uclibc-ng

2020-09-28 Thread Richard Cochran
On Mon, Sep 28, 2020 at 12:37:03PM +0200, Heiko Thiery wrote: > I just want to understand when the defines/functions coming from > missing.h should come into account. What uclib(-ng) version should be > support here? I think the audience for uClibc is small, and so we needn't support every last

[Linuxptp-devel] [PATCH 02/10] tlv: Encode and decode SLAVE_RX_SYNC_TIMING_DATA TLVs.

2020-05-24 Thread Richard Cochran
Signed-off-by: Richard Cochran --- tlv.c | 78 ++- tlv.h | 28 ++--- 2 files changed, 101 insertions(+), 5 deletions(-) diff --git a/tlv.c b/tlv.c index 0cf6d5c..e12e5ae 100644 --- a/tlv.c +++ b/tlv.c @@ -53,6 +53,20

[Linuxptp-devel] [PATCH 09/10] port: Support slave event monitoring of delay timing data.

2020-05-24 Thread Richard Cochran
After a successful message exchange, the delay measurement values are processed by the port code. This patch makes the values available to a monitor by calling the appropriate method. Signed-off-by: Richard Cochran --- port.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/port.c b

<    8   9   10   11   12   13   14   15   16   17   >