Thread (5 messages) flat view 5 messages, 2 authors, 2019-05-08

Re: [PATCH v1] timer:clock:ptp: add support the dynamic posix clock alarm set for ptp

From: Richard Cochran <richardcochran@gmail.com>
Date: 2019-05-07 13:49:58
Also in: linux-arm-kernel, lkml, netdev

On Sun, May 05, 2019 at 05:02:05AM +0000, Po Liu wrote:
Current kernel code do not support the dynamic posix clock alarm set.
This code would support it by the posix timer structure.

319  const struct k_clock clock_posix_dynamic = {

320         .clock_getres   = pc_clock_getres,
321         .clock_set      = pc_clock_settime,
322         .clock_get      = pc_clock_gettime,
323         .clock_adj      = pc_clock_adjtime,
324 +       .timer_create   = pc_timer_create,
325 +       .timer_del      = pc_timer_delete,
326 +       .timer_set      = pc_timer_set,
327 +       .timer_arm      = pc_timer_arm,
}
Sorry, NAK, since we decided some time ago not to support timer_*
operations on dynamic clocks.  You get much better application level
timer performance by synchronizing CLOCK_REALTIME to your PHC and
using clock_nanosleep() with CLOCK_REALTIME or CLOCK_MONOTONIC.
This won't change the user space system call code. Normally the user
space set alarm by timer_create() and timer_settime(). Reference code
are tools/testing/selftests/ptp/testptp.c.
That program still has misleading examples.  Sorry about that.  I'll
submit a patch to remove them.
+static int pc_timer_create(struct k_itimer *new_timer)
+{
+	return 0;
+}
+
This of course would never work.  Consider what happens when two or
more timers are created and armed.

Thanks,
Richard
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help