Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1421976 > unrolled thread

Re: [PATCH] rtc: ds1307: Fix relying on reset value for weekday

Started byAlexandre Belloni <alexandre.belloni@free-electrons.com>
First post2016-06-14 16:50 +0200
Last post2016-06-15 06:20 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH] rtc: ds1307: Fix relying on reset value for weekday Alexandre Belloni <alexandre.belloni@free-electrons.com> - 2016-06-14 16:50 +0200
    Re: [PATCH] rtc: ds1307: Fix relying on reset value for weekday Keerthy <a0393675@ti.com> - 2016-06-15 06:20 +0200

#1421976 — Re: [PATCH] rtc: ds1307: Fix relying on reset value for weekday

FromAlexandre Belloni <alexandre.belloni@free-electrons.com>
Date2016-06-14 16:50 +0200
SubjectRe: [PATCH] rtc: ds1307: Fix relying on reset value for weekday
Message-ID<rJXPd-66e-49@gated-at.bofh.it>
On 07/06/2016 at 14:59:05 +0530, Keerthy wrote :
> Hi Alexandre,
> 
> On Wednesday 01 June 2016 06:06 PM, Keerthy wrote:
> > 
> > 
> > On Wednesday 01 June 2016 05:48 PM, Alexandre Belloni wrote:
> > > Hi,
> > > 
> > > On 01/06/2016 at 16:19:07 +0530, Keerthy wrote :
> > > > The reset value of weekday is 0x1. This is wrong since
> > > > the reset values of the day/month/year make up to Jan 1 2001.
> > > > When computed weekday comes out to be Monday. On a scale
> > > > of 1-7(Sunday - Saturday) it should be 0x2. So we should not
> > > > be relying on the reset value.
> > > > 
> > > 
> > > Hum, what are the chances that the reset value is actually the correct
> > > date/time?
> > > Won't that be corrected after the first call to set_time? Until then,
> > > the date is not correct so, do we care anyway?
> > 
> > Yes if an alarm is programmed without set_time.
> > 
> > ex: rtcwake -d /dev/rtc0 -s 5
> > 
> > Even the basic rtctest under tools/testing/selftests/timers/rtctest.c fails
> > as the wday is wrong and no alarm fires.
> > 
> > Instead of relying on some one to call set_time before programming alarm
> > its better to fix the wday to reflect the current day right?
> > 
> > 
> > > 
> > > Maybe I'm missing something here.
> 
> Let me know if you feel this is a valid fix.
> 

Well, this is probably a valid fix and I'll take it as is if I don't
find the time to make something more generic.

-- 
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

[toc] | [next] | [standalone]


#1422587

FromKeerthy <a0393675@ti.com>
Date2016-06-15 06:20 +0200
Message-ID<rKat3-5ZK-3@gated-at.bofh.it>
In reply to#1421976

On Tuesday 14 June 2016 08:09 PM, Alexandre Belloni wrote:
> On 07/06/2016 at 14:59:05 +0530, Keerthy wrote :
>> Hi Alexandre,
>>
>> On Wednesday 01 June 2016 06:06 PM, Keerthy wrote:
>>>
>>>
>>> On Wednesday 01 June 2016 05:48 PM, Alexandre Belloni wrote:
>>>> Hi,
>>>>
>>>> On 01/06/2016 at 16:19:07 +0530, Keerthy wrote :
>>>>> The reset value of weekday is 0x1. This is wrong since
>>>>> the reset values of the day/month/year make up to Jan 1 2001.
>>>>> When computed weekday comes out to be Monday. On a scale
>>>>> of 1-7(Sunday - Saturday) it should be 0x2. So we should not
>>>>> be relying on the reset value.
>>>>>
>>>>
>>>> Hum, what are the chances that the reset value is actually the correct
>>>> date/time?
>>>> Won't that be corrected after the first call to set_time? Until then,
>>>> the date is not correct so, do we care anyway?
>>>
>>> Yes if an alarm is programmed without set_time.
>>>
>>> ex: rtcwake -d /dev/rtc0 -s 5
>>>
>>> Even the basic rtctest under tools/testing/selftests/timers/rtctest.c fails
>>> as the wday is wrong and no alarm fires.
>>>
>>> Instead of relying on some one to call set_time before programming alarm
>>> its better to fix the wday to reflect the current day right?
>>>
>>>
>>>>
>>>> Maybe I'm missing something here.
>>
>> Let me know if you feel this is a valid fix.
>>
>
> Well, this is probably a valid fix and I'll take it as is if I don't
> find the time to make something more generic.

Okay Thanks.

>

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web