All of lore.kernel.org
 help / color / mirror / Atom feed
* PPS functionality for Intel Timed I/O
@ 2023-01-30 12:55 N, Pandith
  2023-01-30 13:45 ` Rodolfo Giometti
  0 siblings, 1 reply; 14+ messages in thread
From: N, Pandith @ 2023-01-30 12:55 UTC (permalink / raw)
  To: giometti
  Cc: linux-kernel, Sangannavar, Mallikarjunappa, D, Lakshmi Sowjanya,
	T R, Thejesh Reddy, Hall, Christopher S

Hi Rodolfo Giometti,

This is regarding Intel Timed I/O device as PPS.

Intel Timed I/O is a precise device (10s of nanoseconds), that can send out pulses.
This is needed in IoT and server applications to measure offset between system clocks on multiple devices

We are planning to implement a driver, for PPS output functionality using Timed I/O device.

	1. Is there any support from PPS framework to start/stop pulse generation.
	If yes, can we get the Pin number, offset(start time) from user space ?

	2. Further, this device has the capability to capture the input events (pulses, nanosecond precision).
	The same PIN can work in either input or output mode.
	Can there be an PPS client driver supporting both modes ?

Regards,
Pandith

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: PPS functionality for Intel Timed I/O
  2023-01-30 12:55 PPS functionality for Intel Timed I/O N, Pandith
@ 2023-01-30 13:45 ` Rodolfo Giometti
  2023-01-30 14:11   ` N, Pandith
  0 siblings, 1 reply; 14+ messages in thread
From: Rodolfo Giometti @ 2023-01-30 13:45 UTC (permalink / raw)
  To: N, Pandith
  Cc: linux-kernel, Sangannavar, Mallikarjunappa, D, Lakshmi Sowjanya,
	T R, Thejesh Reddy, Hall, Christopher S

On 30/01/23 13:55, N, Pandith wrote:
> Hi Rodolfo Giometti,

Hello.

> This is regarding Intel Timed I/O device as PPS.
> 
> Intel Timed I/O is a precise device (10s of nanoseconds), that can send out pulses.
> This is needed in IoT and server applications to measure offset between system clocks on multiple devices

Can you please provide some URLs where to get further info from about this 
device? I'd like to know how this device works and its interfaces towards the CPU.

> We are planning to implement a driver, for PPS output functionality using Timed I/O device.

Great! :)

> 	1. Is there any support from PPS framework to start/stop pulse generation.
> 	If yes, can we get the Pin number, offset(start time) from user space ?

Nope, PPS signals are supposed to be always on. However you can start/stop 
pulses generation within the main driver of your device.

> 	2. Further, this device has the capability to capture the input events (pulses, nanosecond precision).
> 	The same PIN can work in either input or output mode.
> 	Can there be an PPS client driver supporting both modes ?

I'm not sure to well understand what you mean, however a PPS client is a piece 
of code that captures PPS pulses and add a timestamp to them, while a PPS 
generator is a piece of code that (precisely) generates a PPS source according 
to the system's main clock (and not according to a peripheral's clock). Hope 
I've answered to your questions, if not feel free to ask more.

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


^ permalink raw reply	[flat|nested] 14+ messages in thread

* RE: PPS functionality for Intel Timed I/O
  2023-01-30 13:45 ` Rodolfo Giometti
@ 2023-01-30 14:11   ` N, Pandith
  2023-01-30 14:26     ` Rodolfo Giometti
  0 siblings, 1 reply; 14+ messages in thread
From: N, Pandith @ 2023-01-30 14:11 UTC (permalink / raw)
  To: Rodolfo Giometti
  Cc: linux-kernel, Sangannavar, Mallikarjunappa, D, Lakshmi Sowjanya,
	T R, Thejesh Reddy, Hall, Christopher S

Hi,

> -----Original Message-----
> From: Rodolfo Giometti <giometti@enneenne.com>
> Sent: Monday, January 30, 2023 7:15 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
> 
> On 30/01/23 13:55, N, Pandith wrote:
> > Hi Rodolfo Giometti,
> 
> Hello.
> 
> > This is regarding Intel Timed I/O device as PPS.
> >
> > Intel Timed I/O is a precise device (10s of nanoseconds), that can send out
> pulses.
> > This is needed in IoT and server applications to measure offset
> > between system clocks on multiple devices
> 
> Can you please provide some URLs where to get further info from about this
> device? I'd like to know how this device works and its interfaces towards the
> CPU.
> 
Here is a presentation link for Timed I/O device 
https://lpc.events/event/16/contributions/1387/attachments/1051/2010/Timed_IO_LPC.pdf

> > We are planning to implement a driver, for PPS output functionality using
> Timed I/O device.
> 
> Great! :)
> 
> > 	1. Is there any support from PPS framework to start/stop pulse
> generation.
> > 	If yes, can we get the Pin number, offset(start time) from user space
> ?
> 
> Nope, PPS signals are supposed to be always on. However you can start/stop
> pulses generation within the main driver of your device.
> 
OK. Wanted to check from PPS framework if can provide any user control for start/stop.

> > 	2. Further, this device has the capability to capture the input events
> (pulses, nanosecond precision).
> > 	The same PIN can work in either input or output mode.
> > 	Can there be an PPS client driver supporting both modes ?
> 
> I'm not sure to well understand what you mean, however a PPS client is a
> piece of code that captures PPS pulses and add a timestamp to them, while a
> PPS generator is a piece of code that (precisely) generates a PPS source
> according to the system's main clock (and not according to a peripheral's
> clock). Hope I've answered to your questions, if not feel free to ask more.
> 
Intel Timed I/O PIN has both generator functionality and input capability.
Wanted to ask if it’s better to have two separate drivers, one under client
for input and other as generator driver for PPS output.
OR
Have a single client driver and user can choose the functionality (either
PPS output or as PPS source to capture pulses with timestamps). 

> 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


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: PPS functionality for Intel Timed I/O
  2023-01-30 14:11   ` N, Pandith
@ 2023-01-30 14:26     ` Rodolfo Giometti
  2023-02-06 10:16       ` N, Pandith
  0 siblings, 1 reply; 14+ messages in thread
From: Rodolfo Giometti @ 2023-01-30 14:26 UTC (permalink / raw)
  To: N, Pandith
  Cc: linux-kernel, Sangannavar, Mallikarjunappa, D, Lakshmi Sowjanya,
	T R, Thejesh Reddy, Hall, Christopher S

On 30/01/23 15:11, N, Pandith wrote:
> Here is a presentation link for Timed I/O device
> https://lpc.events/event/16/contributions/1387/attachments/1051/2010/Timed_IO_LPC.pdf

Thanks. I'll take a look at it.

> Intel Timed I/O PIN has both generator functionality and input capability.
> Wanted to ask if it’s better to have two separate drivers, one under client
> for input and other as generator driver for PPS output.
> OR
> Have a single client driver and user can choose the functionality (either
> PPS output or as PPS source to capture pulses with timestamps).
Within kernel sources PPS clients and PPS generators are placed into different 
directories, so I suppose is better to deploy two different pieces of code.

However pay attention to the fact that a PPS generator should be referred to 
system's main clock and not to peripherals' clock.

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


^ permalink raw reply	[flat|nested] 14+ messages in thread

* RE: PPS functionality for Intel Timed I/O
  2023-01-30 14:26     ` Rodolfo Giometti
@ 2023-02-06 10:16       ` N, Pandith
  2023-02-06 10:46         ` Rodolfo Giometti
  0 siblings, 1 reply; 14+ messages in thread
From: N, Pandith @ 2023-02-06 10:16 UTC (permalink / raw)
  To: Rodolfo Giometti
  Cc: linux-kernel, Sangannavar, Mallikarjunappa, D, Lakshmi Sowjanya,
	T R, Thejesh Reddy, Hall, Christopher S

Hi Rodolfo,

> -----Original Message-----
> From: Rodolfo Giometti <giometti@enneenne.com>
> Sent: Monday, January 30, 2023 7:57 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
> 
> On 30/01/23 15:11, N, Pandith wrote:
> > Here is a presentation link for Timed I/O device
> > https://lpc.events/event/16/contributions/1387/attachments/1051/2010/T
> > imed_IO_LPC.pdf
> 
> Thanks. I'll take a look at it.
> 
> > Intel Timed I/O PIN has both generator functionality and input capability.
> > Wanted to ask if it’s better to have two separate drivers, one under
> > client for input and other as generator driver for PPS output.
> > OR
> > Have a single client driver and user can choose the functionality
> > (either PPS output or as PPS source to capture pulses with timestamps).
> Within kernel sources PPS clients and PPS generators are placed into different
> directories, so I suppose is better to deploy two different pieces of code.
> 
We are planning to add a new PPS generator driver in drivers/pps/generators
i) Can this driver use pps_register_source to register Intel Timed I/O device for pulse generation ?

ii) To start/stop pulse, we are planning to add additional sysfs attribute from our main driver. 
Something like : /sys/class/ppsX/enable_pin
This is needed for users to start/stop pulse generation.

> However pay attention to the fact that a PPS generator should be referred to
> system's main clock and not to peripherals' clock.
> 
We can sync with the system time for pulse generation.
> 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

Regards,
Pandith


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: PPS functionality for Intel Timed I/O
  2023-02-06 10:16       ` N, Pandith
@ 2023-02-06 10:46         ` Rodolfo Giometti
  2023-02-15  7:09           ` N, Pandith
  0 siblings, 1 reply; 14+ messages in thread
From: Rodolfo Giometti @ 2023-02-06 10:46 UTC (permalink / raw)
  To: N, Pandith
  Cc: linux-kernel, Sangannavar, Mallikarjunappa, D, Lakshmi Sowjanya,
	T R, Thejesh Reddy, Hall, Christopher S

On 06/02/23 11:16, N, Pandith wrote:
> Hi Rodolfo,

Hi

>> -----Original Message-----
>> From: Rodolfo Giometti <giometti@enneenne.com>
>> Sent: Monday, January 30, 2023 7:57 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

>> Within kernel sources PPS clients and PPS generators are placed into different
>> directories, so I suppose is better to deploy two different pieces of code.
>>
> We are planning to add a new PPS generator driver in drivers/pps/generators
> i) Can this driver use pps_register_source to register Intel Timed I/O device for pulse generation ?

Nope. This function is for pps clients only. PPS generators should generate 
their pulses according to system clock so they don't needed any registrations at 
all under PPS layer.

> ii) To start/stop pulse, we are planning to add additional sysfs attribute from our main driver.
> Something like : /sys/class/ppsX/enable_pin
> This is needed for users to start/stop pulse generation.

If you are still talking about PPS generators they have no entries under 
/sys/class/ppsX/ (just clients have). So you can add an entry under your driver 
to do so.

>> However pay attention to the fact that a PPS generator should be referred to
>> system's main clock and not to peripherals' clock.
>>
> We can sync with the system time for pulse generation.

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.

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


^ permalink raw reply	[flat|nested] 14+ messages in thread

* RE: PPS functionality for Intel Timed I/O
  2023-02-06 10:46         ` Rodolfo Giometti
@ 2023-02-15  7:09           ` N, Pandith
  2023-02-15  7:46             ` Rodolfo Giometti
  0 siblings, 1 reply; 14+ messages in thread
From: N, Pandith @ 2023-02-15  7:09 UTC (permalink / raw)
  To: Rodolfo Giometti
  Cc: linux-kernel, Sangannavar, Mallikarjunappa, D, Lakshmi Sowjanya,
	T R, Thejesh Reddy, Hall, Christopher S, Gross, Mark

Hi Rodolfo,

> -----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
> 
> On 06/02/23 11:16, N, Pandith wrote:
> > Hi Rodolfo,
> 
> Hi
> 
> >> -----Original Message-----
> >> From: Rodolfo Giometti <giometti@enneenne.com>
> >> Sent: Monday, January 30, 2023 7:57 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
> 
> >> Within kernel sources PPS clients and PPS generators are placed into
> >> different directories, so I suppose is better to deploy two different pieces
> of code.
> >>
> > We are planning to add a new PPS generator driver in
> > drivers/pps/generators
> > i) Can this driver use pps_register_source to register Intel Timed I/O device
> for pulse generation ?
> 
> Nope. This function is for pps clients only. PPS generators should generate
> their pulses according to system clock so they don't needed any registrations
> at all under PPS layer.
> 
> > ii) To start/stop pulse, we are planning to add additional sysfs attribute
> from our main driver.
> > Something like : /sys/class/ppsX/enable_pin This is needed for users
> > to start/stop pulse generation.
> 
> If you are still talking about PPS generators they have no entries under
> /sys/class/ppsX/ (just clients have). So you can add an entry under your
> driver to do so.
> 
Thanks, we will add entry in our driver :)
> >> However pay attention to the fact that a PPS generator should be
> >> referred to system's main clock and not to peripherals' clock.
> >>
> > We can sync with the system time for pulse generation.
> 
> 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. 

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.

> 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

Regards,
Pandith


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: PPS functionality for Intel Timed I/O
  2023-02-15  7:09           ` N, Pandith
@ 2023-02-15  7:46             ` Rodolfo Giometti
  2023-10-06  5:31               ` N, Pandith
  0 siblings, 1 reply; 14+ messages in thread
From: Rodolfo Giometti @ 2023-02-15  7:46 UTC (permalink / raw)
  To: N, Pandith
  Cc: linux-kernel, Sangannavar, Mallikarjunappa, D, Lakshmi Sowjanya,
	T R, Thejesh Reddy, Hall, Christopher S, Gross, Mark

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

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* RE: PPS functionality for Intel Timed I/O
  2023-02-15  7:46             ` Rodolfo Giometti
@ 2023-10-06  5:31               ` N, Pandith
  2023-10-06  6:23                 ` Rodolfo Giometti
  0 siblings, 1 reply; 14+ messages in thread
From: N, Pandith @ 2023-10-06  5:31 UTC (permalink / raw)
  To: Rodolfo Giometti
  Cc: linux-kernel, Sangannavar, Mallikarjunappa, D, Lakshmi Sowjanya,
	T R, Thejesh Reddy, Hall, Christopher S, Gross, Mark,
	andriy.shevchenko

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

Hi,

> -----Original Message-----
> From: Rodolfo Giometti <giometti@enneenne.com>
> Sent: Wednesday, February 15, 2023 1:16 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>; Gross, Mark <mark.gross@intel.com>
> Subject: Re: PPS functionality for Intel Timed I/O
> 
> 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.
> 
Ok, we are updating documentation as you have suggested as a separate patch.
Can we use your "Signed-off-by" tag for attached patch.

We are adding Intel timed I/O documentation as a separate patch.

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

Regards,
Pandith

[-- Attachment #2: 0001-Documentation-driver-api-pps-Update-PPS-generator-do.patch --]
[-- Type: application/octet-stream, Size: 1739 bytes --]

From 9a21e9fb445b9473c7e94b4ffc81b82f48c740a9 Mon Sep 17 00:00:00 2001
From: Pandith N <pandith.n@intel.com>
Date: Tue, 14 Mar 2023 13:17:14 +0530
Subject: [PATCH v1] Documentation: driver-api: pps: Update PPS generator
 documentation

PPS documentation has a generalized section for generators. Update the
section so any new generator documentation can be appended.

Signed-off-by: Pandith N <pandith.n@intel.com>
---
 Documentation/driver-api/pps.rst | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/Documentation/driver-api/pps.rst b/Documentation/driver-api/pps.rst
index 2d6b99766ee8..78dded03e5d8 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::
 
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: PPS functionality for Intel Timed I/O
  2023-10-06  5:31               ` N, Pandith
@ 2023-10-06  6:23                 ` Rodolfo Giometti
  2023-10-06  8:34                   ` andriy.shevchenko
  0 siblings, 1 reply; 14+ messages in thread
From: Rodolfo Giometti @ 2023-10-06  6:23 UTC (permalink / raw)
  To: N, Pandith
  Cc: linux-kernel, Sangannavar, Mallikarjunappa, D, Lakshmi Sowjanya,
	T R, Thejesh Reddy, Hall, Christopher S, Gross, Mark,
	andriy.shevchenko

On 06/10/23 07:31, N, Pandith wrote:
> Hi,

Hello.

>> -----Original Message-----
>> From: Rodolfo Giometti <giometti@enneenne.com>
>> Sent: Wednesday, February 15, 2023 1:16 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>; Gross, Mark <mark.gross@intel.com>
>> Subject: Re: PPS functionality for Intel Timed I/O
>>
>> 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.
>>
> Ok, we are updating documentation as you have suggested as a separate patch.
> Can we use your "Signed-off-by" tag for attached patch.

If you just followed my suggestion then it's OK for me.

> We are adding Intel timed I/O documentation as a separate patch.

OK.

Ciao,

Rodolfo Giometti

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


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: PPS functionality for Intel Timed I/O
  2023-10-06  6:23                 ` Rodolfo Giometti
@ 2023-10-06  8:34                   ` andriy.shevchenko
  2023-10-06  8:34                     ` andriy.shevchenko
  0 siblings, 1 reply; 14+ messages in thread
From: andriy.shevchenko @ 2023-10-06  8:34 UTC (permalink / raw)
  To: Rodolfo Giometti
  Cc: N, Pandith, linux-kernel, Sangannavar, Mallikarjunappa, D,
	Lakshmi Sowjanya, T R, Thejesh Reddy, Hall, Christopher S, Gross,
	Mark

On Fri, Oct 06, 2023 at 08:23:09AM +0200, Rodolfo Giometti wrote:
> On 06/10/23 07:31, N, Pandith wrote:
> > > From: Rodolfo Giometti <giometti@enneenne.com>
> > > Sent: Wednesday, February 15, 2023 1:16 PM
> > > On 15/02/23 08:09, N, Pandith wrote:
> > > > > From: Rodolfo Giometti <giometti@enneenne.com>
> > > > > Sent: Monday, February 6, 2023 4:17 PM

[snip]

> > > 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.
> > > 
> > Ok, we are updating documentation as you have suggested as a separate patch.
> > Can we use your "Signed-off-by" tag for attached patch.
> 
> If you just followed my suggestion then it's OK for me.

But can we have your SoB or not? If so, please provide it explicitly as
the (Linux kernel) process requires.

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: PPS functionality for Intel Timed I/O
  2023-10-06  8:34                   ` andriy.shevchenko
@ 2023-10-06  8:34                     ` andriy.shevchenko
  2023-10-06  8:57                       ` Rodolfo Giometti
  0 siblings, 1 reply; 14+ messages in thread
From: andriy.shevchenko @ 2023-10-06  8:34 UTC (permalink / raw)
  To: Rodolfo Giometti
  Cc: N, Pandith, linux-kernel, Sangannavar, Mallikarjunappa, D,
	Lakshmi Sowjanya, T R, Thejesh Reddy, Hall, Christopher S, Gross,
	Mark

On Fri, Oct 06, 2023 at 11:34:10AM +0300, andriy.shevchenko@linux.intel.com wrote:
> On Fri, Oct 06, 2023 at 08:23:09AM +0200, Rodolfo Giometti wrote:
> > On 06/10/23 07:31, N, Pandith wrote:
> > > > From: Rodolfo Giometti <giometti@enneenne.com>
> > > > Sent: Wednesday, February 15, 2023 1:16 PM
> > > > On 15/02/23 08:09, N, Pandith wrote:

[snip]

> > > > 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.
> > > > 
> > > Ok, we are updating documentation as you have suggested as a separate patch.
> > > Can we use your "Signed-off-by" tag for attached patch.
> > 
> > If you just followed my suggestion then it's OK for me.
> 
> But can we have your SoB or not? If so, please provide it explicitly as
> the (Linux kernel) process requires.

Or even better if you provide the patch itself or apply directly to your tree
that we can rebase the our stuff on.

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: PPS functionality for Intel Timed I/O
  2023-10-06  8:34                     ` andriy.shevchenko
@ 2023-10-06  8:57                       ` Rodolfo Giometti
  2023-10-06  9:06                         ` andriy.shevchenko
  0 siblings, 1 reply; 14+ messages in thread
From: Rodolfo Giometti @ 2023-10-06  8:57 UTC (permalink / raw)
  To: andriy.shevchenko
  Cc: N, Pandith, linux-kernel, Sangannavar, Mallikarjunappa, D,
	Lakshmi Sowjanya, T R, Thejesh Reddy, Hall, Christopher S, Gross,
	Mark

On 06/10/23 10:34, andriy.shevchenko@linux.intel.com wrote:
> On Fri, Oct 06, 2023 at 11:34:10AM +0300, andriy.shevchenko@linux.intel.com wrote:
>> On Fri, Oct 06, 2023 at 08:23:09AM +0200, Rodolfo Giometti wrote:
>>> On 06/10/23 07:31, N, Pandith wrote:
>>>>> From: Rodolfo Giometti <giometti@enneenne.com>
>>>>> Sent: Wednesday, February 15, 2023 1:16 PM
>>>>> On 15/02/23 08:09, N, Pandith wrote:
> 
> [snip]
> 
>>>>> 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.
>>>>>
>>>> Ok, we are updating documentation as you have suggested as a separate patch.
>>>> Can we use your "Signed-off-by" tag for attached patch.
>>>
>>> If you just followed my suggestion then it's OK for me.
>>
>> But can we have your SoB or not? If so, please provide it explicitly as
>> the (Linux kernel) process requires.
> 
> Or even better if you provide the patch itself or apply directly to your tree
> that we can rebase the our stuff on.

Just send the patch to the kernel mail list and, if OK, I'm going to sign it and 
forwarding to Greg Kroah-Hartman.

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


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: PPS functionality for Intel Timed I/O
  2023-10-06  8:57                       ` Rodolfo Giometti
@ 2023-10-06  9:06                         ` andriy.shevchenko
  0 siblings, 0 replies; 14+ messages in thread
From: andriy.shevchenko @ 2023-10-06  9:06 UTC (permalink / raw)
  To: Rodolfo Giometti
  Cc: N, Pandith, linux-kernel, Sangannavar, Mallikarjunappa, D,
	Lakshmi Sowjanya, T R, Thejesh Reddy, Hall, Christopher S, Gross,
	Mark

On Fri, Oct 06, 2023 at 10:57:37AM +0200, Rodolfo Giometti wrote:
> On 06/10/23 10:34, andriy.shevchenko@linux.intel.com wrote:
> > On Fri, Oct 06, 2023 at 11:34:10AM +0300, andriy.shevchenko@linux.intel.com wrote:
> > > On Fri, Oct 06, 2023 at 08:23:09AM +0200, Rodolfo Giometti wrote:
> > > > On 06/10/23 07:31, N, Pandith wrote:
> > > > > > From: Rodolfo Giometti <giometti@enneenne.com>
> > > > > > Sent: Wednesday, February 15, 2023 1:16 PM
> > > > > > On 15/02/23 08:09, N, Pandith wrote:

[snip]

> > > > > > 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.
> > > > > > 
> > > > > Ok, we are updating documentation as you have suggested as a separate patch.
> > > > > Can we use your "Signed-off-by" tag for attached patch.
> > > > 
> > > > If you just followed my suggestion then it's OK for me.
> > > 
> > > But can we have your SoB or not? If so, please provide it explicitly as
> > > the (Linux kernel) process requires.
> > 
> > Or even better if you provide the patch itself or apply directly to your tree
> > that we can rebase the our stuff on.
> 
> Just send the patch to the kernel mail list and, if OK, I'm going to sign it
> and forwarding to Greg Kroah-Hartman.

Okay, now it's clear, thank you!

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2023-10-06  9:06 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-30 12:55 PPS functionality for Intel Timed I/O 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
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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.