Page MenuHomeFreeBSD

rtc: fix inverted resolution check
ClosedPublic

Authored by royger on May 3 2016, 9:55 AM.
Tags
None
Referenced Files
Unknown Object (File)
Oct 31 2024, 6:06 AM
Unknown Object (File)
Oct 8 2024, 4:52 AM
Unknown Object (File)
Sep 16 2024, 2:31 PM
Unknown Object (File)
Sep 16 2024, 10:30 AM
Unknown Object (File)
Sep 8 2024, 11:33 AM
Unknown Object (File)
Sep 7 2024, 7:48 PM
Unknown Object (File)
Sep 7 2024, 3:50 PM
Unknown Object (File)
Aug 21 2024, 9:31 PM
Subscribers

Details

Summary

The current code in clock_register checks if the newly added clock has a
resolution value higher than the current one in order to make it the
default, which is wrong. Clocks with a lower resolution value should be
better than ones with a higher resolution value, in fact with the current
code FreeBSD is always selecting the worse clock.

Sponsored by: Citrix Systems R&D

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

royger retitled this revision from to rtc: fix inverted resolution check.
royger updated this object.
royger edited the test plan for this revision. (Show Details)
royger added reviewers: jkim, lstewart, jhb, kib.
kib edited edge metadata.

Was it dormant because typical system is x86 with only one RTC clock ?

This revision is now accepted and ready to land.May 3 2016, 11:51 AM
jhb edited edge metadata.

It's also kind of "backwards" (like thread priorities) where a numerically lower value means "higher" precision (i.e. more precise). Given the text in the printf I think it's easy to get the expression wrong.

jkim edited edge metadata.
In D6185#131704, @kib wrote:

Was it dormant because typical system is x86 with only one RTC clock ?

AFAICT yes, most platforms only have one clock available, so this bug has never surfaced.

Thanks all for the review.

This revision was automatically updated to reflect the committed changes.