lkml.org 
[lkml]   [2023]   [Feb]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
SubjectRe: PPS functionality for Intel Timed I/O
From
On 15/02/23 08:09, N, Pandith wrote:
> Hi Rodolfo,

Hello.

>> -----Original Message-----
>> From: Rodolfo Giometti <giometti@enneenne.com>
>> Sent: Monday, February 6, 2023 4:17 PM
>> To: N, Pandith <pandith.n@intel.com>
>> Cc: linux-kernel@vger.kernel.org; Sangannavar, Mallikarjunappa
>> <mallikarjunappa.sangannavar@intel.com>; D, Lakshmi Sowjanya
>> <lakshmi.sowjanya.d@intel.com>; T R, Thejesh Reddy
>> <thejesh.reddy.t.r@intel.com>; Hall, Christopher S
>> <christopher.s.hall@intel.com>
>> Subject: Re: PPS functionality for Intel Timed I/O

[snip]

>> Mmm... I'm not sure this is correct since PPS generators should generate
>> their pulses according to system clock and not according to their internal
>> clocks even if they are synced with the system clock.
>>
> Timed I/O and system time are both driven by the *same* hardware clock.
> Timed I/O is a high precision device (nanoseconds), able to output pulses.
> The driver gets the system time and schedules output
> at target_time in the future.

OK, in this case it would be OK. Please put an appropriate note within the
generator's code and a detailed one within Documentation/driver-api/pps.rst.

Regarding Documentation/driver-api/pps.rst let me suggest you to prose a
separate patch to rewrite the Generators section in such a way you easily can
add your solution at the end. A possible example is attached but feel free to
rewrite it according to your needs.

> struct timespec64 current_time;
> current_time = ktime_get_real_ts64(&current_time);
>
> target_time = current_time + offset_time;
> cycles = translate_system_time_to_clock_cycles(target_time);
> /* Translate function is developed as part of this driver development */
>
> /* Schedule pulse at target_time */
> write_timedio_reg(TIMEDIO_TRIGGER, cycles);
>
> The output always triggers with ~20 ns precision.
> It's not affected by system load or no need for drivers to disable interrupts for longer durations.
> With this driver proposal, Intel Timed I/O as PPS generator will be useful in IoT and server applications.

Great! Please also add these notes to the final Documentation.

Ciao,

Rodolfo

--
GNU/Linux Solutions e-mail: giometti@enneenne.com
Linux Device Driver giometti@linux.it
Embedded Systems phone: +39 349 2432127
UNIX programming skype: rodolfo.giometti
diff --git a/Documentation/driver-api/pps.rst b/Documentation/driver-api/pps.rst
index 2d6b99766ee8..e25031845ec6 100644
--- a/Documentation/driver-api/pps.rst
+++ b/Documentation/driver-api/pps.rst
@@ -200,11 +200,17 @@ Generators

Sometimes one needs to be able not only to catch PPS signals but to produce
them also. For example, running a distributed simulation, which requires
-computers' clock to be synchronized very tightly. One way to do this is to
-invent some complicated hardware solutions but it may be neither necessary
-nor affordable. The cheap way is to load a PPS generator on one of the
-computers (master) and PPS clients on others (slaves), and use very simple
-cables to deliver signals using parallel ports, for example.
+computers' clock to be synchronized very tightly.
+
+
+Parallel port generator
+------------------------
+
+One way to do this is to invent some complicated hardware solutions
+but it may be neither necessary nor affordable. The cheap way is to
+load a PPS generator on one of the computers (master) and PPS clients
+on others (slaves), and use very simple cables to deliver signals
+using parallel ports, for example.

Parallel port cable pinout::
\
 
 \ /
  Last update: 2023-03-27 00:23    [W:0.075 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site