Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 26 Aug 2016 09:40:34 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r304841 - stable/11/sys/kern
Message-ID:  <201608260940.u7Q9eYHc038130@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Fri Aug 26 09:40:34 2016
New Revision: 304841
URL: https://svnweb.freebsd.org/changeset/base/304841

Log:
  MFC r303385:
  Reduce the resettodr_lock scope to only CLOCK_SETTIME() call.

Modified:
  stable/11/sys/kern/subr_rtc.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/kern/subr_rtc.c
==============================================================================
--- stable/11/sys/kern/subr_rtc.c	Fri Aug 26 09:38:25 2016	(r304840)
+++ stable/11/sys/kern/subr_rtc.c	Fri Aug 26 09:40:34 2016	(r304841)
@@ -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?201608260940.u7Q9eYHc038130>