From: Alexandre Belloni <alexandre.belloni@bootlin.com>
To: Oliver.Rohe@wago.com
Cc: a.zummo@towertech.it, linux-rtc@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] rtc: rs5c372: Fix reading from rtc when the oscillator got interrupted.
Date: Wed, 6 Feb 2019 10:58:10 +0100 [thread overview]
Message-ID: <20190206095810.GL24598@piout.net> (raw)
In-Reply-To: <0b5372eb-a921-44e9-2bed-2f7582f64329@wago.com>
On 06/02/2019 06:33:39+0000, Oliver.Rohe@wago.com wrote:
> >> + switch (rs5c->type) {
> >> + case rtc_r2025sd:
> >> + case rtc_r2221tl:
> >> + if (ctrl2 & R2x2x_CTRL2_VDET)
> >> + dev_warn(&client->dev, "rtc battery voltage drop below threshold detected.\n");
> >
> > VDET doesn't mean anything specific regarding timekeeping so I wouldn't warn here.
>
> VDET means in case the chip is powered by a battery, that is about to die sometime soon, it gives you heads up.
Yes but my statement stands true, this doesn't have any direct
implication regarding timekeeping.
There is the RTC_VL_READ ioctl to check voltage low. It is not weel
designed but this is what we have now.
> >
> >> + if (ctrl2 & R2x2x_CTRL2_PON)
> >> + dev_warn(&client->dev, "rtc battery voltage drop to zero detected.\n");
> >
> > You should return -EINVAL directly here
>
> The PON implies the XSTP bit, so I only return from there, just to print all the warning messages, but I can return directly from here if you want.
As you said, PON implies XSTP so I'm not sure it is valuable to have both
warnings.
--
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
prev parent reply other threads:[~2019-02-06 9:58 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-11 13:15 [PATCH] rtc: rs5c372: Fix reading from rtc when the oscillator got interrupted Oliver.Rohe
2019-02-05 21:55 ` Alexandre Belloni
2019-02-06 6:33 ` Oliver.Rohe
2019-02-06 9:58 ` Alexandre Belloni [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=20190206095810.GL24598@piout.net \
--to=alexandre.belloni@bootlin.com \
--cc=Oliver.Rohe@wago.com \
--cc=a.zummo@towertech.it \
--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).