linux-rtc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexandre Belloni <alexandre.belloni@bootlin.com>
To: Finn Thain <fthain@telegraphics.com.au>
Cc: Alessandro Zummo <a.zummo@towertech.it>,
	linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] rtc: Don't state that the RTC holds UTC in case it doesn't
Date: Mon, 24 Jun 2019 21:57:05 +0200	[thread overview]
Message-ID: <20190624195705.GD5690@piout.net> (raw)
In-Reply-To: <3e1e24a326b8b623b1a8b66a905ac6494ef74a07.1561081886.git.fthain@telegraphics.com.au>

On 21/06/2019 11:51:26+1000, Finn Thain wrote:
> Some machines store local time in the Real Time Clock. The hard-coded
> "UTC" string is wrong on those machines so just omit that string.
> Update the log parser so it doesn't require the string "UTC".
> 

I don't agree, hctossys will always think the RTC is in UTC. If you
store local time in the RTC, then you are probably not using hctosys
because it definitively doesn't know about the timezone and will
incorrectly set the system time. That information is usually kept in
/etc/adjtime.

> Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
> ---
>  drivers/rtc/hctosys.c             | 2 +-
>  tools/power/pm-graph/bootgraph.py | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/rtc/hctosys.c b/drivers/rtc/hctosys.c
> index ff2092a0d38c..2270eca23203 100644
> --- a/drivers/rtc/hctosys.c
> +++ b/drivers/rtc/hctosys.c
> @@ -58,7 +58,7 @@ static int __init rtc_hctosys(void)
>  
>  	err = do_settimeofday64(&tv64);
>  
> -	dev_info(rtc->dev.parent, "setting system clock to %ptR UTC (%lld)\n",
> +	dev_info(rtc->dev.parent, "setting system clock to %ptR (%lld)\n",
>  		 &tm, (long long)tv64.tv_sec);
>  
>  err_read:
> diff --git a/tools/power/pm-graph/bootgraph.py b/tools/power/pm-graph/bootgraph.py
> index 6dae57041537..5a045d1cb879 100755
> --- a/tools/power/pm-graph/bootgraph.py
> +++ b/tools/power/pm-graph/bootgraph.py
> @@ -333,7 +333,7 @@ def parseKernelLog():
>  			if(not sysvals.stamp['kernel']):
>  				sysvals.stamp['kernel'] = sysvals.kernelVersion(msg)
>  			continue
> -		m = re.match('.* setting system clock to (?P<t>.*) UTC.*', msg)
> +		m = re.match('.* setting system clock to (?P<t>.*) (?:UTC )?\(.*', msg)
>  		if(m):
>  			bt = datetime.strptime(m.group('t'), '%Y-%m-%d %H:%M:%S')
>  			bt = bt - timedelta(seconds=int(ktime))
> -- 
> 2.21.0
> 

-- 
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

  reply	other threads:[~2019-06-24 19:57 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-21  1:51 [PATCH] rtc: Don't state that the RTC holds UTC in case it doesn't Finn Thain
2019-06-24 19:57 ` Alexandre Belloni [this message]
2019-06-25  1:53   ` Finn Thain
2019-06-25  9:29     ` Alexandre Belloni
2019-06-25 17:16       ` Trent Piepho
2019-06-25 19:19         ` Alexandre Belloni
2019-06-25 20:27           ` Trent Piepho
2019-06-26  4:42       ` Finn Thain
2019-07-13 20:50         ` Alexandre Belloni
2019-07-14  1:17           ` Finn Thain

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=20190624195705.GD5690@piout.net \
    --to=alexandre.belloni@bootlin.com \
    --cc=a.zummo@towertech.it \
    --cc=fthain@telegraphics.com.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rtc@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;
as well as URLs for NNTP newsgroup(s).