mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Rodolfo Giometti <giometti@enneenne.com>
To: "N, Pandith" <pandith.n@intel.com>
Cc: "linux-kernel@vger.kernel.org" <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>,
	"Gross, Mark" <mark.gross@intel.com>
Subject: Re: PPS functionality for Intel Timed I/O
Date: Wed, 15 Feb 2023 08:46:25 +0100	[thread overview]
Message-ID: <f8a97493-a5ab-565f-825a-dd0a508f2b66@enneenne.com> (raw)
In-Reply-To: <BYAPR11MB3240C6789B4C04F3BDAE34D5E1A39@BYAPR11MB3240.namprd11.prod.outlook.com>

[-- Attachment #1: Type: text/plain, Size: 2396 bytes --]

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

[-- Attachment #2: pps_rst_doc_proposal.patch --]
[-- Type: text/x-patch, Size: 1201 bytes --]

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::
 

  reply	other threads:[~2023-02-15  7:47 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-30 12:55 N, Pandith
2023-01-30 13:45 ` Rodolfo Giometti
2023-01-30 14:11   ` N, Pandith
2023-01-30 14:26     ` Rodolfo Giometti
2023-02-06 10:16       ` N, Pandith
2023-02-06 10:46         ` Rodolfo Giometti
2023-02-15  7:09           ` N, Pandith
2023-02-15  7:46             ` Rodolfo Giometti [this message]
2023-10-06  5:31               ` N, Pandith
2023-10-06  6:23                 ` Rodolfo Giometti
2023-10-06  8:34                   ` andriy.shevchenko
2023-10-06  8:34                     ` andriy.shevchenko
2023-10-06  8:57                       ` Rodolfo Giometti
2023-10-06  9:06                         ` andriy.shevchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f8a97493-a5ab-565f-825a-dd0a508f2b66@enneenne.com \
    --to=giometti@enneenne.com \
    --cc=christopher.s.hall@intel.com \
    --cc=lakshmi.sowjanya.d@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mallikarjunappa.sangannavar@intel.com \
    --cc=mark.gross@intel.com \
    --cc=pandith.n@intel.com \
    --cc=thejesh.reddy.t.r@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®