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


Groups > linux.kernel > #1286071

Re: [PATCH] RTC: RK808: Work around hardware bug on November 31st

From Julius Werner <jwerner@chromium.org>
Newsgroups linux.kernel
Subject Re: [PATCH] RTC: RK808: Work around hardware bug on November 31st
Date 2015-12-07 23:50 +0100
Message-ID <qDcLx-2nc-39@gated-at.bofh.it> (permalink)
References (9 earlier) <qCSWu-6fY-11@gated-at.bofh.it> <qCUbT-6VY-1@gated-at.bofh.it> <qCUbU-6VY-5@gated-at.bofh.it> <qCUlA-7fn-9@gated-at.bofh.it> <qDaA1-T7-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[+Alexandre... sorry, didn't notice that you somehow fell off the
thread again, but I presume you get rtc-linux anyway]

> Agreed, scheduling alarms in the future is also an important point. So
> I guess I'll update the patch to fix alarm scheduling and S3 as well,
> and we'll just ignore S5 as infeasible?

Found another edge case trying to implement this: if you set an alarm
on Nov 25th for Dec 5th, the code will have to adjust it to Dec 4th to
account for the extra day. But if you then power off (or brownout) to
S5 and don't power it on again until December, you have no way of
knowing whether the already set alarm timestamp is on the Rockchip or
the Gregorian calendar. You may or may not sync your current time back
through an external source, but you have no way of knowing what you
should do with the alarm.

Other than that my current idea is roughly:

- if the current time gets written, always assume the new date is correct
- store a "last known timestamp" in memory on boot and on every write
- if the current time gets read, adjust it forward by the amount of
Nov 31sts since the stored timestamp (this adjustment itself
constitutes a write)
- if an alarm is written, adjust the timestamp written to hardware
backward by the amount of Nov 31sts between the stored timestamp and
the alarm time
- if an alarm is read, adjust the returned result forward by the
amount of Nov 31sts between the stored timestamp and the alarm time
- if the current time gets written, read the alarm time before the
write and write it back afterwards (the last known timestamp will
change as a result of writing the current time, meaning the newly
written hardware alarm time may be different from the old one)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] RTC: RK808: Work around hardware bug on November 31st Julius Werner <jwerner@chromium.org> - 2015-12-03 03:00 +0100
  Re: [rtc-linux] [PATCH] RTC: RK808: Work around hardware bug on  November 31st Alexandre Belloni <alexandre.belloni@free-electrons.com> - 2015-12-03 15:50 +0100
    Re: [rtc-linux] [PATCH] RTC: RK808: Work around hardware bug on  November 31st Julius Werner <jwerner@chromium.org> - 2015-12-03 18:00 +0100
  Re: [PATCH] RTC: RK808: Work around hardware bug on November 31st Doug Anderson <dianders@chromium.org> - 2015-12-05 01:00 +0100
    Re: [PATCH] RTC: RK808: Work around hardware bug on November 31st Julius Werner <jwerner@chromium.org> - 2015-12-05 01:30 +0100
      Re: [PATCH] RTC: RK808: Work around hardware bug on November 31st Doug Anderson <dianders@chromium.org> - 2015-12-05 02:00 +0100
        Re: [PATCH] RTC: RK808: Work around hardware bug on November 31st Julius Werner <jwerner@chromium.org> - 2015-12-05 03:00 +0100
          Re: [PATCH] RTC: RK808: Work around hardware bug on November 31st Doug Anderson <dianders@chromium.org> - 2015-12-05 05:10 +0100
            Re: [PATCH] RTC: RK808: Work around hardware bug on November 31st Doug Anderson <dianders@chromium.org> - 2015-12-05 06:00 +0100
              Re: [PATCH] RTC: RK808: Work around hardware bug on November 31st Julius Werner <jwerner@chromium.org> - 2015-12-05 08:20 +0100
                Re: [PATCH] RTC: RK808: Work around hardware bug on November 31st Doug Anderson <dianders@chromium.org> - 2015-12-06 01:40 +0100
                Re: [PATCH] RTC: RK808: Work around hardware bug on November 31st Chris Zhong <zyw@rock-chips.com> - 2015-12-07 02:40 +0100
                Re: [PATCH] RTC: RK808: Work around hardware bug on November 31st Doug Anderson <dianders@chromium.org> - 2015-12-07 04:00 +0100
                Re: [PATCH] RTC: RK808: Work around hardware bug on November 31st Doug Anderson <dianders@chromium.org> - 2015-12-07 04:00 +0100
                Re: [PATCH] RTC: RK808: Work around hardware bug on November 31st Chris Zhong <zyw@rock-chips.com> - 2015-12-07 04:10 +0100
                Re: [PATCH] RTC: RK808: Work around hardware bug on November 31st Julius Werner <jwerner@chromium.org> - 2015-12-07 21:30 +0100
                Re: [PATCH] RTC: RK808: Work around hardware bug on November 31st Julius Werner <jwerner@chromium.org> - 2015-12-07 23:50 +0100
                Re: [PATCH] RTC: RK808: Work around hardware bug on November 31st Doug Anderson <dianders@chromium.org> - 2015-12-08 02:20 +0100
                Re: [PATCH] RTC: RK808: Work around hardware bug on November 31st Julius Werner <jwerner@chromium.org> - 2015-12-08 02:50 +0100
                Re: [PATCH] RTC: RK808: Work around hardware bug on November 31st Julius Werner <jwerner@chromium.org> - 2015-12-08 06:30 +0100
                [PATCH v2] RTC: RK808: Work around hardware bug on November 31st Julius Werner <jwerner@chromium.org> - 2015-12-08 06:30 +0100
                Re: [PATCH v2] RTC: RK808: Work around hardware bug on November 31st Doug Anderson <dianders@chromium.org> - 2015-12-09 06:50 +0100
                Re: [PATCH v2] RTC: RK808: Work around hardware bug on November 31st Julius Werner <jwerner@chromium.org> - 2015-12-09 22:40 +0100
                Re: [PATCH v2] RTC: RK808: Work around hardware bug on November 31st Alexandre Belloni <alexandre.belloni@free-electrons.com> - 2015-12-10 19:50 +0100
                Re: [PATCH v2] RTC: RK808: Work around hardware bug on November 31st Julius Werner <jwerner@chromium.org> - 2015-12-10 20:00 +0100

csiph-web