Module Name:    src
Committed By:   jruoho
Date:           Sun Aug 22 04:42:57 UTC 2010

Modified Files:
        src/sys/arch/x86/acpi: acpi_cpu_md.c

Log Message:
Still DELAY(9) a little even when we do not do the status-check.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/x86/acpi/acpi_cpu_md.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/x86/acpi/acpi_cpu_md.c
diff -u src/sys/arch/x86/acpi/acpi_cpu_md.c:1.29 src/sys/arch/x86/acpi/acpi_cpu_md.c:1.30
--- src/sys/arch/x86/acpi/acpi_cpu_md.c:1.29	Sat Aug 21 18:25:45 2010
+++ src/sys/arch/x86/acpi/acpi_cpu_md.c	Sun Aug 22 04:42:57 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_cpu_md.c,v 1.29 2010/08/21 18:25:45 jruoho Exp $ */
+/* $NetBSD: acpi_cpu_md.c,v 1.30 2010/08/22 04:42:57 jruoho Exp $ */
 
 /*-
  * Copyright (c) 2010 Jukka Ruohonen <jruoho...@iki.fi>
@@ -27,7 +27,7 @@
  * SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_cpu_md.c,v 1.29 2010/08/21 18:25:45 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_cpu_md.c,v 1.30 2010/08/22 04:42:57 jruoho Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -510,18 +510,23 @@
 	xc_wait(xc);
 
 	if (__predict_false(ps->ps_status == 0))
-		return 0;
+		goto out;
 
 	if (__predict_false(ps->ps_status_addr == 0))
-		return 0;
+		goto out;
 
 	if ((ps->ps_flags & ACPICPU_FLAG_P_TURBO) != 0)
-		return 0;
+		goto out;
 
 	xc = xc_broadcast(0, (xcfunc_t)acpicpu_md_pstate_status, ps, &rv);
 	xc_wait(xc);
 
 	return rv;
+
+out:
+	DELAY(ps->ps_latency);
+
+	return 0;
 }
 
 static void
@@ -587,8 +592,10 @@
 	xc = xc_broadcast(0, (xcfunc_t)x86_msr_xcall, &msr, NULL);
 	xc_wait(xc);
 
-	if (ts->ts_status == 0)
+	if (ts->ts_status == 0) {
+		DELAY(ts->ts_latency);
 		return 0;
+	}
 
 	xc = xc_broadcast(0, (xcfunc_t)acpicpu_md_tstate_status, ts, &rv);
 	xc_wait(xc);

Reply via email to