mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Rodolfo Giometti <giometti@enneenne.com>
To: Alexander Komrakov <alexander.komrakov@broadcom.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Replacing ktime_get because elapsedRealtime includes time spent in sleep and pps should be also including sleep time.
Date: Tue, 15 Feb 2022 09:26:59 +0100	[thread overview]
Message-ID: <b48e9155-2937-dd1f-2a54-61651f3c4190@enneenne.com> (raw)
In-Reply-To: <20220117073835.1430628-1-alexander.komrakov@broadcom.com>

On 17/01/22 08:38, Alexander Komrakov wrote:
> From: alexander komrakov <alexander.komrakov@broadcom.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@broadcom.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@enneenne.com
Linux Device Driver                          giometti@linux.it
Embedded Systems                     phone:  +39 349 2432127
UNIX programming                     skype:  rodolfo.giometti

      reply	other threads:[~2022-02-15  8:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-17  7:38 Alexander Komrakov
2022-02-15  8:26 ` Rodolfo Giometti [this message]

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=b48e9155-2937-dd1f-2a54-61651f3c4190@enneenne.com \
    --to=giometti@enneenne.com \
    --cc=alexander.komrakov@broadcom.com \
    --cc=linux-kernel@vger.kernel.org \
    /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®