From e46b6ea21b7116a8c46c4178c0106e239e5ba8fa Mon Sep 17 00:00:00 2001 From: njl Date: Thu, 4 Mar 2004 05:17:52 +0000 Subject: Don't disable Cx support and throttling on machines with a P_BLK_LEN != 6 even though the spec mandates this. Some have a value of 5 to indicate throttling + C2 and some have 7 to indicate an extra C3 state. Support throttling if the value is >= 4, C2 for >= 5, and C3 for >= 6. --- sys/dev/acpica/acpi_cpu.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'sys/dev') diff --git a/sys/dev/acpica/acpi_cpu.c b/sys/dev/acpica/acpi_cpu.c index 5601b35..29dc322 100644 --- a/sys/dev/acpica/acpi_cpu.c +++ b/sys/dev/acpica/acpi_cpu.c @@ -394,8 +394,12 @@ acpi_cpu_throttle_probe(struct acpi_cpu_softc *sc) /* If _PTC not present or other failure, try the P_BLK. */ if (sc->cpu_p_cnt == NULL) { - /* The spec says P_BLK must be at least 6 bytes long. */ - if (sc->cpu_p_blk == 0 || sc->cpu_p_blk_len != 6) + /* + * The spec says P_BLK must be 6 bytes long. However, some + * systems use it to indicate a fractional set of features + * present so we take anything >= 4. + */ + if (sc->cpu_p_blk_len < 4) return (ENXIO); gas.Address = sc->cpu_p_blk; gas.AddressSpaceId = ACPI_ADR_SPACE_SYSTEM_IO; @@ -447,7 +451,14 @@ acpi_cpu_cx_probe(struct acpi_cpu_softc *sc) cx_ptr++; sc->cpu_cx_count++; - if (sc->cpu_p_blk_len != 6) + /* + * The spec says P_BLK must be 6 bytes long. However, some systems + * use it to indicate a fractional set of features present so we + * take 5 as C2. Some may also have a value of 7 to indicate + * another C3 but most use _CST for this (as required) and having + * "only" C1-C3 is not a hardship. + */ + if (sc->cpu_p_blk_len < 5) goto done; /* Validate and allocate resources for C2 (P_LVL2). */ @@ -465,6 +476,8 @@ acpi_cpu_cx_probe(struct acpi_cpu_softc *sc) sc->cpu_cx_count++; } } + if (sc->cpu_p_blk_len < 6) + goto done; /* Validate and allocate resources for C3 (P_LVL3). */ if (AcpiGbl_FADT->Plvl3Lat < 1000 && -- cgit v1.1