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)
Mon, Apr 15, 1:13 PM
Unknown Object (File)
Dec 20 2023, 1:30 AM
Unknown Object (File)
Nov 5 2023, 10:41 PM
Unknown Object (File)
Oct 19 2023, 9:13 PM
Unknown Object (File)
Oct 4 2023, 9:38 PM
Unknown Object (File)
Sep 30 2023, 9:40 PM
Unknown Object (File)
Sep 6 2023, 10:31 PM
Unknown Object (File)
Sep 6 2023, 10:30 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.