Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 11 Nov 2013 15:00:15 -0500
From:      Jung-uk Kim <jkim@FreeBSD.org>
To:        freebsd-acpi <freebsd-acpi@freebsd.org>
Subject:   Fwd: Re: Problems with amd FX 8 core and freq scaling
Message-ID:  <5281374F.7080802@FreeBSD.org>
In-Reply-To: <5281358D.1010406@FreeBSD.org>
References:  <5281358D.1010406@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------020705030408060006020301
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 2013-11-11 13:16:47 -0500, Nicholas McKenzie wrote:
> But wouldn't this just disable frequency scaling and the whole 
> point of powerd?

No.  acpi_throttle (and p4tcc) controls T-state.  "Frequency scaling"
should be done by changing P-state.

> On Mon, Nov 11, 2013 at 1:46 AM, Stefan Esser <se@freebsd.org> 
> wrote:
>> 
>> Am 10.11.2013 22:46, schrieb Nicholas Stewart McKenzie:
>>> My computer crashes if I enable powerd. I can't get cpu freq 
>>> scaling to work with my cpu:(P.S. I sent this to both drivers 
>>> and amd64 mailing list...
>> 
>> Hi,
>> 
>> you may want to try booting with the following line added to 
>> /boot/loader.conf (or entered at the boot menu prompt after 
>> breaking out of automatic boot):
>> 
>> hint.acpi_throttle.0.disabled="1"
>> 
>> There have been a number of reports of throttling causing 
>> crashes. This setting does not prevent powerd from adjusting
>> your CPU's clock, it just disables some arcane feature which
>> pre-dates the modern power management methods.

I rewrote acpi_throttle.c at some point to fix the problem but never
committed it because nobody was really interested in testing the
patch.  Also, it is really an arcane and archaic feature:

http://software.intel.com/en-us/blogs/2013/10/15/c-states-p-states-where-the-heck-are-those-t-states

Now I think we should disable the feature by default because it is
causing too much hassle for us (attached).  Any objection?

Jung-uk Kim
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (FreeBSD)

iQEcBAEBAgAGBQJSgTdPAAoJEHyflib82/FGZaEIAJPt2/qPu7CxFAHBwizG+o+Y
Mmn0rqXREynXT83ds5cD998cO44GHFGhSaDYZ6wuL6CXoSE2bzTo5aAjVq/vY6io
4ItmvZPVNKK/UxeTK+ccDeuMKBXHBmOoUUUADGRy1d9S+GGtie0DVSpWZhEvSFrY
l/y1Dt3yd53qjlV96GcKqGYO6EyzlDq1tlO7jog28x8oDfz6W6KyXRL3evpqn/Mb
Y1B3anULsxbOMPN1hXcgBIA11SOdCCIe5zifldeAn1CCq3hMVxmIyH04dpVq9eBp
p7QpA+4KDLGwoXMYDL1dlL8kK0bCIWUB5FIFcJrBfcPYhv0FduX736NzufRvncc=
=ZSMa
-----END PGP SIGNATURE-----

--------------020705030408060006020301
Content-Type: text/x-patch;
 name="cpu_throttle.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="cpu_throttle.diff"

Index: sys/dev/acpica/acpi_throttle.c
===================================================================
--- sys/dev/acpica/acpi_throttle.c	(revision 258002)
+++ sys/dev/acpica/acpi_throttle.c	(working copy)
@@ -167,7 +167,7 @@ static int
 acpi_throttle_probe(device_t dev)
 {
 
-	if (resource_disabled("acpi_throttle", 0))
+	if (!resource_enabled("acpi_throttle", 0))
 		return (ENXIO);
 
 	/*
@@ -177,7 +177,7 @@ acpi_throttle_probe(device_t dev)
 	 * we disable acpi_throttle when p4tcc is also present.
 	 */
 	if (device_find_child(device_get_parent(dev), "p4tcc", -1) &&
-	    !resource_disabled("p4tcc", 0))
+	    resource_ensabled("p4tcc", 0))
 		return (ENXIO);
 
 	device_set_desc(dev, "ACPI CPU Throttling");
Index: sys/kern/subr_hints.c
===================================================================
--- sys/kern/subr_hints.c	(revision 258002)
+++ sys/kern/subr_hints.c	(working copy)
@@ -449,15 +449,29 @@ resource_find_dev(int *anchor, const char *name, i
 }
 
 /*
- * Check to see if a device is disabled via a disabled hint.
+ * Check to see if a device is disabled or enabled via a hint.
  */
-int
-resource_disabled(const char *name, int unit)
+static __inline int
+resource_find_hint(const char *name, int unit, const char *hint)
 {
 	int error, value;
 
-	error = resource_int_value(name, unit, "disabled", &value);
+	error = resource_int_value(name, unit, hint, &value);
 	if (error)
 	       return (0);
 	return (value);
 }
+
+int
+resource_disabled(const char *name, int unit)
+{
+
+	return (resource_find_hint(name, unit, "disabled"));
+}
+
+int
+resource_enabled(const char *name, int unit)
+{
+
+	return (resource_find_hint(name, unit, "enabled"));
+}
Index: sys/sys/bus.h
===================================================================
--- sys/sys/bus.h	(revision 258002)
+++ sys/sys/bus.h	(working copy)
@@ -503,6 +503,7 @@ int	resource_long_value(const char *name, int unit
 int	resource_string_value(const char *name, int unit, const char *resname,
 			      const char **result);
 int	resource_disabled(const char *name, int unit);
+int	resource_enabled(const char *name, int unit);
 int	resource_find_match(int *anchor, const char **name, int *unit,
 			    const char *resname, const char *value);
 int	resource_find_dev(int *anchor, const char *name, int *unit,
Index: sys/x86/cpufreq/p4tcc.c
===================================================================
--- sys/x86/cpufreq/p4tcc.c	(revision 258002)
+++ sys/x86/cpufreq/p4tcc.c	(working copy)
@@ -142,7 +142,7 @@ static int
 p4tcc_probe(device_t dev)
 {
 
-	if (resource_disabled("p4tcc", 0))
+	if (!resource_enabled("p4tcc", 0))
 		return (ENXIO);
 
 	device_set_desc(dev, "CPU Frequency Thermal Control");


--------------020705030408060006020301--



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