Laptop troubles...
Nate Lawson
nate at root.org
Mon Nov 15 19:45:12 PST 2004
Adam K Kirchhoff wrote:
> Nate Lawson wrote:
>> Right, thanks for the reminder. I actually have quirk code to do this
>> but it wasn't enabled since I wanted to find an actual test case
>> before turning it on. Adam, please recompile with the attached
>> patch. Also, send me pciconf -l. The patch will disable C3 and you
>> should only get C1/C2 if your system is truly a PIIX4.
>>
>> Thanks,
>> Nate
>
>
>
> With that patch, I still have the option of setting C3. And, if I do, I
> get the lockups. I'm attaching the output of pciconf -l.
Take 2. This patch defers quirks till later.
-Nate
-------------- next part --------------
Index: sys/dev/acpica/acpi_cpu.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/acpica/acpi_cpu.c,v
retrieving revision 1.45
diff -u -r1.45 acpi_cpu.c
--- sys/dev/acpica/acpi_cpu.c 11 Oct 2004 21:15:10 -0000 1.45
+++ sys/dev/acpica/acpi_cpu.c 16 Nov 2004 02:30:36 -0000
@@ -299,10 +299,6 @@
SYSCTL_CHILDREN(acpi_sc->acpi_sysctl_tree),
OID_AUTO, "cpu", CTLFLAG_RD, 0, "");
- /* If this is the first device probed, check for quirks. */
- if (device_get_unit(dev) == 0)
- acpi_cpu_quirks(sc);
-
/*
* Probe for throttling and Cx state support.
* If none of these is present, free up unused resources.
@@ -674,6 +670,10 @@
/* Get set of CPU devices */
devclass_get_devices(acpi_cpu_devclass, &cpu_devices, &cpu_ndevices);
+ /* Check for quirks via the first CPU device. */
+ sc = device_get_softc(cpu_devices[0]);
+ acpi_cpu_quirks(sc);
+
/*
* Make sure all the processors' Cx counts match. We should probably
* also check the contents of each. However, no known systems have
@@ -702,6 +702,10 @@
acpi_cpu_startup_throttling()
{
+ /* If throttling is not usable, don't initialize it. */
+ if (cpu_quirks & CPU_QUIRK_NO_THROTTLE)
+ return;
+
/* Initialise throttling states */
cpu_throttle_max = CPU_MAX_SPEED;
cpu_throttle_state = CPU_MAX_SPEED;
@@ -737,13 +741,22 @@
acpi_cpu_startup_cx()
{
struct acpi_cpu_softc *sc;
- struct sbuf sb;
+ struct sbuf sb;
int i;
+ /*
+ * Set up the list of Cx states, eliminating C3 states by truncating
+ * cpu_cx_count if quirks indicate C3 is not usable.
+ */
sc = device_get_softc(cpu_devices[0]);
sbuf_new(&sb, cpu_cx_supported, sizeof(cpu_cx_supported), SBUF_FIXEDLEN);
- for (i = 0; i < cpu_cx_count; i++)
- sbuf_printf(&sb, "C%d/%d ", i + 1, sc->cpu_cx_states[i].trans_lat);
+ for (i = 0; i < cpu_cx_count; i++) {
+ if ((cpu_quirks & CPU_QUIRK_NO_C3) == 0 ||
+ sc->cpu_cx_states[i].type != ACPI_STATE_C3)
+ sbuf_printf(&sb, "C%d/%d ", i + 1, sc->cpu_cx_states[i].trans_lat);
+ else
+ cpu_cx_count = i;
+ }
sbuf_trim(&sb);
sbuf_finish(&sb);
SYSCTL_ADD_STRING(&acpi_cpu_sysctl_ctx,
@@ -966,6 +979,7 @@
static int
acpi_cpu_quirks(struct acpi_cpu_softc *sc)
{
+ device_t acpi_dev;
/*
* C3 on multiple CPUs requires using the expensive flush cache
@@ -974,7 +988,6 @@
if (mp_ncpus > 1)
cpu_quirks |= CPU_QUIRK_NO_BM_CTRL;
-#ifdef notyet
/* Look for various quirks of the PIIX4 part. */
acpi_dev = pci_find_device(PCI_VENDOR_INTEL, PCI_DEVICE_82371AB_3);
if (acpi_dev != NULL) {
@@ -1011,7 +1024,6 @@
break;
}
}
-#endif
return (0);
}
More information about the freebsd-acpi
mailing list