All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexandre Belloni <alexandre.belloni@bootlin.com>
To: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Cc: linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org,
	Alessandro Zummo <a.zummo@towertech.it>
Subject: Re: [PATCH v2 2/2] rtc: hym8563: Read the valid flag directly instead of caching it
Date: Mon, 23 Dec 2019 11:18:49 +0100	[thread overview]
Message-ID: <20191223101849.GD1054858@piout.net> (raw)
In-Reply-To: <20191212153111.966923-2-paul.kocialkowski@bootlin.com>

On 12/12/2019 16:31:11+0100, Paul Kocialkowski wrote:
> The RTC has a valid bit in the seconds register that indicates whether
> power was lost since the pevious time set. This bit is currently read
> once at probe time, cached and updated with set_time.
> 
> Howeever, caching the bit may prevent detecting power loss at runtime
> (which can happen if the RTC's supply is distinct from the the platform's).
> 
> Writing the seconds register when setting time will clear the bit,
> so there should be no downside in reading the bit directly instead of
> caching it.
> 
> Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
> ---
> Changes since v1:
> - Removed hym8563 unused variables;
> - Checked buf[0] for VL flag instead of ret;
> - Reorded patches.
> 
>  drivers/rtc/rtc-hym8563.c | 19 +++++++------------
>  1 file changed, 7 insertions(+), 12 deletions(-)
Applied, thanks.

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

  reply	other threads:[~2019-12-23 10:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-12 15:31 [PATCH v2 1/2] rtc: hym8563: Return -EINVAL if the time is known to be invalid Paul Kocialkowski
2019-12-12 15:31 ` [PATCH v2 2/2] rtc: hym8563: Read the valid flag directly instead of caching it Paul Kocialkowski
2019-12-23 10:18   ` Alexandre Belloni [this message]
2019-12-23 10:18 ` [PATCH v2 1/2] rtc: hym8563: Return -EINVAL if the time is known to be invalid Alexandre Belloni

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=20191223101849.GD1054858@piout.net \
    --to=alexandre.belloni@bootlin.com \
    --cc=a.zummo@towertech.it \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rtc@vger.kernel.org \
    --cc=paul.kocialkowski@bootlin.com \
    /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 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.