Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 4 May 2016 13:48:59 +0000 (UTC)
From:      =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <royger@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r299064 - head/sys/kern
Message-ID:  <201605041348.u44Dmxd0092688@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: royger
Date: Wed May  4 13:48:59 2016
New Revision: 299064
URL: https://svnweb.freebsd.org/changeset/base/299064

Log:
  rtc: fix inverted resolution check
  
  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.
  
  Reviewed by:		kib jhb jkim
  Sponsored by:		Citrix Systems R&D
  MFC after:		2 weeks
  Differential revision:	https://reviews.freebsd.org/D6185

Modified:
  head/sys/kern/subr_rtc.c

Modified: head/sys/kern/subr_rtc.c
==============================================================================
--- head/sys/kern/subr_rtc.c	Wed May  4 12:51:27 2016	(r299063)
+++ head/sys/kern/subr_rtc.c	Wed May  4 13:48:59 2016	(r299064)
@@ -84,7 +84,7 @@ clock_register(device_t dev, long res)	/
 {
 
 	if (clock_dev != NULL) {
-		if (clock_res > res) {
+		if (clock_res <= res) {
 			if (bootverbose)
 				device_printf(dev, "not installed as "
 				    "time-of-day clock: clock %s has higher "



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201605041348.u44Dmxd0092688>