Re: [PATCH] rtc-m48t59: fix setting of a year on m48t08 and m48t02 rtcs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2008/10/19 Krzysztof Helt <krzysztof.h1@xxxxxxxxx>:
> On Tue, 14 Oct 2008 02:12:54 +0400
> "Alexander Beregalov" <a.beregalov@xxxxxxxxx> wrote:
>
>> 2008/10/14 Krzysztof Helt <krzysztof.h1@xxxxxxxxx>:
>> > Hi Alexander,
>> Hi
>> >
>> > Please try the patch below if it fixes your problem. You need to set
>> > correct date (year) after the patched kernel is run.
>> Unfortunatelly, it does not work for me.
>>
>> I patch kernel and reboot.
>> I set correct date and save it (hwclock --systohc (from
>> util-linux-2.14)) and reboot.
>> Kernel sets date to
>> rtc-m48t59 rtc-m48t59.0: setting system clock to 2108-10-14 01:32:24

It seems to me the problem is here:

drivers/rtc/rtc-m48t59.c
static int m48t59_rtc_read_time(struct device *dev, struct rtc_time *tm)

/*  tm->tm_year is 108 here */
        val = M48T59_READ(M48T59_WDAY);
        if ((pdata->type == M48T59RTC_TYPE_M48T59) &&
            (val & M48T59_WDAY_CEB) && (val & M48T59_WDAY_CB)) {
                dev_dbg(dev, "Century bit is enabled\n");
                tm->tm_year += 100;     /* one century */
        }
/* tm->tm_year  is 208 here */

Finally year becomes 2108.

It should not enter this condition.
Is it obvously how to rewrite the condition or is the problem in another place?
--
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Development]     [DCCP]     [Linux ARM Development]     [Linux]     [Photo]     [Yosemite Help]     [Linux ARM Kernel]     [Linux SCSI]     [Linux x86_64]     [Linux Hams]

  Powered by Linux