Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 9 Jan 2014 10:45:38 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r260474 - stable/9/sys/x86/cpufreq
Message-ID:  <201401091045.s09AjcFi083701@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Thu Jan  9 10:45:37 2014
New Revision: 260474
URL: http://svnweb.freebsd.org/changeset/base/260474

Log:
  MFC r259197:
  Do not DELAY() for P-state transition unless we want to see the result.
  
  Intel manual says: "If a transition is already in progress, transition to
  a new value will subsequently take effect. Reads of IA32_PERF_CTL determine
  the last targeted operating point."  So seems it should be fine to just
  trigger wanted transition and go.  Linux does the same.

Modified:
  stable/9/sys/x86/cpufreq/est.c
Directory Properties:
  stable/9/   (props changed)
  stable/9/sys/   (props changed)

Modified: stable/9/sys/x86/cpufreq/est.c
==============================================================================
--- stable/9/sys/x86/cpufreq/est.c	Thu Jan  9 10:44:27 2014	(r260473)
+++ stable/9/sys/x86/cpufreq/est.c	Thu Jan  9 10:45:37 2014	(r260474)
@@ -1288,10 +1288,9 @@ est_set_id16(device_t dev, uint16_t id16
 	msr = (msr & ~0xffff) | id16;
 	wrmsr(MSR_PERF_CTL, msr);
 
-	/* Wait a short while for the new setting.  XXX Is this necessary? */
-	DELAY(EST_TRANS_LAT);
-
 	if  (need_check) {
+		/* Wait a short while and read the new status. */
+		DELAY(EST_TRANS_LAT);
 		est_get_id16(&new_id16);
 		if (new_id16 != id16) {
 			if (bootverbose)



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