All of lore.kernel.org
 help / color / mirror / Atom feed
From: Keerthy <a0393675@ti.com>
To: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Cc: Keerthy <j-keerthy@ti.com>, <a.zummo@towertech.it>, <nm@ti.com>,
	<rtc-linux@googlegroups.com>, <linux-kernel@vger.kernel.org>
Subject: [rtc-linux] Re: [PATCH] rtc: ds1307: Fix relying on reset value for weekday
Date: Wed, 15 Jun 2016 09:44:41 +0530	[thread overview]
Message-ID: <5760D631.1050006@ti.com> (raw)
In-Reply-To: <20160614143948.GP3240@piout.net>



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.

>

-- 
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
--- 
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

WARNING: multiple messages have this Message-ID (diff)
From: Keerthy <a0393675@ti.com>
To: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Cc: Keerthy <j-keerthy@ti.com>, <a.zummo@towertech.it>, <nm@ti.com>,
	<rtc-linux@googlegroups.com>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] rtc: ds1307: Fix relying on reset value for weekday
Date: Wed, 15 Jun 2016 09:44:41 +0530	[thread overview]
Message-ID: <5760D631.1050006@ti.com> (raw)
In-Reply-To: <20160614143948.GP3240@piout.net>



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.

>

  reply	other threads:[~2016-06-15  4:14 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-01 10:49 [rtc-linux] [PATCH] rtc: ds1307: Fix relying on reset value for weekday Keerthy
2016-06-01 10:49 ` Keerthy
2016-06-01 12:18 ` [rtc-linux] " Alexandre Belloni
2016-06-01 12:18   ` Alexandre Belloni
2016-06-01 12:36   ` [rtc-linux] " Keerthy
2016-06-01 12:36     ` Keerthy
2016-06-07  9:29     ` [rtc-linux] " Keerthy
2016-06-07  9:29       ` Keerthy
2016-06-14 14:39       ` [rtc-linux] " Alexandre Belloni
2016-06-14 14:39         ` Alexandre Belloni
2016-06-15  4:14         ` Keerthy [this message]
2016-06-15  4:14           ` Keerthy
2016-07-08 14:25 ` [rtc-linux] " Alexandre Belloni
2016-07-08 14:25   ` 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=5760D631.1050006@ti.com \
    --to=a0393675@ti.com \
    --cc=a.zummo@towertech.it \
    --cc=alexandre.belloni@free-electrons.com \
    --cc=j-keerthy@ti.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nm@ti.com \
    --cc=rtc-linux@googlegroups.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.