lkml.org 
[lkml]   [2019]   [Feb]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] rtc: rs5c372: Fix reading from rtc when the oscillator got interrupted.
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

\
 
 \ /
  Last update: 2019-02-06 10:59    [W:0.040 / U:0.396 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site