[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <b48e9155-2937-dd1f-2a54-61651f3c4190@enneenne.com>
Date: Tue, 15 Feb 2022 09:26:59 +0100
From: Rodolfo Giometti <giometti@...eenne.com>
To: Alexander Komrakov <alexander.komrakov@...adcom.com>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] Replacing ktime_get because elapsedRealtime includes time
spent in sleep and pps should be also including sleep time.
On 17/01/22 08:38, Alexander Komrakov wrote:
> From: alexander komrakov <alexander.komrakov@...adcom.com>
Very long subject and missed description.
Let me suggest to replace the subject as "pps kapi: use
ktime_get_boottime_ts64() to include time spent in sleep".
And add a description as:
Since ktime_get() stops during suspend, we replace it with
ktime_get_boottime_ts64() because elapsed realtime includes time spent in sleep
and pps should be also including sleep time.
Ciao,
Rodolfo
> Signed-off-by: alexander komrakov <alexander.komrakov@...adcom.com>
> ---
> drivers/pps/kapi.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/pps/kapi.c b/drivers/pps/kapi.c
> index 149c29e498fc..6d1fbe4a8c40 100644
> --- a/drivers/pps/kapi.c
> +++ b/drivers/pps/kapi.c
> @@ -38,7 +38,7 @@ static __u64 clock_gettime(struct pps_ktime *kt)
> {
> struct timespec64 ts = { .tv_sec = 0, .tv_nsec = 0 };
>
> - ktime_get_ts64(&ts);
> + ktime_get_boottime_ts64(&ts);
> kt->sec = ts.tv_sec;
> kt->nsec = ts.tv_nsec;
> return (__u64) ts.tv_sec * NANOSEC_PER_SEC + ts.tv_nsec;
--
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
Powered by blists - more mailing lists