Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvements to iphb client wakeups and rtc time/alarm management #8

Merged
merged 5 commits into from May 30, 2013
Merged

Improvements to iphb client wakeups and rtc time/alarm management #8

merged 5 commits into from May 30, 2013

Conversation

spiiroin
Copy link
Contributor

The rtc time is synchronized to system in two phases. First the rtc
time of day is brought within one second of system time. Then
sub-second timer is used to write rtc time of day again when system
time is just past full second. Effectively this should make rtc wakeup
alarms both more accurate (since the rtc is closer to system time) and
less frequent (since rtc should always be a bit behind system time and
thus the normal timers trigger before rtc alarms as long as the system
is not suspended).

Also while libiphb api still uses full seconds for wakeup ranges, they
are processed internally in us/ms accuracy. This should limit the odd
+/-1 second issues resulting from mixed use of system time, monotonic
clock and rtc time of day.

If libiphb clients request too wide mintime-maxtime range for the
wakeup, the mintime is moved closer to maxtime.

Also the client wakeups are done as late as possible, but if there are
external clients that must be woken up, all eligible clients are woken
up at the same time.

[iphb] Improvements to iphb client wakeups and rtc time/alarm management

The rtc time is synchronized to system in two phases. First the rtc
time of day is brought within one second of system time. Then
sub-second timer is used to write rtc time of day again when system
time is just past full second. Effectively this should make rtc wakeup
alarms both more accurate (since the rtc is closer to system time) and
less frequent (since rtc should always be a bit behind system time and
thus the normal timers trigger before rtc alarms as long as the system
is not suspended).

Also while libiphb api still uses full seconds for wakeup ranges, they
are processed internally in us/ms accuracy. This should limit the odd
+/-1 second issues resulting from mixed use of system time, monotonic
clock and rtc time of day.

If libiphb clients request too wide mintime-maxtime range for the
wakeup, the mintime is moved closer to maxtime.

Also the client wakeups are done as late as possible, but if there are
external clients that must be woken up, all eligible clients are woken
up at the same time.

[iphb] Improvements to iphb client wakeups and rtc time/alarm management
To support IPHB_GS_WAIT_30_SEC and IPHB_GS_WAIT_2_5_MINS the global slot
wakeup requests must be rounded to 30 seconds instead of full minutes.
@rburchell
Copy link

With the advent of git packaging, you'll want to use [FOO] type prefixes on your commit messages, where FOO might be dsme in this case. Each tagged release must have at least one such prefix, otherwise it won't build.

The RPM changelog is automatically generated from these messages.

P.S. will this fix constant spam like this?:

May 27 15:04:08 localhost DSME[254]: IPHB: read /dev/rtc0: type=0xa0, count=1
May 27 15:04:08 localhost DSME[254]: IPHB: rtc alarm disabled
May 27 15:04:08 localhost DSME[254]: IPHB: rtc alarm @ 2013-05-27 12:04:21

because that's starting to make debugging really annoying.

@spiiroin
Copy link
Contributor Author

I've understood that the preferred way is not to have the [feature] in the "commit title", hence the last
line "[iphb] Improvements to iphb client wakeups and rtc time/alarm management" is meant to go to
the changelog.

The "IPHB: read /dev/rtc0: type=0xa0, count=1" is not spam. It just highlighted that there were issues
with using one second accuracy while dealing with multiple clock sources. It should have come only
when the device wakes up from suspend to handle an iphb timer. I'd like to keep it there, since if it
still annoys people we need further fixing. (The log message is jibberish though, I'll fix it)

The "rtc alarm this and that" however were debug spam and are no longer emitted by default.

Also sets rtc time only once if finetuning timer is not needed.
@spiiroin
Copy link
Contributor Author

Just realized that also the "IPHB: read /dev/rtc0: type=0xa0, count=1" diagnostics were omitted by default.
They still are, but now - in verbose mode - the output will be "woke up to handle rtc wakeup alarm".

spiiroin added a commit that referenced this pull request May 30, 2013
Improvements to iphb client wakeups and rtc time/alarm management
@spiiroin spiiroin merged commit 40921f4 into nemomobile:master May 30, 2013
@spiiroin spiiroin deleted the rtc_and_iphb_fixes branch May 30, 2013 06:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants