Commit Graph

976 Commits

Author SHA1 Message Date
jruoho
7aa250c707 Do not queue functions via sysmon_taskq(9) in the pmf(9) resume hooks.
There is a small and unlikely race when the drivers are loaded as modules;
suspend, resume, queue a function, and immediately unload the module.
2010-08-14 05:41:22 +00:00
jruoho
1f0e85dcbd Move the PIIX4-quirk to the MD file and disable T-states for PIIX4. 2010-08-14 05:13:20 +00:00
jruoho
1a6fcb7e2a Explicitly include <sys/evcnt.h>. 2010-08-13 19:51:54 +00:00
jruoho
25630fd34e Instead of packing structures that do not need to be __packed, remove two
CTASSERT(9) macros.  Fixes build failure on AMD64 noted by cegger@.
2010-08-13 19:48:25 +00:00
jruoho
3d52b10fd5 Remove some unnecessary locking. Mainly a leftover from previous revisions
where the dynamic maximum/minimum was used also when retrieving the current
state. The state-array itself changes only in C-states.
2010-08-13 18:44:24 +00:00
jruoho
6b9ff1079c Merge T-state a.k.a. throttling support for acpicpu(4).
Remarks:

  1.    Native instructions are supported only on Intel. Native support for
        other x86 vendors will be investigated. By assumption, AMD and others
        use the I/O based approach.

  2.    The existing code, INTEL_ONDEMAND_CLOCKMOD, must be disabled in
        order to use acpicpu(4). Otherwise fatal MSR races may occur.
        Unlike with P-states, no attempt is done to disable the existing
        implementation.

  3.    There is no rationale to export controls to user land.

  4.    Throttling is an artefact from the past. T-states will not be used for
        power management per se. For CPU frequency management, P-states are
        preferred in all circumstances. No noticeable additional power savings
        were observed in various experiments. When the system has been scaled
        to the highest (i.e. lowest power) P-state, it is preferable to move
        from C0 to deeper C-states than it is to actively throttle the CPU.

  5.    But T-states need to be implemented for passive cooling via acpitz(4).
        As specified by ACPI and Intel documents, these can be used as the
        last line of defence against critical thermal conditions. Support
        for this will be added later.
2010-08-13 16:21:50 +00:00
jruoho
c4e35077eb Three small things: (1) fix off by one, (2) protect the cached P-state
(required for interaction with T-states), and (3) use aprint_debug(9)
instead of the ACPI_DEBUG_PRINT(x) macro for the dynamic frequency changes
(for the time being, people need easier way to observe the dynamic changes).
2010-08-12 06:17:14 +00:00
jruoho
aa6fdddc15 Properly protect against garbage values. 2010-08-11 18:15:52 +00:00
jruoho
675dfd8bb3 Print the state information only once. The per-CPU information was quite
pointless as identical parameters are expected across processors.
2010-08-11 16:41:19 +00:00
jruoho
7a63961323 Check the 'sc->sc_cold' flag also in P-state code, and set this flag once
we start the detachment routine.
2010-08-11 16:22:18 +00:00
jruoho
33733d6120 Add a small additional check for the validity of the GAS register. 2010-08-11 13:02:59 +00:00
jruoho
0963b3f611 Use a define instead of a magic constant for the arbitrary P-state limit. 2010-08-11 11:48:21 +00:00
jruoho
7598fbdbbd Pretty printing. 2010-08-11 10:44:07 +00:00
gsutre
8e80a0a5b0 acpi_print_tree: print ACPI and PCI autoconf(9) device names.
ok jruoho@
2010-08-11 10:32:42 +00:00
jruoho
69855d87bf Fix xref in a comment. 2010-08-10 05:22:07 +00:00
jruoho
06ea2864c4 Add a XXX-comment as a TODO. From jmcneill@:
/*
         * XXX: The pci_find_device(9) function only deals with
         *      attached devices. Change this to use something like
         *      pci_device_foreach(), and implement it for IA-64.
         */
2010-08-10 04:38:06 +00:00
jruoho
afd0718108 Use evcnt(9) for the counters. 2010-08-10 02:42:05 +00:00
jruoho
c832263680 On systems where both the existing EST code and the one provided by ACPI are
functional, the previously loaded EST code may have used frequencies that
are not present in the BIOS. This will cause failures since acpicpu(4) will
treat these unknown frequencies as errors. "Fix" this by initializing the
cached P-state to P0, regardless of what the true state might be.
2010-08-09 15:56:45 +00:00
jruoho
af42249343 Remove a redundant function. 2010-08-09 13:41:38 +00:00
gsutre
474664a934 acpi_pcidev_scan: attach PCI information only to working devices.
ok jruoho@
2010-08-09 09:36:42 +00:00
jruoho
eb3ca71af1 Downgrade the currently supported maximum C-state to C1. There appears to be
timer-related interrupt issues also in C2. With C1 it is guaranteed that
acpicpu(4) will not cause any slowdowns due stalled local APIC timer.
2010-08-09 05:00:24 +00:00
jruoho
c72ee2046d When retrieving the current frequency, scan all available P-states.
Only use the dynamic maximum when setting a frequency.
2010-08-09 04:27:07 +00:00
jruoho
d4f0008ba0 jmcneill@: do not touch the bus_space(9) handle. 2010-08-08 18:47:54 +00:00
jruoho
337dd64961 Improve error and debug messages. 2010-08-08 18:25:06 +00:00
jruoho
5520795ab6 As per jmcneill@'s suggestion, improve error reporting. 2010-08-08 18:10:34 +00:00
jruoho
9f5abae832 Add P-states. (I blame the ease of using modules.) 2010-08-08 17:21:14 +00:00
jruoho
1e80cb5566 Remove bogus check and allow all CPUs to use I/O-based P-states. 2010-08-08 17:05:50 +00:00
jruoho
53e8f6c919 Merge P-state support for acpicpu(4).
Remarks:

  1.    All processors (x86 or not) for which the vendor has implemented
        ACPI I/O access routines are supported. Native instructions are
        currently supported only for Intel's "Enhanced Speedstep". Code for
        "PowerNow!" (AMD) will be merged later. Native support for VIA's
        "PowerSaver" will be investigated.

  2.    Backwards compatibility with existing userland code is maintained.
        Comparable to the case with cpu_idle(9), the ACPI CPU driver
        installs alternative functions for the existing sysctl(8) controls.
        The "native" behavior (if any) is restored upon detachment.

  3.    The dynamic nature of ACPI-provided P-states needs more investigation.
        The maximum frequency induced (but not forced) by the firmware may
        change dynamically. Currently, the sysctl(8) controls error out with
        a value larger than the dynamic maximum. The code itself does not
        however yet react to the notifications from the firmware by changing
        the frequencies in-place. Presumably the system administrator should
        be able to choose whether to use dynamic or static frequencies.
2010-08-08 16:58:41 +00:00
gsutre
110cd99be7 acpi_pcidev_scan: discard invalid PCI addresses. 2010-08-08 16:26:47 +00:00
jruoho
6745d5be67 Do not try to disable ACPI if we can not enter to legacy mode. While it is
safe to call AcpiDisable() even if a system operates only in ACPI mode, this
leads to unpleasantly verbose error messages in ACPICA.
2010-08-07 20:07:25 +00:00
jruoho
2146168c62 Allow to dump the basic information at runtime with a flag to modload(8).
This can help when dealing with problem reports, as the user does not need
to reboot nor compile a kernel. Instead: 'modload -b dump=true acpiverbose'.
2010-08-07 18:59:53 +00:00
jruoho
40f2c5cbe7 Fix build failure. 2010-08-07 17:12:55 +00:00
jruoho
3319c9a659 Dump MADT in ACPIVERBOSE. 2010-08-07 14:17:21 +00:00
jruoho
21753466cc Remove the last ACPI driver -specific #ifdef, ACPI_FDC_DEBUG. 2010-08-07 09:55:59 +00:00
jruoho
6e6e026403 Reorganize: also the APIC tables will be dumped in ACPIVERBOSE, and the
callback functions will be modified to be suitable also with other tables.
2010-08-07 09:41:19 +00:00
jruoho
77da05df17 Dump the whole FADT in ACPIVERBOSE. 2010-08-07 08:59:51 +00:00
jruoho
e1035e2b84 Simplify the acpiverbose module. 2010-08-06 23:38:34 +00:00
jruoho
460de0d614 Remove the acpiwmi(4) dump from the ACPIVERBOSE module. Instead of this
complex solution, just use aprint_debug(9) in the driver.
2010-08-06 22:45:00 +00:00
jruoho
2a35c4cf20 Fix prototypes; SYSCTLFN_ARGS -> SYSCTLFN_PROTO.
(These things really only obscure the code.)
2010-08-06 18:10:40 +00:00
jruoho
d8b9e18823 Store the MADT-derived CPU ID to <x86/cpu.h>. This is required to properly
match the ACPI processor object ID with the ID available in the APIC table.
2010-08-04 10:02:11 +00:00
jruoho
87a3551c76 On second thought, rename the mutex so it can be (logically) shared. We will
not need such granularity that different states would require a different lock.
2010-07-30 06:11:14 +00:00
jruoho
988469445d Add a per ACPI CPU mutex for C-states. Protect the _CST update with this:
when the idle-information is being updated (e.g. due acpiacad(4) events),
we can not enter the idle-loop. The lock must run at the same priority
(IPL_NONE) as ACPICA's mutexes obtained via AcpiOsCreateMutex() a.k.a.
AcpiOsCreateSemaphore(). Also check want_resched as the first thing and
clarify the suspend/resume path.

There is still one race condition identified: when the driver is loaded as a
module, we must gracefully kick all CPUs out from the ACPI idle-loop upon
detachment.
2010-07-29 22:42:58 +00:00
jruoho
2ef2de7924 Refactor to make this more readable. No functional change. 2010-07-29 11:03:09 +00:00
jruoho
a240caeadb Add "pnp0c14" to the list of HIDs. Required for LG X110. As valid EISA IDs
should be all upper case, leave this as a onetime quirk specific to acpiwmi(4).
2010-07-29 07:10:39 +00:00
jruoho
cc2aad5da2 Remove also the HIDs from previous. 2010-07-28 16:29:11 +00:00
jruoho
c1b6b639ac Remove the homegrown attempt to match the parent PCI bus. This was only used
for descriptive purposes, and for such purposes the ACPIVERBOSE output is
much better.
2010-07-28 16:26:56 +00:00
jruoho
0df7185e13 Remove leftovers from the aiboost(4) removal. 2010-07-28 16:02:33 +00:00
pgoyette
9e9cac1c34 Use __arraycount(). No functional change. 2010-07-27 15:16:16 +00:00
jruoho
1d37b0a731 Add a quirk for pgoyette@'s old (ACPI 1.0) NVIDIA board.
It was analyzed that this DSDT busy-loops some unknown PCI memory regions in
several places. Because the regions are apparently almost constant, this
causes several conditions where the interpreter might enter into an infinite
loop. Luckily ACPICA detects this and rightly spams AE_AML_INFINITE_LOOP
warnings.

Not much we can do. Declare as broken beyond repair. Set acpi_force_load=1
to use ACPI or use a custom DSDT.
2010-07-27 06:14:37 +00:00
jruoho
1392a1cea1 Move the GAS definition to the header so it can be shared. Make a basic
sanity check before casting to the GAS. Rename the _CSD structure; the
optional "cross logical processor dependency information" is almost
identical in C, P, and T states. Add some comments to the header.
2010-07-27 05:11:32 +00:00