[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <BYAPR11MB3240C6789B4C04F3BDAE34D5E1A39@BYAPR11MB3240.namprd11.prod.outlook.com>
Date: Wed, 15 Feb 2023 07:09:01 +0000
From: "N, Pandith" <pandith.n@...el.com>
To: Rodolfo Giometti <giometti@...eenne.com>
CC: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"Sangannavar, Mallikarjunappa"
<mallikarjunappa.sangannavar@...el.com>,
"D, Lakshmi Sowjanya" <lakshmi.sowjanya.d@...el.com>,
"T R, Thejesh Reddy" <thejesh.reddy.t.r@...el.com>,
"Hall, Christopher S" <christopher.s.hall@...el.com>,
"Gross, Mark" <mark.gross@...el.com>
Subject: RE: PPS functionality for Intel Timed I/O
Hi Rodolfo,
> -----Original Message-----
> From: Rodolfo Giometti <giometti@...eenne.com>
> Sent: Monday, February 6, 2023 4:17 PM
> To: N, Pandith <pandith.n@...el.com>
> Cc: linux-kernel@...r.kernel.org; Sangannavar, Mallikarjunappa
> <mallikarjunappa.sangannavar@...el.com>; D, Lakshmi Sowjanya
> <lakshmi.sowjanya.d@...el.com>; T R, Thejesh Reddy
> <thejesh.reddy.t.r@...el.com>; Hall, Christopher S
> <christopher.s.hall@...el.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@...eenne.com>
> >> Sent: Monday, January 30, 2023 7:57 PM
> >> To: N, Pandith <pandith.n@...el.com>
> >> Cc: linux-kernel@...r.kernel.org; Sangannavar, Mallikarjunappa
> >> <mallikarjunappa.sangannavar@...el.com>; D, Lakshmi Sowjanya
> >> <lakshmi.sowjanya.d@...el.com>; T R, Thejesh Reddy
> >> <thejesh.reddy.t.r@...el.com>; Hall, Christopher S
> >> <christopher.s.hall@...el.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(¤t_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@...eenne.com
> Linux Device Driver giometti@...ux.it
> Embedded Systems phone: +39 349 2432127
> UNIX programming skype: rodolfo.giometti
Regards,
Pandith
Powered by blists - more mailing lists