Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 27 Jul 2016 11:34:25 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r303385 - head/sys/kern
Message-ID:  <201607271134.u6RBYPPO085716@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Wed Jul 27 11:34:25 2016
New Revision: 303385
URL: https://svnweb.freebsd.org/changeset/base/303385

Log:
  Reduce the resettodr_lock scope to only CLOCK_SETTIME() call.
  
  Tested by:	pho (as part of the whole patch)
  Reviewed by:	jhb (same)
  Discussed with:	bde
  Sponsored by:	The FreeBSD Foundation
  MFC after:	1 month
  X-Differential revision:	https://reviews.freebsd.org/D7302

Modified:
  head/sys/kern/subr_rtc.c

Modified: head/sys/kern/subr_rtc.c
==============================================================================
--- head/sys/kern/subr_rtc.c	Wed Jul 27 11:33:33 2016	(r303384)
+++ head/sys/kern/subr_rtc.c	Wed Jul 27 11:34:25 2016	(r303385)
@@ -172,11 +172,11 @@ resettodr(void)
 	if (disable_rtc_set || clock_dev == NULL)
 		return;
 
-	mtx_lock(&resettodr_lock);
 	getnanotime(&ts);
 	timespecadd(&ts, &clock_adj);
 	ts.tv_sec -= utc_offset();
 	/* XXX: We should really set all registered RTCs */
+	mtx_lock(&resettodr_lock);
 	error = CLOCK_SETTIME(clock_dev, &ts);
 	mtx_unlock(&resettodr_lock);
 	if (error != 0)



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